Nano 2GB + Raspi HQ Cam nvarguscamerasrc working but not v4l2-ctl

I have the HQ Camera working with the 2GB nano without mods. gst with nvarguscamersrc works great but I am having problems with using v4l2-ctrl capturing raw images.

I am using the following command:
v4l2-ctl -d /dev/video0 --verbose --set-fmt-video=width=4032,height=3040,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw

The program just hangs and raw file is 0 bytes. Syslog shows tegra_channel_error_status:error 20022

Thank you in advance for your help!

hello nootropicMan,

may I know which sensor module it is?
could you please dump the pixel formats with below commands,
for example, $ v4l2-ctl -d /dev/video0 --list-formats-ext
thanks

I am using the Raspi HQ camera IMX477 sensor module.

the formats via v4l2-ctl are 4032x3040 @ 30fps and 1920x1080 @ 60fps.

The camera works fine with gst-launch + nvarguscamerasrc at the sepcified formats. v4l2-ctl can list the modes and query other information but won’t save out a raw file.

hello nootropicMan,

please double confirm you’re assign correct width, height and pixel formats for v4l2 standard controls.
could you please exclude --stream-to to verify the sensor streams?
for example, $ v4l2-ctl -d /dev/video0 --set-fmt-video=width=4032,height=3040,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100.
it should output > for each captured frames.
thanks

Hi Jerry, I tried the command and I’m still experiencing the same hang condition. Here is the output:

$ v4l2-ctl -d /dev/video0 --verbose --set-fmt-video=width=4032,height=3040,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 4032/3040
Pixel Format : ‘RG10’
Field : None
Bytes per Line : 8064
Size Image : 24514560
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
no more ouput after this and hangs indefinitely

Thank you in advance for your help!

hello nootropicMan,

may I also know can 1920x1080@60-fps sensor mode works with v4l2 standard controls?
thanks

Hi Jerry, I tried the same command with 1920x1080 and output and hang condition is the same. Do you think this is a sensor driver issue?

I am using the latest driver from Nvidia:
https://developer.nvidia.com/rpi-imx477-support-nano-2gb

Also, where can I download the source code to this driver?

hello nootropicMan,

you may download the latest (i.e. R32.4.4) L4T sources release package for the source code.
for example,
here’s kernel sources of IMX477,
$L4T_Sources/r32.4.4/Linux_for_Tegra/source/public/kernel/nvidia/drivers/media/i2c/imx477.c

hello nootropicMan,

FYI,
I’m also able to reproduce the issue with Nano-2GB/IMX477.
it seems v4l2-ctl is not working with IMX477 whereas nvarguscamerasrc works.

please having your use-case with nvarguscamersrc,
we’re going to check this v4l2 standard control failures internally, will update the status after we come out conclusions.
thanks

Thank you, Jerry. I look forward to your update.

You guys rock!

Hi Jerry,

Is there any update on this issue? I’m currently working on a prototype that requires getting the raw image. Thank you in advance!

hello DicksonChow,

it’s still under investigation, we have not root cause the issue yet.

Hi Jerry,

I just did a “sudo apt update” and “sudo apt upgrade” and now the camera is no longer detected. Nvargus and v4l2-ctl --all says there is no camera.

hello DicksonChow,

it’s kernel manually update, RPi IMX477 Support Nano 2GB.
while you’re doing system upgrade, it may refresh the kernel image to revert the changes.
thanks

1 Like

hi all,

FYI,
there’re some changes for the latest L4T release, and it fixes the issue that v4l2-ctl is not working with IMX477 whereas nvarguscamerasrc works.
we’re having internal code-review, it’s target for the next public JetPack release, (i.e. JetPack-4.6/ l4t-r32.6)
thanks