Jetpack 4.5.1& v4l2_ioctl strangeness [SOLVED]

Short version:

Use ioctl() instead of v4l2_ioctl().

Long Version:

I recently started updating my production image from Jetpack 4.2 to 4.5.1 on my TX2 and found that my code that uses v4l2_ioctl would fail on certain commands, like setting the camera format (MJPEG in my case) - giving me an error of unsupported format. Similarly, setting V4L2_BUF_TYPE_VIDEO_CAPTURE and would result in an “Unsupported buffer type”.

After much, much cursing and general irritation, I found that using ioctl() directly from <sys/ioctl.h> instead of v4l2_ioctl() from <libv4l2.h> worked as it used to in Jetpack 4.2.

I would recommend, based on my experience, that if you find your v4l2 code is running strangely, that you avoid the v4l2 wrappers and dialogue directly with the device driver (uvcvideo in my case). Could be a configuration issue on my part, but given the clean install, somewhat unlikely.

Posting this as already solved, in the hopes that Google brings you here and saves you the pain and angst that I had to endure.

Mario.

2 Likes

Nice! Thanks for your sharing to community!

Thank you very much, it worked perfectly!