Ov5693 CSI camera not V4L2 compatible?

I’ve been trying to test the v4l2cuda sample against the existing dev board CSI camera using the V4L2 API.

The sample times out on the “select” call (ie no buffers are ready to be dequed).

# topology
sudo media-ctl -p
Media controller API version 0.1.0

Media device information
------------------------
driver          tegra-vi4
model           NVIDIA Tegra Video Input Device
serial          
bus info        
hw revision     0x3
driver version  0.0.0

Device topology
- entity 1: 150c0000.nvcsi--1 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		<- "ov5693 2-0036":0 [ENABLED]
	pad1: Source
		-> "vi-output, ov5693 2-0036":0 [ENABLED]

- entity 4: ov5693 2-0036 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev1
	pad0: Source
		[fmt:UYVY8_1X16/1280x720 field:none colorspace:srgb]
		-> "150c0000.nvcsi--1":0 [ENABLED]

- entity 6: vi-output, ov5693 2-0036 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "150c0000.nvcsi--1":1 [ENABLED]
# And from v4l2-ctl:
v4l2-ctl --all
Driver Info (not using libv4l2):
	Driver name   : tegra-video
	Card type     : vi-output, ov5693 2-0036
	Bus info      : platform:15700000.vi:2
	Driver version: 4.9.140
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Priority: 2
Video input : 0 (Camera 2: no power)
Format Video Capture:
	Width/Height      : 1280/720
	Pixel Format      : 'UYVY'
	Field             : None
	Bytes per Line    : 7022
	Size Image        : 5055840
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Limited Range)
	Flags             : 
.......

The camera shows up under “v4l2-ctl” and the driver does respond to V4L2 IOCTL queries so it would be fair to assume that it is possible.

// For example this works:
xioctl (fd, VIDIOC_QUERYCAP, &cap);

Looking at dmesg we get some familiar error codes:

[ 7808.156010] tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel
[ 7808.165797] nvcsi 150c0000.nvcsi: csi4_stream_check_status (2) INTR_STATUS 0x00000004
[ 7808.173671] nvcsi 150c0000.nvcsi: csi4_stream_check_status (2) ERR_INTR_STATUS 0x00000004
[ 7808.385636] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 7808.392074] tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel
[ 7808.605670] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11

There was a patch discussed on the forum for this way back in L4T 28.x but I’m on 32.x.

Questions

  • Is this an old driver bug that still needs patching?
  • The documentation shows nvarguscamerasrc using libargus, what does libargus use to read from the CSI camera?

(note that gst-launch-1.0 nvarguscamerasrc ! nvvvidconv ! nv3dsink works)

Have a try below patch and get the trace log to get more information.

https://elinux.org/Jetson/l4t/Camera_BringUp