Streaming v4l2 from csi sensor with V4L_MEMORY_USERPTR l4t-32.3.1

We’ve implemented a camera driver based on the l4t camera driver documentation. It works fine with v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG8 --stream-user --stream-count=100 -d /dev/video0. Accessing the images, we would like to use V4L_MEMORY_USERPTR. An ioctl for VIDIOC_REQBUFS with that parameter return without error. However, when trying to call VIDIOC_QBUF, an error code -22 is returned.

I’ve seen that there is an old post on this subject V4L2_MEMORY_USERPTR not working with soc camera . Has there been any update on this?

Due to --stream-user working well that tell the V4L_MEMORY_USERPTR working.
Could you try to trace the v4l2-ctl source code to figure it out.

My apologies. The --stream-user above was pasted in error.
Using v4l2-ctl works with --stream-mmap, but not with -sstream-user.

$ v4l2-ctl --stream-user --stream-count=100 -d /dev/video0
VIDIOC_QBUF: failed: Invalid argument

Hi,

You can try running

$ v4l2-ctl --stream-user --stream-count=100 -d /dev/video0 --verbose

and share the all dmesg information

$ dmesg

Regards
Angel

$ v4l2-ctl --stream-user --stream-count=100 -d /dev/video0 --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: failed: Invalid argument

dmesg output is no different than with --stream-mmap.

You can use a GStreamer Pipeline to get more information:

gst-launch-1.0 v4l2src io-mode=userptr device=/dev/video0 ! videoconvert ! ximagesink --gst-debug=*v4l*:8

Note: This pipeline is just for debug purposes, it does not include NVIDIA hardware component.

Angel

I can repo by v4l2-ctl .
Could you check the latest version of v4l2-ctl.

Hi jschwendner,

Please check the the latest version of v4l2-ctl, if further issue found, please open a new topic.

For the V4L2_MEMORY_USERPTR please have a reference to the sample code.

…/tegra_multimedia_api/samples/v4l2cuda/capture.cpp