Hi, I am currently trying to get the AR0521 camera running on a Verdin iMX8MP on a Dahlia carrier board. I got the camera raw stream running, but as soon as I use the hardware video encoder or decoder in a gstreamer call, the pipeline fails immediately with this error message
vpuenc_h264-0: Could not initialize supporting library
I also saw this post from roughly 2 years ago, which mentions the same issue:
As the hardware video encoder and decoder is advertised on the Toradex website, I hope somebody can help me to get it running?
Could you unlock me for uploading files, then I can share how I created the Docker image for the camera?
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello,
It sounds like you’re encountering a challenge with the hardware video encoder/decoder on your Verdin iMX8MP when using GStreamer. The error message “vpuenc_h264-0: Could not initialize supporting library” typically indicates an issue with the necessary libraries or configurations.
Here are some steps you can take to troubleshoot and potentially resolve this issue:
Update Software: Ensure you are using the latest version of TorizonCore and any related containers. Updates often include important fixes.
GStreamer Plugins: Verify that all required GStreamer plugins are installed in your Docker container. The vpuenc_h264 element needs specific plugins that might not be included by default.
Library Dependencies: Check for any missing library dependencies. Review your Dockerfile to ensure all necessary packages for the encoder/decoder are included.
Device Tree Overlays: Make sure the correct device tree overlay is applied. For the AR0521 camera, use the verdin-imx8mp_ar0521_overlay.dts to ensure proper hardware configuration.
Known Issues: Look into any known issues or errata related to the Verdin iMX8MP and Dahlia carrier board. There might be specific workarounds or patches available.
Simplify the Pipeline: Try running a simpler GStreamer pipeline to isolate the problem. This can help determine if the issue lies with the encoder/decoder or another part of the pipeline.
I hope these suggestions help you get the hardware encoder/decoder running smoothly. If you have further questions, feel free to ask.
Best regards,
Toradex AI Assistant
Please, also check if these links can help you solve your problem:
Hi,
today I built the Docker image of the vpuGeneric sample again from the newest commit of the bookworm-new branch. This time it went through without any modifications.
The camera works, but using the video encoder I still get the same error:
# update-alternatives --set libg2d.so.1 /usr/lib/aarch64-linux-gnu/libg2d-viv.so.2.1.0
# gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw, width=1920, height=1080, framerate=60/1 ! videoconvert ! vpuenc_h264 ! video/x-h264 ! h264parse ! qtmux ! filesink location=videotestsrc.mp4
Setting pipeline to PAUSED ...
====== VPUENC: 4.7.2 build on Jan 8 2025 10:48:49. ======
wrapper: 3.0.0 (VPUWRAPPER_ARM64_LINUX Build on Jan 8 2025 10:47:54)
vpulib: 1.1.1
firmware: 1.1.1.0
ERROR: from element /GstPipeline:pipeline0/vpuenc_h264:vpuenc_h264-0: Could not initialize supporting library.
Additional debug info:
../gst-libs/gst/video/gstvideoencoder.c(1804): gst_video_encoder_change_state (): /GstPipeline:pipeline0/vpuenc_h264:vpuenc_h264-0:
Failed to start encoder
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
sudo tdx-info
Password:
Software summary
------------------------------------------------------------
Bootloader: U-Boot
Kernel version: 5.15.129-6.5.0-devel+git.6f8fd49366db #1-TorizonCore SMP PREEMPT Mon Dec 23 14:11:20 UTC 2024
Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/a992185cd12dfcb0b279996dd90e68a45a466dfb41c80243d0c1e8940eff155c/0
Distro name: NAME="TorizonCore"
Distro version: VERSION_ID=6.5.0-devel-20241225134819-build.0
Distro variant: VARIANT="Docker"
Hostname: verdin-imx8mp-15503045
------------------------------------------------------------
Hardware info
------------------------------------------------------------
HW model: Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version: 0058 V1.1B
Serial number: 15503045
Processor arch: aarch64
------------------------------------------------------------
I am currently using self-built Torizon OS 6.5.0 with the AR0521 Yocto overlay. Which one is the latest version where video encoding was confirmed working?
Thanks for the additional information.
The 0058 Verdin iMX8M Plus Quad 4GB WB IT module has a working VPU, so we can look into what else may be the issue here.
Which command are you using to run the container?
With the following command, I can get the VPU encoding working using the same pipeline that you used:
Hi Bruno,
thanks with this command I can use the hardware video encoder/decoder. Is there some way to detect if cgroup rules are missing, or how did you find that out?
For reference for other users, here are some usefull gstreamer pipelines:
Otherwise, to find which cgroups are needed, it will depend on the task and which devices are needed.
Initially I added the relevant mxc devices’ cgroup rules and afterwards searched for the missing one by trying different configurations.
There may be a better way to do this, but this was simple enough.