QT 5.12 and TX2 DRM HDMI crash

Hi,

I have a QApplication on TX2 that renders on HDMI.
X11 is completely disabled and not present in system.
I use KMS/DRM as plaform for rendering, hence my startup configuration is:

QT_QPA_EGLFS_LAYER_INDEX = 0
QT_QPA_EGLFS_KMS_PLANE_INDEX = 1
QT_QPA_EGLFS_KMS_CONNECTOR_INDEX = 0
QT_QPA_PLATFORM = eglfs
QT_QPA_EGLFS_INTEGRATION = eglfs_kms_egldevice
QT_QPA_EGLFS_KMS_ATOMIC = 1
QT_QPA_EGLFS_ALWAYS_SET_MODE = 1
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);

If I have HDMI monitor plugged everything works fine.
I need to take care of monitor plug/unplug and hence screen availability, else qt app crashes.

I am using therefore QT screen interface https://doc.qt.io/qt-5/qguiapplication.html

  • method QGuiApplication::screens()
    This method does not change result during runtime.
    If I create application and then call method it always returns initial value, also if monitor plugged/unplugged

SIGNALS:

  • QGuiApplication::screenAdded
  • QGuiApplication::screenRemoved
  • QGuiApplication::primaryScreenChanged
    None of the above signals get fired if I plug/unplug monitor.

I couldn’t find any issues in https://doc.qt.io/qt-5/embedded-linux.html

So my question is, is the screen add/remove/list changes NOT supported on TX2 EGLFS with the eglfs_kms DRM Backend?

Any other ways to check monitor plugged/unplugged?

Thanks
Martin

Hi,

is the screen add/remove/list changes NOT supported on TX2 EGLFS with the eglfs_kms DRM Backend

I think you mean the hotplug function is supported by DRM or not, right? The answer is yes.

Have you enable tegra-udrm during your test?

$ sudo modprobe tegra-udrm modeset=1

Hi,

we don’t enable tegra-udrm but use default drm library. Short note: Because we use also nvidia gstreamer nvdrmvideosink element in our system and with tegra-udrm enabled, nvdrmvideosink always fails to run. Error is “Failed to set universal planes” with whatever setting.

Back to QT:

the plug / unplug of hdmi monitor is recognized by kernel.
E.g. I can see changes at runtime in /sys/class/graphics/fb0/device/panel_connected , values is toggling from 0 to 1.

The problem is the QT Screens API, which I think relies on qpa drm backend.

  • function QGuiApplication::screens() returns always 0, if I started the QT Application with hdmi disconnected and then connect monitor. the function does not return 1.
  • the signal QGuiApplication::screenAdded does not get fired if I started the QT Application with hdmi disconnected and then connect monitor.

Hope I clarified my issue
Thanks

Hi mmontel,

The tegra-udrm is responsible for passing the hotplug event to userspace application like Qt.
Though how Qt implements the qpa backend also matters here, I think you could try to enable udrm and see if qt app is able to detect it.

Actually, we don’t fully support Qt.

Thanks for reply,

I can try but unfortunatelly I cannot to use tegra-udrm finally, else nvdrmvideosink fails.
Beside note: Do you know why nvdrmvideosink fails with tegra-udrm enabled? Error is always “Failed to set universal planes”.

Do you have a list of issues that are not supported in QT eglfs kms/drm?

Thanks

Hi mmontel,

I see some similar issue opened internally for your nvdrmvideosink issue. But I am not sure if they are same. Could you open a new ticket which only asks the issue of nvdrmvideosink? Please also put the error log you hit in that topic.
I will pass this new topic to internal team to debug.

Unfortunately, about Qt, I meant we don’t have any QA process on QT. It is not tested and verified, so no list for your request here.

Hi,

as soon as I can try tegra-udrm with QT i will let you know…

Should tegra-udrm module be enabled, is it the correct solution for a final product?
We don’t have any issues on drm, a part these 2…

Should tegra-udrm module be enabled, is it the correct solution for a final product?

Actually, the drm driver on tegra is not really 100% compatible with upstream libdrm.
We are still integrating the interface to align them. That is the possible reason causing the hotplug issue you have.

It is your decision for your own final product. I could only give you suggestion to enable tegra-udrm. And report any issue to us if you find any.