JetPack 5.1.3: NULL VI channel received, IMX586 driver

I am working on developing a driver for the SONY IMX586 sensor (4-lane DPHY). The driver is based on the IMX185 and is being developed using the manual “Sensor Software Driver Programming.” I am using the DSBOARD-ORNXS carrier board with Jetson Orin 8GB.

Since the IMX586 supports a maximum resolution of 8000x6000, I prefer not to use the ISP (due to the limitation of maximum resolution). Currently, I am testing with a 4000x3000 mode.

However, I am unable to capture data. The dmesg log shows “request timed out after 2500 ms” and “NULL VI channel received” errors, and the system occasionally crashes. Running v4l2 with --verbose parameter results the “(error, ts-monotonic, ts-src-eof).”

Correct: I have tested both CAM0 and CAM1 interfaces. I suppose that setting tegra_sinterface was set correctly (serial_a for CAM0 and serial_c for CAM1) and also adjusted the lane_polarity (CAM0 “6” and CAM1 “0”). The camera is responding correctly to I2C communication, and the registers are being set properly. For my carrier board the CAM0 is CSI0/1 and CAM1 is CSI1/2.

How should the port binding look when bypassing ISP processing? Currently me binding is like in the IMX185 example.

Has anyone experienced similar issues or know how to resolve this?

root@nvidia:/home/nvidia# v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'RG10' (10-bit Bayer RGRG/GBGB)
                Size: Discrete 4000x3000
                        Interval: Discrete 0.042s (24.000 fps)
root@nvidia:/home/nvidia# sudo media-ctl -p -d /dev/media0
Media controller API version 5.10.192

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

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
                <- "imx586 9-001a":0 [ENABLED]
        pad1: Source
                -> "vi-output, imx586 9-001a":0 [ENABLED]

- entity 4: 13e40000.host1x:nvcsi@15a00000- (2 pads, 0 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
        pad0: Sink
        pad1: Source

- entity 7: imx586 9-001a (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev2
        pad0: Source
                [fmt:SRGGB10_1X10/4000x3000 field:none colorspace:srgb]
                -> "13e40000.host1x:nvcsi@15a00000-":0 [ENABLED]

- entity 9: vi-output, imx586 9-001a (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "13e40000.host1x:nvcsi@15a00000-":1 [ENABLED]
root@nvidia:/home/nvidia# cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 23/23   #P:6
#
#                                _-----=> irqs-off
#                               / _----=> need-resched
#                              | / _---=> hardirq/softirq
#                              || / _--=> preempt-depth
#                              ||| /     delay
#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
             cat-4202    [000] ....  3632.782467: tegra_channel_open: vi-output, imx586 9-001a
             cat-4202    [000] ....  3632.786743: tegra_channel_set_power: imx586 9-001a : 0x1
             cat-4202    [000] ....  3632.786755: camera_common_s_power: status : 0x1
             cat-4202    [000] ....  3632.787086: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x1
             cat-4202    [000] ....  3632.787088: csi_s_power: enable : 0x1
             cat-4202    [000] ....  3632.787632: tegra_channel_capture_setup: vnc_id 0 W 4000 H 3000 fmt c4
             cat-4202    [001] ....  3632.793712: tegra_channel_set_stream: enable : 0x1
     kworker/5:3-106     [005] ....  3632.793919: rtcpu_string: tstamp:114177518443 id:0x04010000 str:"VM0 activating."
             cat-4202    [001] ....  3632.794948: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
             cat-4202    [001] ....  3632.794950: csi_s_stream: enable : 0x1
             cat-4202    [001] ....  3632.795261: tegra_channel_set_stream: imx586 9-001a : 0x1
     kworker/5:3-106     [005] ....  3632.850080: rtcpu_vinotify_event: tstamp:114177970995 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:3653684569888 data:0x759d580010000000
     kworker/5:3-106     [005] ....  3632.850081: rtcpu_vinotify_event: tstamp:114177971131 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:3653684576320 data:0x0000000031000001
 vi-output, imx5-4204    [003] ....  3635.413885: tegra_channel_capture_setup: vnc_id 0 W 4000 H 3000 fmt c4
             cat-4202    [005] ....  3638.401768: tegra_channel_close: vi-output, imx586 9-001a
             cat-4202    [005] ....  3638.402169: tegra_channel_set_stream: enable : 0x0
             cat-4202    [005] ....  3638.402172: tegra_channel_set_stream: imx586 9-001a : 0x0
             cat-4202    [005] ....  3639.715599: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x0
             cat-4202    [005] ....  3639.715604: csi_s_stream: enable : 0x0
             cat-4202    [005] ....  3639.717119: tegra_channel_set_power: imx586 9-001a : 0x0
             cat-4202    [005] ....  3639.717130: camera_common_s_power: status : 0x0
             cat-4202    [005] ....  3639.720824: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x0
             cat-4202    [005] ....  3639.720826: csi_s_power: enable : 0x0
root@nvidia:/home/nvidia# v4l2-ctl --set-fmt-video=width=4000,height=3000,pixelformat=RG10 --stream-mmap --stream-count=1 -d /dev/video0 --stream-to=imx586.raw --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
        Width/Height      : 4000/3000
        Pixel Format      : 'RG10' (10-bit Bayer RGRG/GBGB)
        Field             : None
        Bytes per Line    : 8000
        Size Image        : 24000000
        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 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: 24000000 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq:      0 bytesused: 24000000 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq:      1 bytesused: 24000000 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq:      2 bytesused: 24000000 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq:      3 bytesused: 24000000 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq:      0 bytesused: 24000000 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq:      0 bytesused: 24000000 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq:      1 bytesused: 24000000 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq:      2 bytesused: 24000000 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq:      3 bytesused: 24000000 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
[ 3635.357913] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 3635.367056] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 3635.377140] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 3635.384880] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 3635.395551] (NULL device *): vi_capture_control_message: NULL VI channel receiveda
[ 3635.403261] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 3635.413967] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel

Make sure the sensor send the deskew work.

Skew calibration is required if sensor or deserializer is using DPHY, and the output data rate is > 1.5Gbps.
An initiation deskew signal should be sent by sensor or deserializer to perform the skew calibration. If the deskew signals is not sent, the receiver will stall, and the capture will time out.
You can calculate the output data rate with the following equation:

Output data rate = (sensor or deserializer pixel clock in hertz) * (bits per pixel) / (number of CSI lanes)

Thank you, @ShaneCCC. I read about this, and I believe the sensor should send the skew-calibration pattern by default according to the sensor documentation and the register state before “start streaming.” By default, the skew time is set to 4095 MDBCK (Bit rate [Mbps/lane] / 8) units, but I can also set it in microseconds. Additionally, “periodic calibration” is set during the frame blanking period. Is this feature currently supported by the Jetson Orin? I read that it might not be.

Don’t support periodic calibration.

Thanks

After making driver modifications and device tree changes similar to those by @Towe_Roll in attached DTSI file, I was able to receive more data, but it remains incorrect.

I am now getting two different errors:
class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
and:
class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001

The trace after a few seconds of: v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=1 -d /dev/video1 --stream-to=imx586.raw --verbose

# tracer: nop
#
# entries-in-buffer/entries-written: 17924/17924   #P:6
#
#                                _-----=> irqs-off
#                               / _----=> need-resched
#                              | / _---=> hardirq/softirq
#                              || / _--=> preempt-depth
#                              ||| /     delay
#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
        v4l2-ctl-4700    [000] ....  2678.836375: tegra_channel_open: vi-output, imx586 10-001a
        v4l2-ctl-4700    [000] ....  2678.842069: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt c4
        v4l2-ctl-4700    [000] ....  2678.842462: tegra_channel_set_stream: enable : 0x1
        v4l2-ctl-4700    [000] ....  2678.857190: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
        v4l2-ctl-4700    [000] ....  2678.857192: csi_s_stream: enable : 0x1
        v4l2-ctl-4700    [000] ....  2678.857499: tegra_channel_set_stream: imx586 10-001a : 0x1
     kworker/2:0-4364    [002] ....  2678.864776: rtcpu_vinotify_event: tstamp:84401236426 cch:4 vi:1 tag:VIFALC_TDSTATE channel:0x20 frame:0 vi_tstamp:2700827333792 data:0x759e1e0010000000
     kworker/2:0-4364    [002] ....  2678.864777: rtcpu_vinotify_event: tstamp:84401236627 cch:4 vi:1 tag:VIFALC_TDSTATE channel:0x20 frame:0 vi_tstamp:2700827340224 data:0x0000000031000001
     kworker/2:0-4364    [002] ....  2678.864777: rtcpu_vinotify_event: tstamp:84401236823 cch:4 vi:1 tag:VIFALC_TDSTATE channel:0x20 frame:0 vi_tstamp:2700827390976 data:0x759e1b0010000000
     kworker/2:0-4364    [002] ....  2678.864777: rtcpu_vinotify_event: tstamp:84401236989 cch:4 vi:1 tag:VIFALC_TDSTATE channel:0x20 frame:0 vi_tstamp:2700827397536 data:0x0000000031000002
     kworker/2:0-4364    [002] ....  2678.920797: rtcpu_nvcsi_intr: tstamp:84401635761 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
     kworker/2:0-4364    [002] ....  2678.920799: rtcpu_nvcsi_intr: tstamp:84401635761 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
     kworker/2:0-4364    [002] ....  2678.920799: rtcpu_nvcsi_intr: tstamp:84401642383 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
     kworker/2:0-4364    [002] ....  2678.920800: rtcpu_nvcsi_intr: tstamp:84401642383 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
     kworker/2:0-4364    [002] ....  2678.920800: rtcpu_nvcsi_intr: tstamp:84401642990 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001

...

     kworker/2:0-4364    [002] ....  2679.260256: rtcpu_nvcsi_intr: tstamp:84413552112 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
     kworker/2:0-4364    [002] ....  2679.260256: rtcpu_nvcsi_intr: tstamp:84413552112 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:0 status:0x00000008
     kworker/2:0-4364    [002] ....  2679.260256: rtcpu_nvcsi_intr: tstamp:84413552112 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
     kworker/2:0-4364    [002] ....  2679.260256: rtcpu_nvcsi_intr: tstamp:84413552112 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:0 status:0x00000008
     kworker/2:0-4364    [002] ....  2679.260257: rtcpu_vinotify_error: tstamp:84413555692 cch:4 vi:1 tag:CSIMUX_FRAME channel:0x00 frame:792 vi_tstamp:2701219228544 data:0x0000051b000000a2
     kworker/2:0-4364    [002] ....  2679.260258: rtcpu_vinotify_event: tstamp:84413559591 cch:4 vi:1 tag:CSIMUX_FRAME channel:0x00 frame:792 vi_tstamp:2701219228544 data:0x0000051b000000a2
     kworker/2:0-4364    [002] ....  2679.260258: rtcpu_vinotify_event: tstamp:84413559728 cch:4 vi:1 tag:FS channel:0x00 frame:1307 vi_tstamp:2701219228544 data:0x0000051b00000012
     kworker/2:0-4364    [002] ....  2679.260259: rtcpu_vinotify_event: tstamp:84413559883 cch:4 vi:1 tag:CHANSEL_SHORT_FRAME channel:0x04 frame:792 vi_tstamp:2701219228576 data:0x0000040001000000
     kworker/2:0-4364    [002] ....  2679.260259: rtcpu_vinotify_event: tstamp:84413560019 cch:4 vi:1 tag:VIFALC_ACTIONLST channel:0x20 frame:792 vi_tstamp:2701219313120 data:0x0000000001020005
     kworker/2:0-4364    [002] ....  2679.260259: rtcpu_vinotify_event: tstamp:84413560175 cch:4 vi:1 tag:ATOMP_FE channel:0x00 frame:792 vi_tstamp:2701219228640 data:0x0000000100000000
     kworker/2:0-4364    [002] ....  2679.260259: rtcpu_vinotify_event: tstamp:84413560311 cch:4 vi:1 tag:ATOMP_FS channel:0x00 frame:1307 vi_tstamp:2701219228640 data:0x0000000100000000
     kworker/2:0-4364    [002] ....  2679.260259: rtcpu_vinotify_event: tstamp:84413768585 cch:4 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:1307 vi_tstamp:2701233660384 data:0x00000000000006c9
     kworker/2:0-4364    [002] ....  2679.260259: rtcpu_vinotify_event: tstamp:84413768721 cch:4 vi:1 tag:VIFALC_TDSTATE channel:0x20 frame:0 vi_tstamp:2701233975648 data:0x759e1e0010000000
     kworker/2:0-4364    [002] ....  2679.260260: rtcpu_vinotify_event: tstamp:84413768877 cch:4 vi:1 tag:VIFALC_TDSTATE channel:0x20 frame:0 vi_tstamp:2701234018976 data:0x0000000031000007
     kworker/2:0-4364    [002] ....  2679.316773: rtcpu_vinotify_event: tstamp:84415652051 cch:-1 vi:1 tag:FE channel:0x00 frame:1307 vi_tstamp:2701300234240 data:0x0000000000000022
     kworker/2:0-4364    [002] ....  2679.316775: rtcpu_vinotify_event: tstamp:84415652253 cch:-1 vi:1 tag:CHANSEL_SHORT_FRAME channel:0x04 frame:1307 vi_tstamp:2701300234240 data:0x0000040001000000
     kworker/2:0-4364    [002] ....  2679.316775: rtcpu_vinotify_event: tstamp:84415652430 cch:-1 vi:1 tag:ATOMP_FE channel:0x00 frame:1307 vi_tstamp:2701300234240 data:0x0000000100000000
     kworker/2:0-4364    [002] ....  2685.420659: rtcpu_string: tstamp:84606172390 id:0x04010000 str:"VM0 deactivating."

In my device tree, the configuration for CSI2/3 clocks was previously as follows:
clocks = <&bpmp_clks TEGRA234_CLK_EXTPERIPH2>, <&bpmp_clks TEGRA234_CLK_PLLP_OUT0>;
I will now change it to:
clocks = <&bpmp_clks TEGRA234_CLK_EXTPERIPH2>, <&bpmp_clks TEGRA234_CLK_EXTPERIPH2>;

How should the clock be configured to get a stable 24MHz source for the camera on CSI2/3?

I solved the issue, it was the hardware problem. Data lines on camera was swapped (D2 ↔ D3). Is it possible to fix it on the software level?

Current software can’t do it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.