Qtmultimedia does not compile with tdx-reference-minimal-image

Dear community,

We are currently update our custom linux image by switching to linux 5.4-2. The goal is to have a distribution with Qt/QML + EGLFS + Gstreamer.
The first try is about to build a prototype image based on tdx-reference-minimal-image by tuning it as :

[local.conf]


ACCEPT_FSL_EULA = "1"
MACHINE = "apalis-imx6"

DL_DIR = "${TOPDIR}/../downloads"
SSTATE_DIR ?= "${TOPDIR}/../sstate-cache"
TMPDIR = "${TOPDIR}/tmp"
DEPLOY_DIR = "${TOPDIR}/deploy"
PACKAGE_CLASSES ?= "package_ipk"

EXTRA_IMAGE_FEATURES ?= "debug-tweaks package-management"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"

BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"

PACKAGECONFIG_append_pn-qemu-system-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"

CONF_VERSION = "1"

INHERIT += "rm_work"
INHERIT += "toradex-mirrors"


DISTRO = "poky"
IMX_DEFAULT_BSP = "nxp"
LICENSE_FLAGS_WHITELIST="commercial"

# Defined in meta/recipes-core/packagegroups/packagegroup-base.bb
MACHINE_FEATURES_remove = "usbgadget alsa"
MACHINE_FEATURES_remove = "pci"

CONMANPKGS ?= "connman connman-plugin-loopback connman-plugin-ethernet connman-client"

GSTREAMER = " \
   gstreamer1.0 \
   gstreamer1.0-plugins-good \
   gstreamer1.0-plugins-bad \
   gstreamer1.0-plugins-imx \
"

#D-BUS devices
DBUS = " \
	dbus \
	upower \
	udisks2 \
"

QT5 = " \
	qtbase \
	qtbase-examples \
	qtquickcontrols \
	qtquickcontrols2 \
	qttranslations \
	cinematicexperience \
	qtmultimedia \
   	qtmultimedia-plugins \
   	qtmultimedia-qmlplugins \
"
IMAGE_INSTALL_append = " \
	dropbear \
	pkgconfig  \
	zlib glib-2.0 evtest  \
	cpufrequtils \
	i2c-tools \ 
	psplash \
	ntfs-3g-ntfsprogs \
	busybox \
	shadow \
	bash \
	coreutils \
	less \
	makedevs \
	mime-support \
	util-linux \
	v4l-utils \
	psplash \
	media-files \
	\
	${GSTREAMER} \
	${QT5} \
	${DBUS} \
"

IMAGE_INSTALL_remove += " \
	packagegroup-base-tdx-cli \
	packagegroup-machine-tdx-cli \
	packagegroup-wifi-tdx-cli \
	packagegroup-wifi-fw-tdx-cli \
"
PREFERRED_PROVIDER_virtual/kernel = "linux-toradex-nxp"

# Distro customization #

IMAGE_INSTALL_remove = "eglinfo-x11"

DISTRO_FEATURES_append = " opengles2 egl opengl gles gbm dri eglfs gles2 polkit"
DISTRO_FEATURES_remove = " x11 wayland wifi 3g bluetooth"


IMAGE_FSTYPES += " ext4"

include conf/machine/include/${MACHINE}.inc

For removing vulkan-loader error at compile runtime:
[gstreamer1.0-plugins-bad_1.16.imx.bbapend]
PACKAGECONFIG[vulkan] = "-Dvulkan=disabled"

[qtbase_%.bbappend]

PACKAGECONFIG_append = " linuxfb eglfs gles2 kms"
PACKAGECONFIG_remove = "gl xcb xcb-xinput"

[qtmultimedia%.bbappend]

PACKAGECONFIG_append = " gstreamer"

[bblayers.conf]

# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "7"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  ${TOPDIR}/../layers/meta-yocto/meta-poky \
  ${TOPDIR}/../layers/openembedded-core/meta \
  \
  ${TOPDIR}/../layers/meta-toradex-nxp \
  ${TOPDIR}/../layers/meta-freescale \
  ${TOPDIR}/../layers/meta-freescale-3rdparty \
  \
  ${TOPDIR}/../layers/meta-toradex-tegra \
  \
  ${TOPDIR}/../layers/meta-toradex-bsp-common \
  \
  ${TOPDIR}/../layers/meta-openembedded/meta-oe \
  ${TOPDIR}/../layers/meta-openembedded/meta-filesystems \
  ${TOPDIR}/../layers/meta-openembedded/meta-gnome \
  ${TOPDIR}/../layers/meta-openembedded/meta-xfce \
  ${TOPDIR}/../layers/meta-openembedded/meta-initramfs \
  ${TOPDIR}/../layers/meta-openembedded/meta-networking \
  ${TOPDIR}/../layers/meta-openembedded/meta-multimedia \
  ${TOPDIR}/../layers/meta-openembedded/meta-python \
  ${TOPDIR}/../layers/meta-freescale-distro \
  ${TOPDIR}/../layers/meta-toradex-demos \
  ${TOPDIR}/../layers/meta-qt5 \
  \
  ${TOPDIR}/../layers/meta-toradex-distro \
  ${TOPDIR}/../layers/meta-custom \
  \
  \
"

The output build is:

ERROR: Task (/home/vincent/dvpt/oe-core/build/../layers/meta-toradex-nxp/backports/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.16.imx.bb:do_compile) failed with exit code '1'

Without qtmultimedia, the distribution is well compiled and we are able to launch Qt cinematic exemple on the board (Apalis imx6q 1.1b).

Please, advise :slight_smile:

KR

Can you share the full output from the failing build? There should be a log.do_compile file in the tmpdir for that package as well that would be helpful.

log.do_compile.1988 (1.3 MB)
Dear @drew.tx ,

Please find attached the required file. Hope it will help.

Regards, Vincent

It seems your build is failing due to the missing symbol gst_egl_image_from_dmabuf:

FAILED: gst-libs/gst/gl/libgstgl-1.0.so.0.1602.0 
arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/recipe-sysroot  -o gst-libs/gst/gl/libgstgl-1.0.so.0.1602.0 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/meson-generated_.._gl-enumtypes.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglapi.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglbasefilter.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglbasememory.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglcolorconvert.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglbuffer.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglbufferpool.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglcontext.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstgldebug.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstgldisplay.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglfeature.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglfilter.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglformat.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglframebuffer.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglmemory.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglmemorypbo.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstgloverlaycompositor.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglquery.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglrenderbuffer.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglshader.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglshaderstrings.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglsl.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglslstage.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglsyncmeta.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglupload.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglutils.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglviewconvert.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglwindow.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglmemorydma.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/egl_gstegl.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/egl_gsteglimage.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/egl_gstglcontext_egl.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/egl_gstgldisplay_egl.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/egl_gstglmemoryegl.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/viv-fb_gstgldisplay_viv_fb.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/viv-fb_gstglwindow_viv_fb_egl.c.o' 'gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglphymemory.c.o' -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libgstgl-1.0.so.0 -Wl,-Bsymbolic-functions -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now gst-libs/gst/video/libgstvideo-1.0.so.0.1602.0 gst-libs/gst/allocators/libgstallocators-1.0.so.0.1602.0 /home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/recipe-sysroot/usr/lib/libgstbase-1.0.so /home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/recipe-sysroot/usr/lib/libgstreamer-1.0.so /home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/recipe-sysroot/usr/lib/libgobject-2.0.so /home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/recipe-sysroot/usr/lib/libglib-2.0.so -lm /home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/recipe-sysroot/usr/lib/liborc-0.4.so /home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/recipe-sysroot/usr/lib/libgmodule-2.0.so -pthread /home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/recipe-sysroot/usr/lib/libGLESv2.so /home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/recipe-sysroot/usr/lib/libEGL.so -lg2d -Wl,--end-group '-Wl,-rpath,$ORIGIN/../video:$ORIGIN/../allocators' -Wl,-rpath-link,/home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/build/gst-libs/gst/video -Wl,-rpath-link,/home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/build/gst-libs/gst/allocators
/home/vincent/dvpt/oe-core/build/tmp/work/cortexa9t2hf-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.16.imx-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: gst-libs/gst/gl/8c16ccf@@gstgl-1.0@sha/gstglmemorydma.c.o: in function `_gl_mem_create':
/usr/src/debug/gstreamer1.0-plugins-base/1.16.imx-r0/build/../git/gst-libs/gst/gl/gstglmemorydma.c:111: undefined reference to `gst_egl_image_from_dmabuf'
collect2: error: ld returned 1 exit status

I saw a similar report on the NXP community without any solution.

Our standard BSP does not have this issue so it must be related to the changes you have made. My best guess is that it is the PACKAGECONFIG change you made to qtmultimedia. You may need to contact QT for support on that.

Drew

I’ve removed qtmultimedia from my local.conf file, but the error remains.

The build failure is actually in the gstreamer-plugins-base recipe. I thought maybe it was a dependency issue with the qtmultimedia PACKAGECONFIG but I guess not. My next guess is that it is related to your DISTRO_FEATURES settings.

So, I’ve tried to build only gstreamer-plugins-base recipe by previously remove my packageconfig to re-enable vulkan loader in gstreamer1.0-plugins-bad_1.16.imx.bbapend.
Now, the output is as expected :

ERROR: Nothing PROVIDES 'vulkan-loader' (but /home/vincent/dvpt/oe-core/build/../layers/meta-toradex-nxp/backports/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.16.imx.bb DEPENDS on or otherwise requires it)
vulkan-loader was skipped: one of 'x11 wayland' needs to be in DISTRO_FEATURES
ERROR: Required build target 'gstreamer1.0-plugins-imx' has no buildable providers.
Missing or unbuildable dependency chain was: ['gstreamer1.0-plugins-imx', 'gstreamer1.0-plugins-bad', 'vulkan-loader']

But I do not require X11 nor Wayland on my final image, what could I do ?

I took a quick look at the gstreamer1.0-plugins-base sources and it seems the missing function is enabled when the DRM and EGL configurations are enabled. It looks like you can force the build to succeed by adding libdrm to the DEPENDS of gstreamer1.0-plugins-base as follows in local.conf (or the equivalent change in a bbaapend file)

DEPENDS_append_pn-gstreamer1.0-plugins-base = ' libdrm '

Whether that will work properly at runtime I don’t know.

Drew

Hello @drew.tx ,

Thank you for this suggestion, you’re right, the compilation step is now successful, I have other complaint from bitbake but not in relation with gstreamer. I’m going to re-enable qtmultimedia in the recipe and keep you in touch.

Vincent