Seeking Help: Wayland/Weston Video Autoplay on Genio-350 EVK

I’m building an automated Digital Signage application on MediaTek Genio-i350-EVK running Yocto pre build image Weston. The script uses GStreamer (waylandsink) for hardware-accelerated video looping.

I am facing a Wayland focus/surface-mapping issue when trying to automate the playback on boot:

  • When launching the script automatically via SystemD, Weston suspends the video layer because it lacks foreground focus (the video only plays if I actively click the Weston terminal with a mouse).
  • When switching to kiosk-shell.so and launching natively via Weston’s [autolaunch] config, it successfully boots into kiosk mode, but I only see a black screen instead of the GStreamer video.

What is the officially recommended way on this Genio board to auto-start a permanent, full-screen Wayland gst-play-1.0 background process so it instantly grabs top-layer focus on boot without requiring a mouse click?

Thanks,

Hi,

I wanted to follow up on my earlier query regarding the automated Digital Signage setup on the MediaTek Genio-i350-EVK using pre build Yocto and Weston user.

To briefly recap, I am facing an issue where:

  • GStreamer (waylandsink) video playback launched via SystemD does not gain foreground focus unless manually clicked.
  • Using kiosk-shell with Weston allows auto-launch, but results in a black screen instead of video output.

I am looking for the recommended approach to:

  • Auto-start a full-screen GStreamer (gst-play-1.0) process at boot
  • Ensure it runs as a persistent background process
  • Automatically gains top-layer focus without requiring user interaction

Could you please provide guidance or point me to the official method for handling this on the Genio platform?

Looking forward to your response.

Hi Nicky,

Thanks for your question. While MediaTek, as a SoC and BSP software vendor, isn’t in the best place to provide you an “officially recommended way” to setup an auto-run flow for your system and application, we can investigate this issue together.

Could you provide code snippets on:

  1. Your systemd unit file used to launch the Gstreamer application
  2. If you don’t use autolaunch, would your GStreamer application show in the correct display if you launch the application manually?
  3. What is the user account / identitity you used to launch your GStreamer application?
  4. What application framework does your GStreamer application use? e.g. GTK or QT, or it’s a debugging gst-launch script?

Is it possible to solve the problm with GAI like gemini or claude? I guess this is a quite common issue for display products?
I’ve pasted you questions into gemini pro 3.1 flash lite. Here is the response from GAI (gemini)

Hope this will help.

Technical Guide: Automated Digital Signage on Genio-350-EVK

The "black screen" or "focus loss" issues you are experiencing on the Genio-350 are likely due to waylandsink attempting to render before the Weston compositor is fully initialized, or kiosk-shell failing to assign the surface to the output without a specific app-id.

Here is the recommended implementation path:

1. Recommended Architecture: SystemD Service

Avoid using Weston’s [autolaunch] in weston.ini, as it often leads to race conditions with hardware decoding resources. Use a SystemD service instead, ensuring it waits for Weston to initialize.

Create/Update /etc/systemd/system/digital-signage.service:

ini

[Unit]
Description=Digital Signage Player
After=weston.service
Requires=weston.service

[Service]
User=root
Environment=XDG_RUNTIME_DIR=/run/user/0
Environment=WAYLAND_DISPLAY=wayland-0
ExecStartPre=/bin/sleep 5
ExecStart=/usr/bin/gst-launch-1.0 playbin uri=file:///home/root/video.mp4 video-sink="waylandsink app-id=signage-player"
Restart=always

[Install]
WantedBy=multi-user.target

2. Key Commands for Focus and Display

If you still see a black screen, refine your GStreamer pipeline to ensure hardware acceleration is correctly initialized and tied to the shell.

Set the app-id: kiosk-shell requires an identifier to map the window correctly.

MediaTek-Specific Pipeline: Use the hardware decoder (v4l2h264dec) and ensure dmabuf is enabled to allow the GPU to take control of the layer:

bashgst-launch-1.0 playbin uri=file:///path/to/video.mp4 \
    video-sink="waylandsink app-id=signage-player sync=true"

3. Troubleshooting & Debugging

If the screen remains black, follow these steps:

Check GPU Permissions: Ensure the user (e.g., root) has read/write access to /dev/dri/card0.

Verify Weston Status: Run weston-info to confirm the output is active before your script launches.

Alternative Shell: If kiosk-shell.so continues to fail, try changing the shell configuration in weston.ini to fullscreen-shell.so instead of kiosk-shell.so. This is generally more compatible with automatic full-screen requirements.

4. Diagnostic Checklist

Check your logs for hardware or driver conflicts:

dmesg | grep -i vpu

dmesg | grep -i dri

Summary: The most stable approach is using SystemD (with a sleep delay to ensure compositor readiness), utilizing waylandsink with a defined app-id, and potentially switching to fullscreen-shell.so if kiosk-shell remains unresponsive.

If you receive specific error messages from the dmesg commands above, please provide them, and I can help you analyze potential driver-level conflicts.
  1. ini
    [Unit]
    Description=Digital Signage Device (Wayland Auto Play)
    #Wait for both network interfaces and Weston compositor to be fully operational
    After=network-online.target weston.service
    Wants=network-online.target
    Requires=weston.service
    [Service]
    User=weston
    WorkingDirectory=/home/weston/Digital-signage
    #Required Wayland environments for hardware playback
    Environment=“WAYLAND_DISPLAY=wayland-1”
    ExecStart=/bin/sh /home/weston/Digital-signage/run_signage.sh
    Restart=always
    RestartSec=10
    [Install]
    WantedBy=multi-user.targeting
  2. Because Weston (the Wayland compositor) isolates graphics, GStreamer’s waylandsink needs to know where to render the video. Our run_signage.sh handles this automatically:
    #Setup Display environments needed for GST Wayland Sinks
    export XDG_RUNTIME_DIR=/run/user/$(id -u)
    export WAYLAND_DISPLAY=wayland-1
    #Execute the python media_player directly
    exec python3 media_player.py --config config.json
  3. The GStreamer application is launched using the weston user account.
    ini
    [Service]
    User=weston
  4. cmd = [
    “gst-launch-1.0”,
    “–eos-on-shutdown”,
    “filesrc”, f"location={filepath}", “!”,
    “qtdemux”, “name=demux”,
    “demux.video_0”, “!”, “queue”, “!”, “v4l2slh264dec”, “!”,
    “v4l2convert”, “output-io-mode=dmabuf-import”, “!”,
    “waylandsink”, “sync=true”, “fullscreen=true”
    ]

Hi,

I wanted to follow up on my earlier query regarding the automated Digital Signage setup on the MediaTek Genio-i350-EVK using pre build Yocto and Weston user.