TorizonOS 6.5 Running a Qt app linked xcb under wayland

Is there a way to run a 3rd party qt5 statically linked app using xcb to run under Wayland.
get the following error when trying to run it in the sample debian qt5 containers provided by Toradex

root@0786e352b88f:/home/torizon/Blackmagic_Desktop_Video_Linux_12.7.1/deb/aarch64# BlackmagicDesktopVideoSetup
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Authorization required, but no authorization protocol specified

qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

Aborted (core dumped)

Hello @nkj ,
Which HW and SW are you using? Can you please run tdx-info and paste the info here?

Best regards,
Josep

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.129-6.5.0+git.6f8fd49366db #1-TorizonCore SMP PREEMPT Fri Dec 22 11:15:52 UTC 2023
Kernel command line:      pci=nomsi root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/d84a97a24c27b978c409f4a362d0c0c28589d246081ac1a02c48b317582ca645/0
Distro name:              NAME="TorizonCore"
Distro version:           VERSION_ID=6.5.0-build.8
Distro variant:           VARIANT="Docker"
Hostname:                 apalis-imx8-06548593
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Apalis iMX8QM/QP on Apalis Evaluation Board
Toradex version:          0037 V1.0B
Serial number:            06548593
Processor arch:           aarch64
------------------------------------------------------------

Hi @nkj ,

thank you for the info. It seems that you are missing the Qt platform plugin “wayland”. Can you try this command?

Disclaimer:

docker run -e ACCEPT_FSL_EULA=1 --rm -it --name=qt5 \
           -v /tmp:/tmp \
           -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore \
           --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
           torizon/qt5-wayland-examples-vivante:$CT_TAG_QT5_WAYLAND_EXAMPLES_VIVANTE \
           bash

This will launch Qt5 container, that contains Wayland libraries and Qt5 compositor, pre-built Qt5 examples for quick evaluation, and binary drivers for Vivante GPUs (i.MX 8 modules). Please read this reference to read more: List of Container Images for Torizon | Toradex Developer Center.

Basically, I run the command based on this article Qt on Torizon OS | Toradex Developer Center. Also, you can read more about Qt on Torizon OS. I did following changes in the command:

  • –name=qt6 → --name=qt5

  • qt6-wayland-examples-vivante → qt5-wayland-examples-vivante

  • $CT_TAG_QT6_WAYLAND_EXAMPLES_VIVANTE → $CT_TAG_QT5_WAYLAND_EXAMPLES_VIVANTE

Well, actually just changing 6 to 5 :slight_smile: I would recommend migrating to Qt6 if possible according to this information

I am running Verdin iMX8M Plus with Yavia board and I can find the plugin:

root@f52d12b6de58:/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms# ls
libqeglfs.so    libqminimal.so     libqoffscreen.so  libqwayland-egl.so      libqwayland-xcomposite-egl.so  libqxcb.so
libqlinuxfb.so  libqminimalegl.so  libqvnc.so        libqwayland-generic.so  libqwayland-xcomposite-glx.so
root@f52d12b6de58:/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms# printenv | grep QT_QPA
QT_QPA_EGLFS_INTEGRATION=eglfs_kms
QT_QPA_EGLFS_KMS_CONFIG=/etc/kms.conf
QT_QPA_PLATFORM=wayland
QT_QPA_EGLFS_KMS_ATOMIC=1

Give it a try and let us know if this solves your issue. Also, please refer to all documentation links about if you have further problems.

to clarify i was using the toradex qt5-wayland-examples-vivante container

the issue is i am trying to run a precompiled 3rd party app. “blackmagic design desktop” this seems to be linked against qt binaries which only have the xcb qt platform backend. i wanted to know if there was a way to run such a binary

Hi @nkj

you can try running xcb-only applications under Wayland using xWayland and forcing Qt to use the xcb backend by setting the QT_QPA_PLATFORM="xcb" variable. You will also need to su torizon, aka, change to a non-root user inside the Qt5 container due to permissions (see the code snippet below)
If your application needs hardware acceleration, it will not work and most likely segfault.

Simple apps like xeyes that don’t make use of EGL will work

# ... inside qt5-wayland container with Weston container also running, per our documentation
root@1d5055468ccc:/lib/aarch64-linux-gnu/qt5/examples/gui/analogclock# su torizon
$ ls
analogclock  analogclock.pro  main.cpp
$ su torizon
$ QT_QPA_PLATFORM="xcb" ./analogclock
# ... analogclock shows up ...

This is a limitation that comes from NXPs downstream software, not exclusive to Torizon but all iMX8-based devices running Linux: Re: X11 support for iMX8 and iMX8M - NXP Community

2 Likes

Thanks @leon.tx that was helpful to get the app starting up.

Glad I was able to help and I wish you success with the project!

Hey everyone, I believe this is not needed in BSP 6 since it is added by default, but in case XWayland is not there (ie. BSP 5), one should also modify the Weston container:

You need to enable it on weston.ini with:

[core]
xwayland=true

You can find details for Xwayland here: Weston - ArchWiki