Hello, our team has developed a camera driver and device tree file for the IMX327 sensor on an Orin NX (with a custom carrier board). Currently, the camera can successfully capture video using commands such as video-viewer
and GStreamer. However, we’ve encountered an issue: whenever we use the v4l2-ctl
command to stream or capture RAW format images, the system always hangs without any response. I’m not sure what’s causing this issue.
Could anyone please help clarify the reason behind this behavior? If additional debugging information is needed, please let me know. Thanks, everyone!
nx4@nx4-desktop:~$ v4l2-ctl -d /dev/video0 --stream-count=1 --stream-mmap --stream-to=frame.raw --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
^C
nx4@nx4-desktop:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
^C
Tracing logs captured while streaming:
root@nx4-desktop:/home/nx4# cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 21/21 #P:6
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
kworker/3:2-13525 [003] .... 3318.999692: rtcpu_string: tstamp:104390796804 id:0x04010000 str:"VM0 deactivating."
v4l2-ctl-16143 [000] .... 3321.546677: tegra_channel_open: vi-output, imx327 30-001a
v4l2-ctl-16143 [000] .... 3321.552527: tegra_channel_set_power: imx327 30-001a : 0x1
v4l2-ctl-16143 [000] .... 3321.552536: camera_common_s_power: status : 0x1
v4l2-ctl-16143 [000] .... 3321.567772: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x1
v4l2-ctl-16143 [000] .... 3321.567776: csi_s_power: enable : 0x1
v4l2-ctl-16143 [002] .... 3321.568326: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt c4
v4l2-ctl-16143 [002] .... 3321.574022: tegra_channel_set_stream: enable : 0x1
v4l2-ctl-16143 [004] .... 3321.577226: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
v4l2-ctl-16143 [004] .... 3321.577229: csi_s_stream: enable : 0x1
v4l2-ctl-16143 [004] .... 3321.577537: tegra_channel_set_stream: imx327 30-001a : 0x1
kworker/3:2-13525 [003] .... 3321.599626: rtcpu_string: tstamp:104471177158 id:0x04010000 str:"VM0 activating."
kworker/3:2-13525 [003] .... 3321.599629: rtcpu_vinotify_event: tstamp:104471818950 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:3343081320416 data:0x759d580010000000
kworker/3:2-13525 [003] .... 3321.599630: rtcpu_vinotify_event: tstamp:104471819103 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:3343081326880 data:0x0000000031000001
kworker/3:2-13525 [003] .... 3321.599630: rtcpu_vinotify_event: tstamp:104471819256 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:3343081367648 data:0x759d550010000000
kworker/3:2-13525 [003] .... 3321.599630: rtcpu_vinotify_event: tstamp:104471819388 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:3343081374176 data:0x0000000031000002
vi-output, imx3-16145 [001] .... 3324.359929: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt c4
kworker/3:2-13525 [003] .... 3324.387587: rtcpu_vinotify_event: tstamp:104558625445 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:3345867535680 data:0x759d580010000000
kworker/3:2-13525 [003] .... 3324.387589: rtcpu_vinotify_event: tstamp:104558625580 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:3345867578336 data:0x0000000031000001
kworker/3:2-13525 [003] .... 3324.387590: rtcpu_vinotify_event: tstamp:104558625733 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:3345867595968 data:0x759d550010000000
kworker/3:2-13525 [003] .... 3324.387590: rtcpu_vinotify_event: tstamp:104558625864 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:3345867656384 data:0x0000000031000002
nx4@nx4-desktop:~$ v4l2-compliance -d /dev/video0
v4l2-compliance SHA: not available, 64 bits
Compliance test for tegra-video device /dev/video0:
Driver Info:
Driver name : tegra-video
Card type : vi-output, imx327 30-001a
Bus info : platform:tegra-capture-vi:1
Driver version : 5.10.120
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : tegra-camrtc-ca
Model : NVIDIA Tegra Video Input Device
Serial :
Bus info :
Media version : 5.10.120
Hardware revision: 0x00000003 (3)
Driver version : 5.10.120
Interface Info:
ID : 0x0300000e
Type : V4L Video
Entity Info:
ID : 0x0000000c (12)
Name : vi-output, imx327 30-001a
Function : V4L2 I/O
Pad 0x0100000d : 0: Sink
Link 0x02000012: from remote pad 0x1000003 of entity '13e40000.host1x:nvcsi@15a00000-': Data, Enabled
Required ioctls:
test MC information (see 'Media Driver Info' above): OK
test VIDIOC_QUERYCAP: OK
Allow for multiple opens:
test second /dev/video0 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: 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)
Control ioctls (Input 0):
warn: v4l2-test-controls.cpp(92): Gain: (max - min) % step != 0
warn: v4l2-test-controls.cpp(92): Exposure: (max - min) % step != 0
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: 20
Format ioctls (Input 0):
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
fail: v4l2-test-formats.cpp(1280): ret && node->has_frmintervals
test VIDIOC_G/S_PARM: FAIL
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 (Input 0):
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 (Input 0):
fail: v4l2-test-buffers.cpp(715): q.create_bufs(node, 1, &fmt) != EINVAL
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)
Total for tegra-video device /dev/video0: 45, Succeeded: 43, Failed: 2, Warnings: 2