Verdin iMX8MP: not HDMI on custom image

Hi! tdx-info output below.

I have a Verdin iMX8M-Plus running on a Dahlia board and an HDMI monitor connected to the native port.

If I run the tdx-reference-multimedia-image the HDMI output works as expected, but when running my image weston fails to start.

My image definition is:

DESCRIPTION = "My image"
LICENSE = "MIT"

inherit core-image features_check populate_sdk_qt6

CONFLICT_DISTRO_FEATURES = "directfb"

IMAGE_FEATURES += " \
    splash \
    package-management \
    ssh-server-openssh \
    hwcodecs \
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston', \
       bb.utils.contains('DISTRO_FEATURES',     'x11', 'x11-base x11-sato', \
                                                       '', d), d)} \
"

CORE_IMAGE_EXTRA_INSTALL += " \
        packagegroup-core-full-cmdline \
        ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'weston-xwayland', '', d)} \
        fbgrab \
        libgpiod \
        libgpiod-tools \
        rsync \
"

CORE_IMAGE_EXTRA_INSTALL:mx8-generic-bsp += " \
        packagegroup-fsl-gstreamer1.0 \
        packagegroup-fsl-gstreamer1.0-full \
"

systemd_disable_vt () {
    rm ${IMAGE_ROOTFS}${sysconfdir}/systemd/system/getty.target.wants/getty@tty*.service
}

# Install fonts
QT6_FONTS = " \
    ttf-dejavu-mathtexgyre \
    ttf-dejavu-sans \
    ttf-dejavu-sans-condensed \
    ttf-dejavu-sans-mono \
    ttf-dejavu-serif \
    ttf-dejavu-serif-condensed \
"

QT6_IMAGE_INSTALL = " \
    ${QT6_FONTS} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'qtwayland qtwayland-plugins', '', d)} \
"

IMAGE_INSTALL += " \
    ${QT6_IMAGE_INSTALL} \
    packagegroup-tdx-cli \
    packagegroup-tdx-graphical \
    chrony \
    aqt6app \
"

IMAGE_PREPROCESS_COMMAND:append = " ${@ 'systemd_disable_vt;' if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and bb.utils.contains('USE_VT', '0', True, False, d) else ''} "

Now Weston fails with:

root@verdin-imx8mp-15379869:~# journalctl -u weston
Apr 28 17:42:31 verdin-imx8mp-15379869 systemd[1]: Starting Weston, a Wayland compositor, as a system service...
Apr 28 17:42:33 verdin-imx8mp-15379869 systemd[1]: Started Weston, a Wayland compositor, as a system service.
Apr 28 17:42:33 verdin-imx8mp-15379869 systemd[1]: weston.service: Main process exited, code=killed, status=11/SEGV
Apr 28 17:42:33 verdin-imx8mp-15379869 systemd[1]: weston.service: Failed with result 'signal'.

If I try to run it from the console I get:

root@verdin-imx8mp-15379869:~# /usr/bin/weston --modules=systemd-notify.so
Date: 2022-04-28 UTC
[17:56:09.881] weston 10.0.1
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: lf-5.15.52-2.1.0+
[17:56:09.881] Command line: /usr/bin/weston --modules=systemd-notify.so
[17:56:09.881] OS: Linux, 5.15.148-6.8.0-devel+git.284966e8d6ee, #1 SMP PREEMPT Wed Jun 26 17:51:19 UTC 2024, aarch64
[17:56:09.881] Flight recorder: enabled
[17:56:09.881] Using config file '/etc/xdg/weston/weston.ini'
[17:56:09.881] Output repaint window is 16 ms maximum.
[17:56:09.881] Loading module '/usr/lib/libweston-10/wayland-backend.so'
[17:56:09.881] Failed to load module: /usr/lib/libweston-10/wayland-backend.so: cannot open shared object file: No such file or directory
[17:56:09.882] fatal: failed to create compositor backend

I also checked the the overlays are being applied:

## Executing script at 50280000
Loading DeviceTree: imx8mp-verdin-wifi-dev.dtb
90278 bytes read in 2 ms (43 MiB/s)
118 bytes read in 0 ms
Applying Overlay: verdin-imx8mp_hdmi_overlay.dtbo
2219 bytes read in 1 ms (2.1 MiB/s)
Applying Overlay: verdin-imx8mp_dsi-to-hdmi_overlay.dtbo
3652 bytes read in 1 ms (3.5 MiB/s)
Applying Overlay: verdin-imx8mp_spidev_overlay.dtbo
561 bytes read in 1 ms (547.9 KiB/s)
11682674 bytes read in 43 ms (259.1 MiB/s)
Bootargs: root=PARTUUID=97cefb1e-02 ro rootwait console=tty1 console=ttymxc2,115200 consoleblank=0 earlycon

So… what am I missing here?

root@verdin-imx8mp-15379869:~# tdx-info

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.148-6.8.0-devel+git.284966e8d6ee #1 SMP PREEMPT Wed Jun 26 17:51:19 UTC 2024
Kernel command line:      root=PARTUUID=97cefb1e-02 ro rootwait console=tty1 console=ttymxc2,115200 consoleblank=0 earlycon
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=6.8.0-devel-20240923170007-build.0
Distro variant:           -
Hostname:                 verdin-imx8mp-15379869
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0058 V1.1B
Serial number:            15379869
Processor arch:           aarch64
------------------------------------------------------------

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

Did you like my answer?

:+1: :-1:


It looks like you’re encountering an issue with Weston failing to start on your custom image for the Verdin iMX8M Plus module. The error message indicates that the wayland-backend.so module cannot be found, which is likely causing the compositor backend to fail.

Here are a few steps to troubleshoot and resolve the issue:

  1. Check Weston Configuration:
    Ensure that your weston.ini configuration file is correctly set up. The file should be located at /etc/xdg/weston/weston.ini. Verify that the [core] section is properly configured to use the correct backend.

  2. Verify Weston Installation:
    Make sure that all necessary Weston packages are installed. Specifically, check if the libweston-10 package is installed, as it contains the wayland-backend.so module.

    opkg list-installed | grep weston
    

    If the package is missing, you can add it to your image by modifying your Yocto recipe:

    CORE_IMAGE_EXTRA_INSTALL += "weston libweston-10"
    
  3. Device Tree Overlays:
    You mentioned that the overlays are being applied correctly. Double-check that the HDMI-related overlays are correctly specified and applied. The relevant overlays for HDMI on the Verdin iMX8M Plus should include verdin-imx8mp_hdmi_overlay.dtbo and verdin-imx8mp_dsi-to-hdmi_overlay.dtbo.

  4. Kernel Modules:
    Ensure that the necessary kernel modules for HDMI are loaded. You can check the loaded modules using:

    lsmod
    

    If any required modules are missing, you may need to include them in your kernel configuration.

  5. Logs and Debugging:
    Check the system logs for more detailed error messages that might provide additional clues. You can use dmesg and journalctl to inspect the logs:

    dmesg | grep drm
    journalctl -xe
    
  6. Weston Command Line:
    When running Weston from the console, try specifying the backend explicitly:

    /usr/bin/weston --backend=drm-backend.so --modules=systemd-notify.so
    

    This can help ensure that Weston is using the correct backend.

  7. Yocto Recipe:
    Review your Yocto recipe to ensure that all necessary dependencies and configurations are included. Here is a simplified example of what your recipe might look like:

    DESCRIPTION = "My image"
    LICENSE = "MIT"
    
    inherit core-image features_check populate_sdk_qt6
    
    CONFLICT_DISTRO_FEATURES = "directfb"
    
    IMAGE_FEATURES += " \
        splash \
        package-management \
        ssh-server-openssh \
        hwcodecs \
        ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston', \
           bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11-base x11-sato', '', d), d)} \
    "
    
    CORE_IMAGE_EXTRA_INSTALL += " \
            packagegroup-core-full-cmdline \
            ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'weston-xwayland', '', d)} \
            fbgrab \
            libgpiod \
            libgpiod-tools \
            rsync \
            weston \
            libweston-10 \
    "
    
    CORE_IMAGE_EXTRA_INSTALL:mx8-generic-bsp += " \
            packagegroup-fsl-gstreamer1.0 \
            packagegroup-fsl-gstreamer1.0-full \
    "
    
    systemd_disable_vt () {
        rm ${IMAGE_ROOTFS}${sysconfdir}/systemd/system/getty.target.wants/getty@tty*.service
    }
    
    # Install fonts
    QT6_FONTS = " \
        ttf-dejavu-mathtexgyre \
        ttf-dejavu-sans \
        ttf-dejavu-sans-condensed \
        ttf-dejavu-sans-mono \
        ttf-dejavu-serif \
        ttf-dejavu-serif-condensed \
    "
    
    QT6_IMAGE_INSTALL = " \
        ${QT6_FONTS} \
        ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'qtwayland qtwayland-plugins', '', d)} \
    "
    
    IMAGE_INSTALL += " \
        ${QT6_IMAGE_INSTALL} \
        packagegroup-tdx-cli \
        packagegroup-tdx-graphical \
        chrony \
        aqt6app \
    "
    
    IMAGE_PREPROCESS_COMMAND:append = " ${@ 'systemd_disable_vt;' if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and
             
    

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

HDMI Display in clone mode not working on imx8m plus.

I have just compared /ect/xdg/weston/weston.ini form both images, still no luck.

Greetings @lisandropm,

I don’t see anything obvious in your recipe that could lead to this issue. Though it’s hard to predict every change on the yocto level just looking at the recipe itself. What might help is taking the manifest from your custom build with the list of all the installed packages and comparing it to the default manifest list for tdx-reference-multimedia-image.

Perhaps this would help you notice a difference in packages being installed that might be related to the issue you’re seeing.

Another thing I noticed is that in your Weston logs this line:

[17:56:09.881] Failed to load module: /usr/lib/libweston-10/wayland-backend.so: cannot open shared object file: No such file or directory

First of all, does this file actually exist or not in your filesystem?

If yes, then I found another thread on our community where another customer got the same message: Weston not starting on Verdin Dahlia

If you see the answer in this thread, it turns out the customer did some device tree changes that caused the DRM subsystem to not initialize correctly. Did you do any device tree changes in addition to your custom image?

If no, then can you confirm the DRM subsystem is even initialized in your system? Try checking dmesg for any troubling logs related to DRM or similar.

Best Regards,
Jeremias

Hi @jeremias.tx !

I don’t see anything obvious in your recipe that could lead to this issue. Though it’s hard to predict every change on the yocto level just looking at the recipe itself. What might help is taking the manifest from your custom build with the list of all the installed packages and comparing it to the default manifest list for tdx-reference-multimedia-image.

Perhaps this would help you notice a difference in packages being installed that might be related to the issue you’re seeing.

Neither I, and it’s jus a custom layer adding apps and the image defintition, plus meta-qt6.

Another thing I noticed is that in your Weston logs this line:
[…]
First of all, does this file actually exist or not in your filesystem?

No, and it does not on the demo image either.

[…]

If you see the answer in this thread, it turns out the customer did some device tree changes that caused the DRM subsystem to not initialize correctly. Did you do any device tree changes in addition to your custom image?

No changes whatsoever.

If no, then can you confirm the DRM subsystem is even initialized in your system? Try checking dmesg for any troubling logs related to DRM or similar.

I’ll check, else if it fails I’ll start from scratch again…

Another suggestion would be to bisect your changes one by one. Basically add your Yocto changes in piece by piece until you can see what breaks Weston. It’s tedious, but it would help narrow down what exactly needs to be investigated and debugged.

Best Regards,
Jeremias

Well, I’ve got it working. First of all I ran repo sync to be sure I had the latest BSP. Then I modified tdx-reference-multimedia-image in order to build with Qt 6 (basically I swithced Qt 5 to 6 and removed the examples installation). That image worked.

So next thing I simply added a require recipes-images/images/tdx-reference-multimedia-image.bb to my image and things started to work. Which is odd, I had no such issues before with the same image on a Colibri imx8x… but oh well, it works and it’s for a demo, so good enough.

Glad to see you got it working. Requiring the original image recipe probably pulled in some vital packages that were missing from your standalone image recipe. Again comparing the build manifests may reveal what packages were missing from your standalone recipe.

Best Regards,
Jeremias