Having issues getting a camera stream up using an IMX219 sensor.
Hardware:
- Custom Carrier Board with Jetson Orin NX 16Gb
- from
cat /etc/nv_tegra_release
→# R35 (release), REVISION: 3.1, GCID: 32827747, BOARD: t186ref, EABI: aarch64, DATE: Sun Mar 19 15:19:21 UTC 2023
- from
uname -r
→5.10.104-tegra
- Using only 2 lanes from IMX219PQH5-C. The 2 lanes on the Jetson side are CSI2_D0 and CSI2_D1, which correct me if I am wrong, use Port 2, Stream 2 (serial_c for tegra_sinterface).
- Deserializer: ds90ub954
- Serializer: ds90ub953
- Using only RIN Port 1 on the Deserializer. Only one camera and one serializer for now.
For the sake of verification, I am using a pattern generation from the deserializer. My workflow is:
- Setup des and ser over i2c. With the back channel configured, the kernel can see the camera sensor at i2c address 0x10.
- The des pattern generation is then configured. It is setup to mimic the output from the imx219 using RAW10, 3280 x 2464, and at 21fps.
- Then I restart the nv_imx219 kernel module. After this is done, here are the results:
In dmesg:
[ 1910.743131] imx219 1-0010: tegracam sensor driver:imx219_v2.0.6
[ 1910.762444] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx219 1-0010 bound
V4l2 Compliance Test using 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, imx219 1-0010
Bus info : platform:tegra-capture-vi:2
Driver version : 5.10.104
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.104
Hardware revision: 0x00000003 (3)
Driver version : 5.10.104
Interface Info:
ID : 0x03000024
Type : V4L Video
Entity Info:
ID : 0x00000022 (34)
Name : vi-output, imx219 1-0010
Function : V4L2 I/O
Pad 0x01000023 : 0: Sink
Link 0x02000028: 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):
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: 0
From media-ctl -p
:
Media controller API version 5.10.104
Media device information
------------------------
driver tegra-camrtc-ca
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 5.10.104
Device topology
- entity 1: 13e40000.host1x:nvcsi@15a00000- (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
<- "imx219 1-0010":0 [ENABLED]
pad1: Source
-> "vi-output, imx219 1-0010":0 [ENABLED]
- entity 32: imx219 1-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev1
pad0: Source
[fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb]
-> "13e40000.host1x:nvcsi@15a00000-":0 [ENABLED]
- entity 34: vi-output, imx219 1-0010 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "13e40000.host1x:nvcsi@15a00000-":1 [ENABLED]
The error after running v4l2-ctl -d /dev/video0 --stream-mmap
is:
[ 459.251111] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 459.260268] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 459.270096] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 459.277814] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 459.288613] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 459.296385] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 459.307302] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 462.067041] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 462.076202] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 462.087141] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 462.095421] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 462.106701] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 462.114521] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 462.125671] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 464.883010] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 464.892162] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 464.902085] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 464.909819] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 464.920498] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 464.928226] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 464.939031] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 467.698998] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 467.708143] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 467.718098] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 467.725821] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 467.736571] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 467.744300] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 467.755134] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 470.515019] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 470.524230] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 470.534120] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 470.541847] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 470.552556] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 470.560285] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 470.571076] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 473.331143] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 473.340289] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
Also enabling the debug trace with:
enable_vi_trace:
@sudo echo 1 > /sys/kernel/debug/tracing/tracing_on
@sudo echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
@sudo echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
@sudo echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
@sudo echo 2 > /sys/kernel/debug/camrtc/log-level
@sudo echo > /sys/kernel/debug/tracing/trace
this gives:
# tracer: nop
#
# entries-in-buffer/entries-written: 40/40 #P:8
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
kworker/4:1-55 [004] .... 110.405630: rtcpu_string: tstamp:4155018217 id:0x04010000 str:"VM0 deactivating."
kworker/4:1-55 [004] .... 111.825603: rtcpu_string: tstamp:4198493373 id:0x04010000 str:"VM0 activating."
kworker/4:1-55 [004] .... 111.825608: rtcpu_vinotify_event: tstamp:4199184668 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:134357980832 data:0x719e300010000000
kworker/4:1-55 [004] .... 111.825609: rtcpu_vinotify_event: tstamp:4199184804 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:134357987296 data:0x0000000031000001
kworker/4:1-55 [004] .... 111.825609: rtcpu_vinotify_event: tstamp:4199184961 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:134358032672 data:0x719e2d0010000000
kworker/4:1-55 [004] .... 111.825609: rtcpu_vinotify_event: tstamp:4199185094 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:134358039200 data:0x0000000031000002
kworker/4:1-55 [004] .... 114.525593: rtcpu_vinotify_event: tstamp:4283278770 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:137054334432 data:0x719e300010000000
kworker/4:1-55 [004] .... 114.525597: rtcpu_vinotify_event: tstamp:4283278907 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:137054381760 data:0x0000000031000001
kworker/4:1-55 [004] .... 114.525597: rtcpu_vinotify_event: tstamp:4283279064 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:137054399328 data:0x719e2d0010000000
kworker/4:1-55 [004] .... 114.525598: rtcpu_vinotify_event: tstamp:4283279195 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:137054493216 data:0x0000000031000002
kworker/4:2-130 [004] .... 117.337581: rtcpu_vinotify_event: tstamp:4371170227 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:139867290976 data:0x719e300010000000
kworker/4:2-130 [004] .... 117.337583: rtcpu_vinotify_event: tstamp:4371170363 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:139867333664 data:0x0000000031000001
kworker/4:2-130 [004] .... 117.337584: rtcpu_vinotify_event: tstamp:4371170519 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:139867351168 data:0x719e2d0010000000
kworker/4:2-130 [004] .... 117.337584: rtcpu_vinotify_event: tstamp:4371170654 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:139867411584 data:0x0000000031000002
kworker/4:2-130 [004] .... 120.149557: rtcpu_vinotify_event: tstamp:4458857863 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:142683244576 data:0x719e300010000000
kworker/4:2-130 [004] .... 120.149560: rtcpu_vinotify_event: tstamp:4458858002 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:142683287264 data:0x0000000031000001
kworker/4:2-130 [004] .... 120.149561: rtcpu_vinotify_event: tstamp:4458858160 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:142683304864 data:0x719e2d0010000000
kworker/4:2-130 [004] .... 120.149561: rtcpu_vinotify_event: tstamp:4458858295 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:142683365248 data:0x0000000031000002
kworker/4:1-55 [004] .... 122.965551: rtcpu_vinotify_event: tstamp:4547008089 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:145503211552 data:0x719e300010000000
kworker/4:1-55 [004] .... 122.965554: rtcpu_vinotify_event: tstamp:4547008229 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:145503257120 data:0x0000000031000001
kworker/4:1-55 [004] .... 122.965554: rtcpu_vinotify_event: tstamp:4547008387 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:145503274688 data:0x719e2d0010000000
kworker/4:1-55 [004] .... 122.965554: rtcpu_vinotify_event: tstamp:4547008522 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:145503335072 data:0x0000000031000002
kworker/4:1-55 [004] .... 131.789568: rtcpu_string: tstamp:4823041790 id:0x04010000 str:"VM0 deactivating."
There is data on the CSI2_CLK, CSI2_D0, and CSI2_D1 lanes. There is only continuity between the deserializer pins and the Orin’s pins.
I have a feeling this is a device tree misconfiguration. For example, why does the vi trace show vi:1?
Can you verify my device tree? (decompiled the current running dtb, attached).
kernel_tegra234-p3767-0000-p3768-0000-a0.txt (414.3 KB)
Thank you!