Failed to create wl_display when starting Qt wayland compositor
-
I am trying to cross-compile the Qt wayland compositor example 'fancy compositor' for an embedded linux on the stm32mp1.
When trying to start the compositor I get the error:Failed to create wl_display (No such file or directory)
My procedure is the following:
- I stop the pre-installed Weston service: (systemctl stop weston-graphical-session.service, systemctl stop seatd-weston.service, systemctl stop weston-checkgpu.service)
- I set the required env. variables: XDG_RUNTIME_DIR=/home/root/tmp-dir, QT_WAYLAND_CLIENT_BUFFER_INTEGRATION=wayland-egl, QT_XCB_GL_INTEGRATION=xcb_egl, QT_QPA_PLATFORM=wayland
- I deploy and run the compositor
./fancy-compositor
My main question is if the fancy compositor requires a Weston display server already running or should it be able to launch by its own and provide a display server for apps launched on the device?
My build does not include eglfs since this leads to conflicts with the wayland layers.Thank you for any help.
-
From what I have found out the fancy compositor can either be run
- with the eglfs backend not requiring another running wayland display server
- using another running wayland display server and attaching to it to run on top of it.
Note: check what wayland servers are already running and then must create a new one when launching the custom Qt compositor. On the stm32mp1 for example a wayland server 'wayland-0' was started once but is now now working correctly anymore so do not attach to it. We also have a 'wayland-1' server running and a 'wayland-1.lock' in the /home/Weston folder. Therefore you should attach your custom compositor to wayland-1 but not name it wayland-1.
Either pass it on the command line when starting
./fancy-compositor --wayland-socket-name 'nested-compositor'
Or specify in the QML code
WaylandCompositor { id: waylandCompositor socketName: "wayland-nested"
And then for running it use the wayland-1 server
WAYLAND_DISPLAY=wayland-1
-