The system is Yocto on Toradex Verdin iMX8M Plus, kernel 5.15.148-0+git.23a8e831749d.
My application that streams a video from iMX8MP Plus may suddenly decide to stop and close the video streams and open and start them again. The streaming itself works fine. The problem is that once in a while the application hangs.
No memory leak is detected during the failure. I tried to hunt the problem and found that if the application open and close the video device multiple times, then eventually it causes all video devices to be locked. All video devices /dev/video… report “no signal” status. The problem can be reproduced with the script below. When the video stack fails (usually after 1 or 2 hundreds cycles) the script stops incrementing the counter:
#!/bin/bash
while true; do
v4l2-ctl -d /dev/video5 --silent --stream-count=1 --stream-mmap --stream-to=/dev/null
printf “frame: %d\r” $((i=i+1))
done
Is anything can be done to resolve the issue?
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 an issue with video device locking on the Verdin iMX8M Plus after multiple open/close cycles. This could be related to how resources are managed during video capture.
For efficient video capture and streaming on Toradex modules, it’s advisable to use GStreamer with hardware acceleration plugins. This approach leverages the dedicated hardware (VPU) for video processing, reducing the load on the CPU. You can construct GStreamer pipelines using the gst-launch-1.0
tool for testing purposes. More information on using GStreamer can be found in the Toradex documentation.
If you prefer to use V4L2 directly, consider the following tips to manage resources effectively:
- Ensure proper cleanup of video resources between captures.
- Introduce a delay between capture cycles to allow resources to reset.
- Monitor system resources during operation to identify potential bottlenecks.
For further debugging, you can use gst-inspect-1.0
to explore available video plugins and their capabilities.
I hope this helps resolve the issue you’re facing. If you have any more questions, feel free to ask!
Best regards,
Toradex AI Assistant.
Please, also check if these links can help you solve your problem:
Video Encoding and Playback With GStreamer (Linux) | Toradex Developer Center.
Hi Sergey,
This is going back some time and fallen through the cracks. How is this issue going? Were you able to solve it?
Have you tired with a different camera to see if any other outcome there?
Best regards,
Michael Park
Toradex
I am still experiencing the problem. I tried other camera. And no camera too. The video capture fails. No luck.
Hey Sergey,
Can I ask what camera you are using? We have a note here that there may be some issue regarding camera failure that works by reloading the driver.
https://developer.toradex.com/torizon/6/application-development/use-cases/multimedia/first-steps-with-csi-camera-set-5mp-ar0521-color-torizon#camera-usage
Eric Singer
Toradex
One of the camera I tried is KPC-C20NUB. But also the failure occurs if no camera is attached. Reloading the tw686x driver doesn’t help. Only a complete reboot recovers the video capture.