Issue with displaying 2 different application on 2 different screens (LVDS and HDMI)

Hi,
I have enabled LVDS and HDMI displays. Both screens are working but acting as extended screen.
I have created 2 docker images named ‘A’ and ‘B’ which contains Qt application. I want to display container A on HDMI and B on LVDS. But on running both containers , both are getting displayed on the same portion of hdmi.
Hereby attaching the weston.ini file
root@apalis-imx8-07239822:/etc# cat xdg/weston/weston.ini
[core]
#gbm-format=argb8888
idle-time=0
#use-g2d=1
#xwayland=true
repaint-window=16
#enable-overlay-view=1
modules=screen-share.so

#[shell]
#size=1920x1080

[libinput]
enable_tap=true
touchscreen_calibrator=true
calibration_helper=/usr/bin/toradex-save-touchscreen-calibration

#[output]
#name=HDMI-A-1
#mode=1920x1080@60
#transform=rotate-90

#[output]
#name=HDMI-A-2
#mode=off

WIDTHxHEIGHT Resolution size width and height in pixels

off Disables the output

preferred Uses the preferred mode

current Uses the current crt controller mode

#transform=rotate-90

[screen-share]
command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize --rdp-tls-cert=/etc/freerdp/keys/server.crt --rdp-tls-key=/etc/freerdp/keys/server.key


Also attaching portion of weston-info below:-
root@apalis-imx8-07239822:/etc# weston-info

*** Please use wayland-info instead
*** weston-info is deprecated and will be removed in a future version

interface: ‘wl_compositor’, version: 4, name: 1
interface: ‘wl_subcompositor’, version: 1, name: 2
interface: ‘wp_viewporter’, version: 1, name: 3
interface: ‘zxdg_output_manager_v1’, version: 2, name: 4
xdg_output_v1
output: 21
name: ‘LVDS-1’
logical_x: 1920, logical_y: 0
logical_width: 1280, logical_height: 800
xdg_output_v1
output: 20
name: ‘HDMI-A-1’
logical_x: 0, logical_y: 0
logical_width: 1920, logical_height: 1080
interface: ‘wp_presentation’, version: 1, name: 5


The command that we are using to run docker container are
docker run --rm -it -e XDG_RUNTIME_DIR=/run -e WAYLAND_DISPLAY=wayland-0 -v /run:/run -v /dev/dri:/dev/dri sruthisathyan/automotive:A

and

docker run --rm -it -e XDG_RUNTIME_DIR=/run -e WAYLAND_DISPLAY=wayland-0 -v /run:/run -v /dev/dri:/dev/dri sruthisathyan/automotive:B

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To achieve displaying different applications on two different screens (LVDS and HDMI) using Weston on Toradex hardware, you need to configure Weston to recognize and handle each display independently. Based on the information provided, it seems like both applications are being directed to the same display because the WAYLAND_DISPLAY environment variable for both containers is set to the same value (wayland-hdmi). To direct each application to a different display, you’ll need to configure Weston to create separate Wayland displays for each screen and then adjust the environment variables for your Docker containers accordingly.

  1. Configure Weston for Multiple Displays: You need to modify your weston.ini file to define separate outputs for HDMI and LVDS. Since the provided weston.ini does not show active configuration for multiple outputs, you should uncomment and configure the [output] sections for each display. For example:
[output]
name=HDMI-A-1
mode=preferred
transform=normal

[output]
name=LVDS-1
mode=preferred
transform=normal

Ensure that the name fields match the names of your displays as recognized by Weston (as shown in your weston-info output).

  1. Separate Wayland Displays for Each Screen: By default, Weston does not create separate Wayland displays for each screen. You might need to run multiple instances of Weston, each configured for a specific display, or use a Weston feature that supports multiple displays if available. This setup is more complex and depends on the capabilities of Weston and the specifics of your environment.

  2. Adjust Docker Container Environment Variables: Once you have separate Wayland displays configured for each screen, you need to adjust the WAYLAND_DISPLAY environment variable for each Docker container to match the corresponding Wayland display. For example, if you have wayland-0 for HDMI and wayland-1 for LVDS, your Docker run commands should look like this:

For HDMI display:

docker run --rm -it -e XDG_RUNTIME_DIR=/run -e WAYLAND_DISPLAY=wayland-0 -v /run:/run -v /dev/dri:/dev/dri sruthisathyan/automotive:A

For LVDS display:

docker run --rm -it -e XDG_RUNTIME_DIR=/run -e WAYLAND_DISPLAY=wayland-1 -v /run:/run -v /dev/dri:/dev
		

Please, also check if these links can help you solve your problem:

https://developer.toradex.com/torizon/provided-containers/working-with-weston-on-torizoncore
https://developer.toradex.com/linux-bsp/os-development/build-u-boot-and-linux-kernel-from-source-code/build-linux-kernel-from-source-code.

Followed the above steps. But I am not able to create a weston instance. Getting error as
root@apalis-imx8-07239822:/# weston --socket=wayland-lvds --backend=drm-backend.so --device=LVDS-1 --tty=8 --config=/etc/xdg/weston/weston_lvds.ini
Date: 2024-08-01 UTC
[06:53:52.687] weston 10.0.1
https://wayland.freedesktop.org
Bug reports to: Issues · wayland / weston · GitLab
Build: lf-5.15.52-2.1.0+
[06:53:52.687] Command line: weston --socket=wayland-lvds --backend=drm-backend.so --device=LVDS-1 --tty=8 --config=/etc/xdg/weston/weston_lvds.ini
[06:53:52.687] OS: Linux, 5.15.148-6.7.0-devel+git.f437ddb7191d, #1 SMP PREEMPT Wed May 15 17:04:15 UTC 2024, aarch64
[06:53:52.687] Flight recorder: enabled
[06:53:52.688] Using config file ‘/etc/xdg/weston/weston_lvds.ini’
[06:53:52.688] Output repaint window is 16 ms maximum.
[06:53:52.688] Loading module ‘/usr/lib/libweston-10/drm-backend.so’
[06:53:52.695] initializing drm backend
[06:53:52.695] Trying logind launcher…
[06:53:52.696] logind: requested VT --tty=8 differs from real session VT 7
[06:53:52.696] logind: cannot setup systemd-logind helper error: (Invalid argument), using legacy fallback
[06:53:52.696] Trying weston_launch launcher…
[06:53:52.696] could not get launcher fd from env
[06:53:52.696] Trying direct launcher…
[06:53:52.704] drm fd not master
[06:53:52.706] no drm device found
[06:53:52.734] BUG: layer_list is not empty after shutdown. Calls to weston_layer_fini() are missing somwhere.
[06:53:52.735] fatal: failed to create compositor backend
Internal warning: debug scope ‘drm-backend’ has not been destroyed.

Please watch the above video.
How to do dual display using wayland window manager.

Hi @SruthiSathyan ,

Please refer to the article " working with weston on Torizon"

Hi,
I am working on Reference multimedia image not Torizon.

Hi, were you able to run the same application on HDMI and LVDS display at the same time. I am also using apalis imx8 evaluation board but for me the application is running on HDMI only. My LVDS is power on and displaying time, but I cannot view my application. If it was successful for you, can you please reply to me with the steps? I have modified overlays.txt and weston.ini file as well and my application is CinematicExperience.

Thank you.

Hi @SruthiSathyan,

Please confirm again, I can see that you are running containers which are possible in TorizonOS.

Hi @sahil.tx ,
We are working with the Apalis-iMX8_Reference-Multimedia-Image-Tezi_6.7.0 on our Toradex board. The Docker containers we mentioned each contain a different application. We built the Docker images on our host machine and successfully pulled them onto the Toradex board. We were able to run both containers on the board, but currently, both applications are displaying on the same section of the screen. The HDMI and LVDS are functioning as an extended display. We need one container to display on the HDMI output and the other on the LVDS output.

Hi @SruthiSathyan ,

By default, the displays works in extended mode,
Please try the modification mentioned below in your weston.ini file and let us know the results.
Redirecting the output - one DRM interface

Hi @SruthiSathyan ,
We tested running different application on different displays (HDMI and LVDS).
Please check this post.