How to config CSIG to Stream5 for 2lane csi input

dear,all

Currently I use 2lane's CSI YUV image output camera module   for  6 mux

CSI A  -> port0  -> stream0     ok 
CSI C  -> port2  -> stream2     ok
CSI E  -> port4  -> stream4     ok
CSI G  -> port6  -> stream5     fail


The configuration of DTS is almost the same except for  " port-index ", 

port-index  is   0, 2, 4, 6,  

tegra_sinterface  is  serial_a, serial_c, serial_e , serial_g


[b]What's wrong with the settings?[/b]

hello JiaZW,

according to Sensor Software Driver Programming Guide → [Port Index] session, it seems you had correct configuration.
we had fix CSI-G issue with early release, may I know which JetPack release you’re working with?
thanks

JerryChang,

  JetPack  4.2 

 Is this version fixed??

hello JiaZW,

yes, JetPack-4.2 already include the fix.
could you please share the commands you’re using, also share the kernel failure messages.
thanks

@JerryChang

 Does the “port-index” of the corresponding VI of CSIG need to be set to 5?

cmd:

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1079,pixelformat=UYVY --stream-mmap --stream-count=1 --set-ctrl bypass_mode=0 --stream-to=/tmp/stream.yuv

[   41.140364] tegra194-vi5 15c10000.vi: no reply from camera processor
[   41.140507] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[   41.140644] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[   41.142825] tegra194-vi5 15c10000.vi: unexpected response from camera processor
[   41.142993] tegra194-vi5 15c10000.vi: vi capture setup failed
[   41.143129] tegra194-vi5 15c10000.vi: fatal: error recovery failed

v4l2-ctl --all

top:~$ v4l2-ctl --all
Driver Info (not using libv4l2):
        Driver name   : tegra-video
        Card type     : vi-output, ar0231 1-0048
        Bus info      : platform:15c10000.vi:6
        Driver version: 4.9.140
        Capabilities  : 0x84200001
                Video Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps   : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format
Priority: 2
Video input : 0 (Camera 6: ok)
Format Video Capture:
        Width/Height      : 1920/1079
        Pixel Format      : 'UYVY'
        Field             : None
        Bytes per Line    : 3840
        Size Image        : 4143360
        Colorspace        : sRGB
        Transfer Function : Default (maps to sRGB)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Limited Range)
        Flags             :

hello JiaZW,

  1. suggest you refer to Topic 1046625 for the explanation for port binding.
    also, if you had a sensor connect to CSI-G,
    you should have the port binding indicate as below.
    Sensor_out (port-index= 6) → CSI_in (port-index= 6) → CSI_out (port-index= 6) → VI_in (port-index= 5)

  2. FYI, please modify your image height since video input hardware engine did not support resolution in the odd values.

Width/Height      : 1920/1079

dear JerryChang,

question1:

         I am using Jetpack4.2, 
        
         Do i need  use  the patchs of  “devtalk1046625_patches” from   Topic 1046625  ???

question2:

        “1920/1079”, this resolution is all ok  for  CSI-A, CSI-C, CSI-E,   why??

hello JiaZW,

Question.1
no you don’t, you may also found those changes already included in Jetpack4.2.

Question.2
the defect should be not obvious since there’s only 1-line, you may still launching for testing.
however, still suggest you follow the h/w capability to configure resolution as even values.

please also check Sensor Software Driver Programming Guide, check the [To verify the port binding result] session for the steps for verification.
thanks

dear JerryChang,

  1. dts setting:
    Sensor_out (port-index= 6) → CSI_in (port-index= 6) → CSI_out (port-index= 6) → VI_in (port-index= 5)

  2. 913A->954->2lane CSI-> CSI G

  3. I2C communication is all normal

  4. but CSIG capture image still fail, CSI A/C/E all ok

feel like there’s too much to do

- entity 3: 15a00000.nvcsi--1 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
        pad0: Sink
                <- "ar0231 1-0048":0 [ENABLED]
        pad1: Source
                -> "vi-output, ar0231 1-0048":0 [ENABLED]

- entity 6: vi-output, ar0231 1-0048 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "15a00000.nvcsi--1":1 [ENABLED]

hello JiaZW,

  1. could you please replace debug rtcpu firmware and gather more details.
    please back-up your firmware and download Debug_rtcpu.tar.gz to update the firmware as below commands.
$ cp debug_camera-rtcpu-rce.img $OUT/bootloader/camera-rtcpu-rce.img
$ sudo ./flash.sh -r -k rce-fw jetson-xavier mmcblk0p1
  1. please enable VI tracing logs as below, and running your use-case to catch messages.
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

Debug_rtcpu.tar.gz (149 KB)

dear JerryChang,

 messages as follow:
root@desktop:/home/# echo 1 > /sys/kernel/debug/tracing/tracing_on
ho 30720 > /sys/kernel/debug/tracing/buffer_size_kb
_kbt@-desktop:/home/ echo 30720 > /sys/kernel/debug/tracing/buffer_size_
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
cpu/enabledesktop:/home/# echo 1 > /sys/kernel/debug/tracing/events/tegra_rtc
/enabledi-desktop:/home/# echo 1 > /sys/kernel/debug/tracing/events/freertos/
root@-desktop:/home/# echo 2 > /sys/kernel/debug/camrtc/log-level
echo > /sys/kernel/debug/tracing/trace
root@-desktop:/home/# echo > /sys/kernel/debug/tracing/trace

root@-desktop:/home/# 
ode=0 --stream-to=/tmp/stream.yuv &eam-mmap --stream-count=1 --set-ctrl bypass_mo
[1] 7107

root@-desktop:/home/# 
root@-desktop:/home/# 
root@-desktop:/home/# cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 91/91   #P:8
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |

kworker/0:1-810   [000] ....    56.741967: rtos_queue_peek_from_isr_failed: tstamp:1972344992 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    56.910090: rtos_queue_peek_from_isr_failed: tstamp:1977344992 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    57.078006: rtos_queue_peek_from_isr_failed: tstamp:1982344892 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    57.190105: rtos_queue_peek_from_isr_failed: tstamp:1987344984 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    57.301982: rtos_queue_peek_from_isr_failed: tstamp:1989716880 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    57.973941: rtos_queue_send_from_isr_failed: tstamp:2010936687 queue:0x0bcb50f8
     kworker/0:1-810   [000] ....    57.973946: rtos_queue_send_from_isr_failed: tstamp:2010939200 queue:0x0bcb9960
     kworker/0:1-810   [000] ....    57.973947: rtos_queue_send_from_isr_failed: tstamp:2010941667 queue:0x0bcbb4e0
     kworker/0:1-810   [000] ....    57.973948: rtos_queue_send_from_isr_failed: tstamp:2010944109 queue:0x0bcbc2a0
     kworker/0:1-810   [000] ....    57.973949: rtos_queue_send_from_isr_failed: tstamp:2010946537 queue:0x0bcbd060
     kworker/0:1-810   [000] ....    57.973973: rtcpu_string: tstamp:2010956127 id:0x04010000 str:"===== NVCSI Stream Configuration =====
"
     kworker/0:1-810   [000] ....    57.973991: rtcpu_string: tstamp:2010961283 id:0x04010000 str:"stream_id: PP 5, csi_port: PORT G
"
     kworker/0:1-810   [000] ....    57.973997: rtcpu_string: tstamp:2010967546 id:0x04010000 str:"Brick: PHY 3, Mode: D-PHY
"
     kworker/0:1-810   [000] ....    57.974001: rtcpu_string: tstamp:2010973119 id:0x04010000 str:"Partition: CIL A, LP bypass: Enabled, Lanes: 2
"
     kworker/0:1-810   [000] ....    57.974005: rtcpu_string: tstamp:2010976570 id:0x04010000 str:"Clock information:[   61.357937] tegra194-vi5 15c10000.vi: no reply from camera processor

[   61.373084] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
"[   61.381254] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel

     kworker/0:1-810   [000] ....    57.974008: rtcpu_string: tstamp:2010986589 id:0x04010000 str:"NVCSI (CIL) clock: 204000 kHz
"
     kworker/0:1-810   [000] ....    57.974012: rtcpu_string: tstamp:2010994636 id:0x04010000 str:"Pixel (MIPI) rate: 200.00 MHz
[   61.412522] tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel
"
     kworker/0:1-810   [000] ....    57.974016: rtcpu_string: tstamp:2011003946 id:0x04010000 str:"T_HS settle: 22, T_CLK settle: 33
"
     kworker/0:1-810   [000] ....    57.974019: rtcpu_string: tstamp:2011007878 id:0x04010000 str:"======================================
"
     kworker/0:1-810   [000] ....    58.645970: rtcpu_nvcsi_intr: tstamp:2032618043 class:GLOBAL type:PHY_INTR0 phy:3 cil:0 st:0 vc:0 status:0x00000100
     kworker/0:1-810   [000] ....    58.645976: rtcpu_nvcsi_intr: tstamp:2032618043 class:CORRECTABLE_ERR type:PHY_INTR phy:3 cil:0 st:0 vc:0 status:0x00000100
     kworker/0:1-810   [000] ....    58.645979: rtos_queue_peek_from_isr_failed: tstamp:2032620294 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    58.645982: rtcpu_start: tstamp:2032622764
     kworker/0:1-810   [000] ....    58.645984: rtos_queue_send_from_isr_failed: tstamp:2032637776 queue:0x0bcb50f8
     kworker/0:1-810   [000] ....    58.645985: rtos_queue_send_from_isr_failed: tstamp:2032637915 queue:0x0bcb9960
     kworker/0:1-810   [000] ....    58.645986: rtos_queue_send_from_isr_failed: tstamp:2032638055 queue:0x0bcbb4e0
     kworker/0:1-810   [000] ....    58.645988: rtos_queue_send_from_isr_failed: tstamp:2032638191 queue:0x0bcbc2a0
     kworker/0:1-810   [000] ....    58.645989: rtos_queue_send_from_isr_failed: tstamp:2032638323 queue:0x0bcbd060
     kworker/0:1-810   [000] ....    58.646019: rtcpu_string: tstamp:2032638713 id:0x04010000 str:"Configuring VI GoS.
"
     kworker/0:1-810   [000] ....    58.646045: rtcpu_string: tstamp:2032638876 id:0x04010000 str:"VM GOS[#0] addr=0xe4900000
"
     kworker/0:1-810   [000] ....    58.646053: rtcpu_string: tstamp:2032639118 id:0x04010000 str:"VM GOS[#1] addr=0xe4901000
"
     kworker/0:1-810   [000] ....    58.646060: rtcpu_string: tstamp:2032639370 id:0x04010000 str:"VM GOS[#2] addr=0xe4902000
"
     kworker/0:1-810   [000] ....    58.646070: rtcpu_string: tstamp:2032639590 id:0x04010000 str:"VM GOS[#3] addr=0xe4903000
"
     kworker/0:1-810   [000] ....    58.646076: rtcpu_string: tstamp:2032639809 id:0x04010000 str:"VM GOS[#4] addr=0xe4904000
"
     kworker/0:1-810   [000] ....    58.646084: rtcpu_string: tstamp:2032640028 id:0x04010000 str:"VM GOS[#5] addr=0xe4905000
"
     kworker/0:1-810   [000] ....    58.646091: rtcpu_string: tstamp:2032655866 id:0x04010000 str:"vi5_hwinit: firmware CL2018101701 protocol versi"
     kworker/0:1-810   [000] ....    58.646094: rtcpu_string: tstamp:2032655971 id:0x04010000 str:"on 2.2
"
     kworker/0:1-810   [000] ....    58.646124: rtos_queue_send_from_isr_failed: tstamp:2032679259 queue:0x0bcb50f8
     kworker/0:1-810   [000] ....    58.646126: rtos_queue_send_from_isr_failed: tstamp:2032679415 queue:0x0bcb9960
     kworker/0:1-810   [000] ....    58.646127: rtos_queue_send_from_isr_failed: tstamp:2032679556 queue:0x0bcbb4e0
     kworker/0:1-810   [000] ....    58.646128: rtos_queue_send_from_isr_failed: tstamp:2032679690 queue:0x0bcbc2a0
     kworker/0:1-810   [000] ....    58.646130: rtos_queue_send_from_isr_failed: tstamp:2032679822 queue:0x0bcbd060
     kworker/0:1-810   [000] ....    58.646131: rtcpu_string: tstamp:2032680623 id:0x04010000 str:"VI GOS[#0] set to VM GOS[4] base 0xe4904000
"
     kworker/0:1-810   [000] ....    58.701950: rtcpu_vinotify_event: tstamp:2033200359 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:621397632 data:0x10000000
     kworker/0:1-810   [000] ....    58.701954: rtcpu_vinotify_event: tstamp:2033200491 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:621426976 data:0x31000001
     kworker/0:1-810   [000] ....    58.701956: rtcpu_vinotify_event: tstamp:2033200636 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:621437024 data:0x10000000
     kworker/0:1-810   [000] ....    58.701957: rtcpu_vinotify_event: tstamp:2033200758 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:621445568 data:0x07020001
     kworker/0:1-810   [000] ....    58.701959: rtcpu_vinotify_event: tstamp:2033200900 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:621476032 data:0x31000002
     kworker/0:1-810   [000] ....    58.813946: rtos_queue_peek_from_isr_failed: tstamp:2037620648 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    58.981950: rtos_queue_peek_from_isr_failed: tstamp:2042620648 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    59.149944: rtos_queue_peek_from_isr_failed: tstamp:2047620646 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    59.317951: rtos_queue_peek_from_isr_failed: tstamp:2052620647 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    59.485947: rtos_queue_peek_from_isr_failed: tstamp:2057620643 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    59.597954: rtos_queue_peek_from_isr_failed: tstamp:2062620647 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    59.765957: rtos_queue_peek_from_isr_failed: tstamp:2067620662 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    59.933942: rtos_queue_peek_from_isr_failed: tstamp:2072620647 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    60.101941: rtos_queue_peek_from_isr_failed: tstamp:2077620644 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    60.269953: rtos_queue_peek_from_isr_failed: tstamp:2082620648 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    60.437940: rtos_queue_peek_from_isr_failed: tstamp:2087620648 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    60.605941: rtos_queue_peek_from_isr_failed: tstamp:2092620646 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    60.717949: rtos_queue_peek_from_isr_failed: tstamp:2097620664 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    60.885958: rtos_queue_peek_from_isr_failed: tstamp:2102620648 queue:0x0bcbde78
root@desktop:/hom [   63.917991] tegra194-vi5 15c10000.vi: no reply from camera processor
[   63.918179] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[   63.918393] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[   63.918539] tegra194-vi5 15c10000.vi: unexpected response from camera processor
[   63.918697] video4linux video0: vi capture release failed
[   63.918788] tegra194-vi5 15c10000.vi: fatal: error recovery failed
kworker/0:1-810   [000] ....    57.973973: rtcpu_string: tstamp:2010956127 id:0x04010000 str:"===== NVCSI Stream Configuration =====
"
     kworker/0:1-810   [000] ....    57.973991: rtcpu_string: tstamp:2010961283 id:0x04010000 str:"stream_id: PP 5, csi_port: PORT G
"
     kworker/0:1-810   [000] ....    57.973997: rtcpu_string: tstamp:2010967546 id:0x04010000 str:"Brick: PHY 3, Mode: D-PHY
"
     kworker/0:1-810   [000] ....    57.974001: rtcpu_string: tstamp:2010973119 id:0x04010000 str:"Partition: CIL A, LP bypass: Enabled, Lanes: 2
"
     kworker/0:1-810   [000] ....    57.974005: rtcpu_string: tstamp:2010976570 id:0x04010000 str:"Clock information:[   61.357937] tegra194-vi5 15c10000.vi: no reply from camera processor

[   61.373084] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
"[   61.381254] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel

     kworker/0:1-810   [000] ....    57.974008: rtcpu_string: tstamp:2010986589 id:0x04010000 str:"NVCSI (CIL) clock: 204000 kHz
"
     kworker/0:1-810   [000] ....    57.974012: rtcpu_string: tstamp:2010994636 id:0x04010000 str:"Pixel (MIPI) rate: 200.00 MHz
[   61.412522] tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel
"
     kworker/0:1-810   [000] ....    57.974016: rtcpu_string: tstamp:2011003946 id:0x04010000 str:"T_HS settle: 22, T_CLK settle: 33
"
     kworker/0:1-810   [000] ....    57.974019: rtcpu_string: tstamp:2011007878 id:0x04010000 str:"======================================
"
     kworker/0:1-810   [000] ....    58.645970: rtcpu_nvcsi_intr: tstamp:2032618043 class:GLOBAL type:PHY_INTR0 phy:3 cil:0 st:0 vc:0 status:0x00000100
     kworker/0:1-810   [000] ....    58.645976: rtcpu_nvcsi_intr: tstamp:2032618043 class:CORRECTABLE_ERR type:PHY_INTR phy:3 cil:0 st:0 vc:0 status:0x00000100
     kworker/0:1-810   [000] ....    58.645979: rtos_queue_peek_from_isr_failed: tstamp:2032620294 queue:0x0bcbde78
     kworker/0:1-810   [000] ....    58.645982: rtcpu_start: tstamp:2032622764
     kworker/0:1-810   [000] ....    58.645984: rtos_queue_send_from_isr_failed: tstamp:2032637776 queue:0x0bcb50f8
     kworker/0:1-810   [000] ....    58.645985: rtos_queue_send_from_isr_failed: tstamp:2032637915 queue:0x0bcb9960
     kworker/0:1-810   [000] ....    58.645986: rtos_queue_send_from_isr_failed: tstamp:2032638055 queue:0x0bcbb4e0

hello JiaZW,

it seems normal from NVCSI stream configuration.
could you please also verify sensor hardware?
please replace it with other module to confirm it works with other csi ports.
thanks

dear JerryChang,

thank you very much. It’s really a hardware problem

@JerryChang could you send me a version of the debug RTCPU firmware for JetPack 4.3 on AGX Xavier, or point me to the source? I can’t find it in public_sources or the BSP. Thanks! (And sorry for tacking on to such an old thread :) )

hello D3_cwhite,

sorry, I don’t have it on hand.
could you please initial another new discussion thread for asking the debug RTCPU firmware.
besides,
would you still stay-on JetPack-4.3 even though JetPack-4.4 has release for a while.

Thanks! Open at Request debug firmware for RTCPU for JetPack 4.3 on AGX Xavier .