v4l2-compliance error VIDIOC_G/S_PARM: FAIL

Hi,

I’ve been working on a camera driver using Jetpack 4.2 on the TX2. I’m having difficulty getting this working and so ran the v4l2-compliance tool as recommended in the L4t Sensor Programming guide.

I therefore executed the command “v4l2-compliance -d /dev/video0”, and have attached the results.

The test reports one failure “test VIDIOC_G/S_PARM: FAIL”.

I can’t find any information on how to interpret the results of this test and so was wondering if someone could help me to understand what the failure means and how to address it.

Thanks.

v4l2_compliance.txt (2.68 KB)

hello marc.armstrong,

v4l2 compliance sending several IOCTLs to low-level drivers and have sanity tests.
your testing failure should related to frame interval settings, which control the frame-rate.

Format ioctls:
		test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
		fail: v4l2-test-formats.cpp(1184): ret && node->has_frmintervals
		test VIDIOC_G/S_PARM: FAIL

suggest you review the frame rate settings in your sensor device tree,
and please also check below sources for frame interval controls.
thanks

<i>$l4t-r32.1/kernel_src/kernel/nvidia/drivers/media/platform/tegra/camera/vi/channel.c</i>

static int 
tegra_channel_enum_frameintervals(struct file *file, void *fh,
			      struct v4l2_frmivalenum *intervals){...}

Thanks for the suggestion. My frame rate settings were in fact wrong in my device tree, however after fixing those (see attached) there was no change in the compliance test.

v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'RG10'
	Name        : 10-bit Bayer RGRG/GBGB
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.011s (90.000 fps)
$ v4l2-ctl --list-frameintervals=width=1920,height=1080,pixelformat=808535890
ioctl: VIDIOC_ENUM_FRAMEINTERVALS
	Interval: Discrete 0.033s (30.000 fps)
$ v4l2-ctl --list-frameintervals=width=1280,height=720,pixelformat=808535890
ioctl: VIDIOC_ENUM_FRAMEINTERVALS
	Interval: Discrete 0.017s (60.000 fps)
$ v4l2-ctl --list-frameintervals=width=640,height=480,pixelformat=808535890
ioctl: VIDIOC_ENUM_FRAMEINTERVALS
	Interval: Discrete 0.011s (90.000 fps)

It is possible that the pixel clock setting is incorrect as this calculation is not clear to me when I compare other dtsi files that I have seen for the IMX219 camera with my own calculated value.

Following the sensor driver programming guide I calculate the pixel clock setting for the IMX219 as

pixel_clk_hz = sensor data rate per lane (Mbps) * number of lanes / bits per pixel
    = 755*4/10
    = 302MHz

According to the IMX219 data sheet, there is a 10 bit A/D on chip converter, therefore I am assuming this means 10bits per pixel, however the other dtsi files I have seen use 12 bits.

The data rates are specified as Max.755Mbps/lane(@4lane), 912Mbps/Lane(@2lane), therefore, for 4 lanes the above value seems correct to me.
tegra186-my-camera-config-a00_1.txt (9.43 KB)

hello marc.armstrong,

could you please check if you’re able to run camera use-case.
thanks

Hi,

Just to clarify, can you confirm what you mean by the camera use-case?

When I run the following

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=t.raw --verbose

I get lot of “PXL_SOF syncpt timeout! err = -11” errors.

hello marc.armstrong,

please enable the VI tracing log from debugfs to gather more details,
for example,

echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo > /sys/kernel/debug/tracing/trace
cat /sys/kernel/debug/tracing/trace

Hi,
VI trace attached.
Thanks
v4l2_Ctl_Trace.txt (45.2 KB)

hello marc.armstrong,

it seems the sensor did not bring-up successfully,
you may debug further to check the root-causer, please access [Sensor Software Driver Programming Guide] and refer to Debugging Tips session for more details.

BTW, it’s also weird that your timestamp returning negative values.

tegra_channel_capture_frame: sof:-549619123424.-266831188416

suggest you also contact with your sensor vendor and review the driver implementation.
thanks

Thanks for your help. It’s difficult because my development is based on third party drivers which use a much older version of Jetpack using different Auvidea carrier boards from the J120. There are too many variables and so difficult to debug. Auvidea are working on a driver but cannot specify a release date, therefore I’m hoping someone out there has got an IMX219 driver working using jetpack 4.2, who may be able to assist.

hello marc.armstrong,

suspect there’s driver issue since we had some IMX219 kernel driver updates to adapt Raspberry Pi camera v2 IMX219 cameras.
could you please apply this device tree patch (0001-t18x-common-e3322-update-sensor-DT-properties.patch) to update properties for verification.
thanks

devtalk1061812_Aug27_DT_patch.tar.gz (2.85 KB)

Thanks. I’ll try to apply the patch. I have my own custom DT file because I am running on an Auvidea carrier board, which has a single CSI port.

I think I need to update my kernel sources. I am currently working with kernel 4.9.140, however I have discovered that this is attempting to call an imxXXX_g_input_status function and this is not present as part of the new sensor driver format, when comparing driver imx185.c with imx185_v1.c.

I have tried to download v32.2.1 from the downloads page, but the link isn’t quite working for me.

hello marc.armstrong,

FYI,
you should also check documentation, V4L2 Kernel Driver (Version 2.0), for the details of v4l2 driver update.
thanks

Hi,
I’ve updated to the latest version of Jetpack and have applied the DT patch but am still getting the same PXL_SOF error. I am certain I can communicate with the device over CSI, having put in some debug to read back CSI transactions, and have also checked that the settings defined in imx219_mode_tbls.h are being written. I was hoping that once the driver was running and CSI comms were established this would be sufficient to get the camera working once the correct settings were applied.

Is it likely that there is another hardware configuration required to actually stream video or do you think the issue relates to the software implementation? I don’t see much information relating to the PXL_SOF error, other than failure to receive a sync point.

I also noticed that in the latest kernel, tegracam_set_ctrls() in tegracam_ctrls.c still attempts to call the function g_input_status, which doesn’t exist in the new format for sensor camera driver.

Thanks

hello marc.armstrong,

FYI, I had imx219 sensor locally for verification on Jetson-TX2,

ubuntu@tegra-ubuntu:~$ dmesg | grep imx219
[    5.290983] imx219 30-0010: tegracam sensor driver:imx219_v2.0.6
[    5.322496] tegra-vi4 15700000.vi: subdev imx219 30-0010 bound

v4l2 standard control could access the sensor streaming without failures.

ubuntu@tegra-ubuntu:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100 
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.09 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.04 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps

based-on l4t-r32.2 and also device tree change in comment #10, confirmed that imx219 works with Jetson-TX2 from my side,
suggest you may also contact with your sensor vendor to dig into this issue.
thanks

Hi,

Yes, I’ve contacted Auvidea, who develop the carrier board. But their TX2 driver isn’t ready yet.

It’s good to know the latest IMX219 driver works. Can I ask what platform you are running on? Are you using CSI?

Thanks

hello marc.armstrong,

yes, that’s CSI sensor. I’ve verified IMX219 driver with Jetson-TX2 devkit.
thanks

Hi,

We have the devkit so I can try to replicate. I understand I need a CSI adapter to connect the IMX219 sensor. Can you tell me what you are using please.

Thanks

hello marc.armstrong,

I’m using the camera board that only for internal verification. however it using the same imx219 sensor driver.

BTW,
the v4l2-compliance error (VIDIOC_G/S_PARM: FAIL) will resolve for the next public release, i.e. l4t-r32.3
please also refer to my local testing as below.
thanks

ubuntu@tegra-ubuntu:~$ v4l2-compliance 
Driver Info:
	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

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

	Control ioctls:
		test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
		test VIDIOC_QUERYCTRL: OK
		test VIDIOC_G/S_CTRL: OK
		test VIDIOC_G/S/TRY_EXT_CTRLS: OK
		test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
		test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
		Standard Controls: 1 Private Controls: 16

	Format ioctls:
		test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
		test VIDIOC_G/S_PARM: OK (Not Supported)
		test VIDIOC_G_FBUF: OK (Not Supported)
		test VIDIOC_G_FMT: OK
		test VIDIOC_TRY_FMT: OK
		test VIDIOC_S_FMT: OK
		test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
		test Cropping: OK (Not Supported)
		test Composing: OK (Not Supported)
		test Scaling: OK (Not Supported)

	Codec ioctls:
		test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
		test VIDIOC_G_ENC_INDEX: OK (Not Supported)
		test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

	Buffer ioctls:
		test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
		test VIDIOC_EXPBUF: OK

Test input 0:


Total: 42, Succeeded: 42, Failed: 0, Warnings: 0