How to run app in two displays

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


To run applications on two displays using Weston on Torizon, you need to ensure that each application is directed to the correct display. Here’s a step-by-step guide to achieve this setup:

Prerequisites

  1. Weston Container: Ensure you have the Weston container running.
  2. App1 Container: Your first application container.
  3. App2 Container: Your second application container.

Steps to Configure Multi-Display Setup

  1. Identify the App IDs:
    Each Wayland application can set an app ID. You need to find out the app ID for each of your applications. You can do this by running the application with the WAYLAND_DEBUG environment variable set.

    WAYLAND_DEBUG=1 ./your-application
    

    Look for the set_app_id request in the output. For example, you might see something like:

    [123456.789]  -> wl_surface@4.set_app_id("app1")
    

    Here, app1 is the app ID.

  2. Configure weston.ini:
    Edit the weston.ini file to specify which display each application should use. Here’s an example configuration:

    [core]
    shell=kiosk-shell.so
    
    [output]
    name=HDMI-A-1
    mode=1920x1080
    
    [output]
    name=HDMI-A-2
    mode=1920x1080
    
    [kiosk-shell]
    app-id=app1
    output=HDMI-A-1
    
    [kiosk-shell]
    app-id=app2
    output=HDMI-A-2
    

    In this example:

    • HDMI-A-1 and HDMI-A-2 are the names of the displays.
    • app1 and app2 are the app IDs for your applications.
    • Each [kiosk-shell] section directs an application to a specific display.
  3. Run the Weston Container:
    Ensure the Weston container is running with the updated weston.ini file. You can bind mount the weston.ini file if you are in the prototyping phase:

    docker run -d --rm --name=weston --net=host -v /path/to/your/weston.ini:/etc/xdg/weston/weston.ini torizon/wayland-weston
    
  4. Run Your Application Containers:
    Start your application containers, ensuring they are set to use Wayland and have the correct app ID.

    docker run -d --rm --name=app1 --net=host -e WAYLAND_DISPLAY=wayland-0 -e WAYLAND_DEBUG=1 your-app1-image
    docker run -d --rm --name=app2 --net=host -e WAYLAND_DISPLAY=wayland-0 -e WAYLAND_DEBUG=1 your-app2-image
    

Troubleshooting

  • Check App IDs: Ensure the app IDs in the weston.ini file match those set by your applications.
  • Display Names: Verify the display names (e.g., HDMI-A-1, HDMI-A-2) using weston-info inside the Weston container.
  • Logs: Check the logs of the Weston container and your application containers for any errors or warnings.

By following these steps, you should be able to run app1 on one display and app2 on another display using Weston on Torizon.

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

HDMI enable for Colibri IMX8X.