Hi @jeremias.tx, I think you are right about this being a race condition. When I execute docker-compose up
and watch the timing of the two containers, I sometimes see Weston take a little longer to come up. I actually did two runs back to back–the first time my application starts too soon and exits, the second time it works. See below–both containers start at roughly the same time. The difference seems to be that the first time Weston runs, it is generating new RDP certificates, whereas the second time it runs, it is using the cached RDP certificates from before, so it speeds through and is available by the time my application requests the UI. This tracks with the fact that, before I enabled RDP, this problem didn’t occur.
To fix, I’ve removed the ENABLE_RDP=1 flag in Weston since I’m not actually using RDP (using VNC only). I’m also going to add a short delay to my application at startup.
First attempt: Weston takes too long to start, application container (lari2-firmware-1_1) crashes:
root@lari200:/var/sota/storage/docker-compose# docker-compose up
Creating network "docker-compose_default" with the default driver
Creating docker-compose_weston_1 ... done
Creating docker-compose_lari2-firmware-1_1 ... done
Attaching to docker-compose_weston_1, docker-compose_lari2-firmware-1_1
weston_1 | SoC is: 'i.MX6Q'
weston_1 | SoC has GPU: true
weston_1 | SoC has DPU: false
weston_1 | g2d implementation: viv
weston_1 | tee: /var/volatile/weston.log: No such file or directory
weston_1 | Certificates for RDP not found in /var/volatile
weston_1 | Generating RSA private key, 2048 bit long modulus (2 primes)
lari2-firmware-1_1 | Starting application...
weston_1 | .....................+++++
lari2-firmware-1_1 | Failed to create wl_display (Connection refused)
lari2-firmware-1_1 | qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
lari2-firmware-1_1 | This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
lari2-firmware-1_1 |
lari2-firmware-1_1 | Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, xcb.
lari2-firmware-1_1 |
lari2-firmware-1_1 | Aborted
docker-compose_lari2-firmware-1_1 exited with code 134
weston_1 | .............................................................................................................................................................................+++++
weston_1 | e is 65537 (0x010001)
weston_1 | Signature ok
weston_1 | subject=C = CH, ST = Luzern, L = Luzern, O = Toradex, CN = www.toradex.com
weston_1 | Getting Private key
weston_1 | Certificate for RDP successfully generated
weston_1 | Removing previously created '.X*-lock' entries under /tmp before starting Weston. Pass 'IGNORE_X_LOCKS=1' environment variable to Weston container to disable this behavior.
weston_1 | dos2unix: converting file /etc/xdg/weston/weston.ini to Unix format...
weston_1 | dos2unix: converting file /etc/xdg/weston-dev/weston.ini to Unix format...
weston_1 | Couldn't open /dev/tty1
weston_1 | /usr/bin/entry.sh: line 89: [: =: unary operator expected
weston_1 | Date: 2022-04-25 UTC
weston_1 | [15:16:41.742] weston 9.0.0
weston_1 | https://wayland.freedesktop.org
weston_1 | Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
weston_1 | Build: 9.0.0
weston_1 | [15:16:41.742] Command line: /usr/bin/weston --current-mode
weston_1 | [15:16:41.743] OS: Linux, 5.4.154-5.5.0+git.73d0438130d3, #1-TorizonCore SMP Tue Dec 28 12:11:43 UTC 2021, armv7l
weston_1 | [15:16:41.748] Using config file '/etc/xdg/weston/weston.ini'
weston_1 | Date: 2022-04-25 UTC
weston_1 | [15:16:41.742] weston 9.0.0
weston_1 | https://wayland.freedesktop.org
weston_1 | Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
weston_1 | Build: 9.0.0
Second attempt: Weston starts up faster, everything works:
root@lari200:/var/sota/storage/docker-compose# docker-compose up
Starting docker-compose_weston_1 ... done
Starting docker-compose_lari2-firmware-1_1 ... done
Attaching to docker-compose_weston_1, docker-compose_lari2-firmware-1_1
weston_1 | SoC is: 'i.MX6Q'
weston_1 | SoC has GPU: true
weston_1 | SoC has DPU: false
weston_1 | g2d implementation: viv
weston_1 | Certificates for RDP found in /var/volatile. Skipping generation.
weston_1 | Removing previously created '.X*-lock' entries under /tmp before starting Weston. Pass 'IGNORE_X_LOCKS=1' environment variable to Weston container to disable this behavior.
weston_1 | dos2unix: converting file /etc/xdg/weston/weston.ini to Unix format...
lari2-firmware-1_1 | Starting application...
weston_1 | dos2unix: converting file /etc/xdg/weston-dev/weston.ini to Unix format...
weston_1 | Couldn't open /dev/tty1
weston_1 | /usr/bin/entry.sh: line 89: [: =: unary operator expected
weston_1 | Date: 2022-04-25 UTC
weston_1 | [15:18:38.878] weston 9.0.0
weston_1 | https://wayland.freedesktop.org
weston_1 | Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
weston_1 | Build: 9.0.0
weston_1 | [15:18:38.879] Command line: /usr/bin/weston --current-mode
weston_1 | [15:18:38.879] OS: Linux, 5.4.154-5.5.0+git.73d0438130d3, #1-TorizonCore SMP Tue Dec 28 12:11:43 UTC 2021, armv7l
weston_1 | Date: 2022-04-25 UTC
weston_1 | [15:18:38.878] weston 9.0.0
weston_1 | https://wayland.freedesktop.org
weston_1 | Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
weston_1 | Build: 9.0.0
weston_1 | [15:18:38.879] Command line: /usr/bin/weston --current-mode
weston_1 | [15:18:38.879] OS: Linux, 5.4.154-5.5.0+git.73d0438130d3, #1-TorizonCore SMP Tue Dec 28 12:11:43 UTC 2021, armv7l
weston_1 | [15:18:38.886] Using config file '/etc/xdg/weston/weston.ini'
weston_1 | [15:18:38.886] Using config file '/etc/xdg/weston/weston.ini'
weston_1 | [15:18:38.887] Output repaint window is 7 ms maximum.
weston_1 | [15:18:38.887] Loading module '/usr/lib/arm-linux-gnueabihf/libweston-9/drm-backend.so'
weston_1 | [15:18:38.887] Output repaint window is 7 ms maximum.
weston_1 | [15:18:38.887] Loading module '/usr/lib/arm-linux-gnueabihf/libweston-9/drm-backend.so'
weston_1 | [15:18:38.906] initializing drm backend
weston_1 | [15:18:38.906] initializing drm backend
weston_1 | [15:18:38.907] logind: not running in a systemd session
weston_1 | [15:18:38.908] logind: cannot setup systemd-logind helper (-61), using legacy fallback
weston_1 | [15:18:38.907] logind: not running in a systemd session
weston_1 | [15:18:38.908] logind: cannot setup systemd-logind helper (-61), using legacy fallback
weston_1 | [15:18:38.918] using /dev/dri/card1
weston_1 | [15:18:38.918] DRM: supports atomic modesetting