CHANSEL_FAULT and CHANSEL_NOMATCH of imx728 sensor porting on Xavier NX

Hi,

I try to port camera driver for sensor imx728 + max96717 but it can’t work via v4l2-ctl command to capture image.

v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat=BG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100

Here is my dtsi config:

mode0 {/*mode IMX728_MODE_3840x2160_CROP_30FPS*/
					mclk_khz = "24000";
					num_lanes = "4";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					vc_id = "0";
					discontinuous_clk = "no";
					dpcm_enable = "false";
					cil_settletime = "0";
					dynamic_pixel_bit_depth = "10";
					csi_pixel_bit_depth = "10";
					mode_type = "bayer";
					pixel_phase = "rggb";

					active_w = "3840";
					active_h = "2160";
					readout_orientation = "0";
					line_length = "3840";
					inherent_gain = "1";
					pix_clk_hz = "248832000";
					serdes_pix_clk_hz = "833333333";

					gain_factor = "10";
					min_gain_val = "0"; /* dB */
					max_gain_val = "300"; /* dB */
					step_gain_val = "3"; /* 0.3 */
					default_gain = "0";
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					framerate_factor = "1000000";
					min_framerate = "30000000";
					max_framerate = "30000000";
					step_framerate = "1";
					default_framerate = "30000000";
					exposure_factor = "1000000";
					min_exp_time = "59"; /*us, 2 lines*/
					max_exp_time = "33333";
					step_exp_time = "1";
					default_exp_time = "33333";/* us */
					embedded_metadata_height = "0";
				};

Here is the dmesg log:

[  199.057871] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 256
[  199.091155] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 256
[  199.124491] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 256
[  199.157828] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 256

Here is trace log.

     kworker/2:2-2118  [002] ....   199.068038: rtcpu_vinotify_event: tstamp:6670666872 tag:FS channel:0x00 frame:0 vi_tstamp:6670357445 data:0x00000010
     kworker/2:2-2118  [002] ....   199.068043: rtcpu_vinotify_event: tstamp:6670667025 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:6670357448 data:0x00000000
     kworker/2:2-2118  [002] ....   199.068044: rtcpu_vinotify_event: tstamp:6670667157 tag:CHANSEL_PXL_SOF channel:0x23 frame:0 vi_tstamp:6670357885 data:0x00000001
     kworker/2:2-2118  [002] ....   199.068045: rtcpu_vinotify_event: tstamp:6670667309 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7293025920 data:0x08020001
     kworker/2:2-2118  [002] ....   199.068046: rtcpu_vinotify_event: tstamp:6670667436 tag:CHANSEL_FAULT channel:0x23 frame:0 vi_tstamp:6670358216 data:0x00000100
     kworker/2:2-2118  [002] ....   199.068047: rtcpu_vinotify_event: tstamp:6670667584 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7293049664 data:0x01020001
     kworker/2:2-2118  [002] ....   199.124034: rtcpu_vinotify_event: tstamp:6671301229 tag:FE channel:0x00 frame:0 vi_tstamp:6671298073 data:0x00000020
     kworker/2:2-2118  [002] ....   199.124038: rtcpu_vinotify_event: tstamp:6671301385 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:0 vi_tstamp:6671298073 data:0x01000000
     kworker/2:2-2118  [002] ....   199.124040: rtcpu_vinotify_event: tstamp:6671301518 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7323124064 data:0x01020001
     kworker/2:2-2118  [002] ....   199.124041: rtcpu_vinotify_event: tstamp:6671301671 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:6671298075 data:0x00000000
     kworker/2:2-2118  [002] ....   199.124042: rtcpu_vinotify_event: tstamp:6671301801 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7323137696 data:0x07020002
     kworker/2:2-2118  [002] ....   199.124048: rtos_queue_peek_from_isr_failed: tstamp:6671446436 queue:0x0bcbb8b8
     kworker/2:2-2118  [002] ....   199.124049: rtcpu_vinotify_event: tstamp:6671741191 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:7323261376 data:0x10000000
     kworker/2:2-2118  [002] ....   199.124051: rtcpu_vinotify_event: tstamp:6671741325 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:7323287584 data:0x31000003
     kworker/2:2-2118  [002] ....   199.124052: rtcpu_vinotify_event: tstamp:6671741478 tag:FS channel:0x00 frame:0 vi_tstamp:6671393131 data:0x00000010
     kworker/2:2-2118  [002] ....   199.124053: rtcpu_vinotify_event: tstamp:6671741610 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:6671393134 data:0x00000000
     kworker/2:2-2118  [002] ....   199.124054: rtcpu_vinotify_event: tstamp:6671741759 tag:CHANSEL_PXL_SOF channel:0x23 frame:0 vi_tstamp:6671399181 data:0x00000001
     kworker/2:2-2118  [002] ....   199.124055: rtcpu_vinotify_event: tstamp:6671741886 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7326347424 data:0x08020002
     kworker/2:2-2118  [002] ....   199.124056: rtcpu_vinotify_event: tstamp:6671742037 tag:CHANSEL_FAULT channel:0x23 frame:0 vi_tstamp:6671399513 data:0x00000100
     kworker/2:2-2118  [002] ....   199.124057: rtcpu_vinotify_event: tstamp:6671742165 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7326371104 data:0x01020002
     kworker/2:2-2118  [002] ....   199.124058: rtcpu_vinotify_event: tstamp:6672344124 tag:CHANSEL_FAULT channel:0x23 frame:0 vi_tstamp:6672336638 data:0x086f0182
     kworker/2:2-2118  [002] ....   199.124059: rtcpu_vinotify_event: tstamp:6672344258 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7356349408 data:0x01020002
     kworker/2:2-2118  [002] ....   199.124060: rtcpu_vinotify_event: tstamp:6672344410 tag:ATOMP_FRAME_DONE channel:0x23 frame:0 vi_tstamp:6672336662 data:0x00000000
     kworker/2:2-2118  [002] ....   199.124062: rtcpu_vinotify_event: tstamp:6672344538 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7356353760 data:0x02020002
     kworker/2:2-2118  [002] ....   199.124064: rtcpu_vinotify_event: tstamp:6672344685 tag:FE channel:0x00 frame:0 vi_tstamp:6672339804 data:0x00000020
     kworker/2:2-2118  [002] ....   199.124065: rtcpu_vinotify_event: tstamp:6672344817 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:6672339807 data:0x00000000
     kworker/2:2-2118  [002] ....   199.124066: rtcpu_vinotify_event: tstamp:6672344965 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7356457664 data:0x07020003
     kworker/2:2-2118  [002] ....   199.124067: rtcpu_vinotify_event: tstamp:6672345093 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:7356513568 data:0x10000000
     kworker/2:2-2118  [002] ....   199.180115: rtcpu_vinotify_event: tstamp:6672815478 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:7356619456 data:0x31000004
     kworker/2:2-2118  [002] ....   199.180119: rtcpu_vinotify_event: tstamp:6672815613 tag:FS channel:0x00 frame:0 vi_tstamp:6672434862 data:0x00000010
     kworker/2:2-2118  [002] ....   199.180121: rtcpu_vinotify_event: tstamp:6672815763 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:6672434865 data:0x00000000
     kworker/2:2-2118  [002] ....   199.180122: rtcpu_vinotify_event: tstamp:6672815893 tag:CHANSEL_PXL_SOF channel:0x23 frame:0 vi_tstamp:6672440913 data:0x00000001
     kworker/2:2-2118  [002] ....   199.180123: rtcpu_vinotify_event: tstamp:6672816111 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7359682848 data:0x08020003
     kworker/2:2-2118  [002] ....   199.180125: rtcpu_vinotify_event: tstamp:6672816238 tag:CHANSEL_FAULT channel:0x23 frame:0 vi_tstamp:6672441244 data:0x00000100
     kworker/2:2-2118  [002] ....   199.180126: rtcpu_vinotify_event: tstamp:6672816387 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7359706560 data:0x01020003
     kworker/2:2-2118  [002] ....   199.180127: rtcpu_vinotify_event: tstamp:6673479088 tag:CHANSEL_FAULT channel:0x23 frame:0 vi_tstamp:6673378368 data:0x086f0182
     kworker/2:2-2118  [002] ....   199.180128: rtcpu_vinotify_event: tstamp:6673479241 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7389684800 data:0x01020003
     kworker/2:2-2118  [002] ....   199.180130: rtcpu_vinotify_event: tstamp:6673479372 tag:ATOMP_FRAME_DONE channel:0x23 frame:0 vi_tstamp:6673378393 data:0x00000000
     kworker/2:2-2118  [002] ....   199.180131: rtcpu_vinotify_event: tstamp:6673479519 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7389689152 data:0x02020003
     kworker/2:2-2118  [002] ....   199.180132: rtcpu_vinotify_event: tstamp:6673479648 tag:FE channel:0x00 frame:0 vi_tstamp:6673381535 data:0x00000020
     kworker/2:2-2118  [002] ....   199.180159: rtcpu_vinotify_event: tstamp:6673479797 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:6673381538 data:0x00000000
     kworker/2:2-2118  [002] ....   199.180160: rtcpu_vinotify_event: tstamp:6673479924 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7389793088 data:0x07020004
     kworker/2:2-2118  [002] ....   199.180161: rtcpu_vinotify_event: tstamp:6673480071 tag:FS channel:0x00 frame:0 vi_tstamp:6673476594 data:0x00000010
     kworker/2:2-2118  [002] ....   199.180163: rtcpu_vinotify_event: tstamp:6673480202 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:6673476596 data:0x00000000
     kworker/2:2-2118  [002] ....   199.180165: rtcpu_vinotify_event: tstamp:6673938313 tag:CHANSEL_PXL_SOF channel:0x23 frame:0 vi_tstamp:6673482644 data:0x00000001
     kworker/2:2-2118  [002] ....   199.180166: rtcpu_vinotify_event: tstamp:6673938445 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7393018240 data:0x08020004
     kworker/2:2-2118  [002] ....   199.180167: rtcpu_vinotify_event: tstamp:6673938597 tag:CHANSEL_FAULT channel:0x23 frame:0 vi_tstamp:6673482977 data:0x00000100
     kworker/2:2-2118  [002] ....   199.180169: rtcpu_vinotify_event: tstamp:6673938725 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7393041984 data:0x01020004
     kworker/2:2-2118  [002] ....   199.236058: rtcpu_vinotify_event: tstamp:6674426404 tag:CHANSEL_FAULT channel:0x23 frame:0 vi_tstamp:6674420099 data:0x086f0182
     kworker/2:2-2118  [002] ....   199.236062: rtcpu_vinotify_event: tstamp:6674426534 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7423020192 data:0x01020004
     kworker/2:2-2118  [002] ....   199.236063: rtcpu_vinotify_event: tstamp:6674426684 tag:ATOMP_FRAME_DONE channel:0x23 frame:0 vi_tstamp:6674420123 data:0x00000000
     kworker/2:2-2118  [002] ....   199.236065: rtcpu_vinotify_event: tstamp:6674426811 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:7423024544 data:0x02020004
     kworker/2:2-2118  [002] ....   199.236066: rtcpu_vinotify_event: tstamp:6674426960 tag:FE channel:0x00 frame:0 vi_tstamp:6674423266 data:0x00000020
     kworker/2:2-2118  [002] ....   199.236067: rtcpu_vinotify_event: tstamp:6674427091 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:6674423269 data:0x00000000
     kworker/2:2-2118  [002] ....   199.236068: rtcpu_vinotify_error: tstamp:6674526942 tag:CHANSEL_NOMATCH channel:0x01 frame:0 vi_tstamp:6674524375 data:0x00000569
     kworker/2:2-2118  [002] ....   199.236069: rtcpu_vinotify_event: tstamp:6674914542 tag:FS channel:0x00 frame:0 vi_tstamp:6674518325 data:0x00000010
     kworker/2:2-2118  [002] ....   199.236070: rtcpu_vinotify_event: tstamp:6674914679 tag:CHANSEL_NOMATCH channel:0x01 frame:0 vi_tstamp:6674524375 data:0x00000569
     kworker/2:2-2118  [002] ....   199.236072: rtcpu_vinotify_error: tstamp:6675568663 tag:CHANSEL_NOMATCH channel:0x01 frame:0 vi_tstamp:6675566106 data:0x00000569
     kworker/2:2-2118  [002] ....   199.236073: rtcpu_vinotify_event: tstamp:6675891365 tag:FE channel:0x00 frame:0 vi_tstamp:6675464998 data:0x00000020

Following Jetson/l4t/Camera BringUp - eLinux.org to analyze the trace log and found two error.

  1. CHANSEL_FAULT is PIXEL_LONG_LINE, it means VI received line number which is not as VI expected. I try to boost the NVCSI/VI/ISP clocks but it not work.

  2. CHANSEL_NOMATCH is 0x00000569, it means the LS package not match NvCsiDataType_RAW10.

Here is the log file.
dmesg.log (217.4 KB)
trace.log (85.4 KB)

Can you give any advice to debug it?

Thanks for help.

Boost the clocks to try.

sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate

Hi,

I follow your advice to boost clocks, but it still not work and error is the same.

The CHANSEL_FAULT tell the PIXEL_LONG_LINE and PIXEL_SPURIOUS,
could be the output size more than 2160 and PIXEL_SPURIOUS could be output undefine user define data.

Hi,

Do you mean the sensor or serializer output more than 2160 lines? But the sensor spec. said active_w = 3840 and active_h =2160.

And I set desrializer max9296 data type is raw10 and sensor output data format raw10, I don’t know why receive undefine data.

Could you give me for detail for debug?

Thanks

Yes, the PIXEL_LONG_LINE tell the output size incorrect. You can reduce the active_h to try.

The PIXEL_SPURIOUS tell the sensor output other data type package like embedded data or user define data…

Hi ShaneCCC,

I try to reduce active_h to 2159 or 2155 or 2150 but it not work.
I don’t know how much the active_h should be reduced? Only try and error?

Thanks

You can reduce more to check if the PIXEL_LONG_LINE still in the trace to narrow down it.

https://elinux.org/Jetson/l4t/Camera_BringUp#Steps_to_enable_more_debug_messages