Xavier NX csi video issue

Hello,
I am using NX with Jetpack4.4 to capture a pre-configured csi video,1920x1080@30fps UYVY, 4lane, connect to our carrier board CSI port0 and port1.
Modify the imx219.c delete i2c part and directly call tegracam_device_register, and change tegra194-camera-rbpcv2-imx219.dtsi as follow:

vi@15c10000  {
		num-channels = <1>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			vi_port0: port@0 {
				reg = <0>;
				rbpcv2_imx219_vi_in0: endpoint {
					port-index = <0>;
					bus-width = <4>;
					remote-endpoint = <&rbpcv2_imx219_csi_out0>;
				};
			};
		};
	};
nvcsi@15a00000 {
		num-channels = <1>;
		#address-cells = <1>;
		#size-cells = <0>;
		csi_chan0: channel@0 {
			reg = <0>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				csi_chan0_port0: port@0 {
					reg = <0>;
					rbpcv2_imx219_csi_in0: endpoint@0 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&rbpcv2_imx219_out0>;
					};
				};
				csi_chan0_port1: port@1 {
					reg = <1>;
					rbpcv2_imx219_csi_out0: endpoint@1 {
						remote-endpoint = <&rbpcv2_imx219_vi_in0>;
					};
				};
			};
		};
	};
cam_i2cmux {
	i2c_0:i2c@0 {
		imx219_cam0: rbpcv2_imx219_a@10 {
			compatible = "nvidia,imx219";
			reg = <0x10>;
			devnode = "video0";
			physical_w = "3.680";
			physical_h = "2.760";
			sensor_model = "imx219";
			use_sensor_mode_id = "true";

			mode0 { /* IMX219_MODE_1920x1080_30FPS */
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_a";
				phy_mode = "DPHY";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "1920";
				active_h = "1080";
				pixel_t = "yuv_uyvy16";
				readout_orientation = "90";
				line_length = "2200";
				inherent_gain = "1";
				mclk_multiplier = "9.33";
				pix_clk_hz = "74250000";

				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16"; /* 1.00x */
				max_gain_val = "170"; /* 10.66x */
				step_gain_val = "1";
				default_gain = "16"; /* 1.00x */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "2000000"; /* 2.0 fps */
				max_framerate = "30000000"; /* 30.0 fps */
				step_framerate = "1";
				default_framerate = "30000000"; /* 30.0 fps */
				min_exp_time = "13"; /* us */
				max_exp_time = "683709"; /* us */
				step_exp_time = "1";
				default_exp_time = "2495"; /* us */

				embedded_metadata_height = "0";
			};

			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					rbpcv2_imx219_out0: endpoint {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&rbpcv2_imx219_csi_in0>;
					};
				};
			};
		};
	};

Reflash kernel and dtb,I got error trace log.

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

trace.log (488.2 KB)

Thanks.

Looks like the signal may have problem, don’t know why the PHY_INTR error have different value.
Have a check the REG NVCSI_PHY_0_CILA_INTR_0_STATUS_CILA_0 from the TRM.

CORRECTABLE_ERR type:PHY_INTR phy:0 cil:1 st:0 vc:0 status:0x00000044

Hello ShaneCCC,
NVCSI_PHY_0_CILA_INTR_0_STATUS_CILA_0 error Flag is bit6->intr_cil_data_lane_sot_mb_err1_a and bit2->intr_cil_data_lane_sot_mb_err0_a, are you sure this error because of bad csi signal? The csi0-clk and csi0 csi1 data signal looks ok on oscilloscope.

this is the kernel info when capture video:
[ 153.988019] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2387, flags: 102, err_data 4194912
[ 154.087980] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2389, flags: 0, err_data 512
[ 154.387936] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 12583520
[ 154.584177] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2404, flags: 6, err_data 64
[ 154.587868] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 544
[ 154.654667] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 544
[ 154.654888] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2407, flags: 0, err_data 131072
[ 154.754648] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2409, flags: 96, err_data 4194912
[ 154.987927] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2412, flags: 96, err_data 4194912

hello ShaneCCC,

I do some modifications on both software and hardware,then kernel crash with v4l2-ctl

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

dmesg info
[ 6096.815047] ------------[ cut here ]------------
[ 6096.815198] WARNING: CPU: 0 PID: 9982 at drivers/media/v4l2-core/videobuf2-core.c:1667 __vb2_queue_cancel+0x11c/0x188
[ 6096.815382] Modules linked in: bnep fuse zram overlay spidev nvgpu bluedroid_pm ip_tables x_tables

[ 6096.815451] CPU: 0 PID: 9982 Comm: v4l2-ctl Not tainted 4.9.140-tegra #3
[ 6096.815455] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[ 6096.815461] task: ffffffc1b2ee1c00 task.stack: ffffffc167304000
[ 6096.815470] PC is at __vb2_queue_cancel+0x11c/0x188
[ 6096.815478] LR is at __vb2_queue_cancel+0x34/0x188
[ 6096.815483] pc : [] lr : [] pstate: 20400045
[ 6096.815487] sp : ffffffc167307ae0
[ 6096.815492] x29: ffffffc167307ae0 x28: 0000000000000008
[ 6096.815503] x27: ffffff8008f72000 x26: ffffffc167307de8
[ 6096.815514] x25: ffffffc1d9b3f4e8 x24: ffffffc1e096af98
[ 6096.815525] x23: 0000000000000001 x22: ffffffc1e0912018
[ 6096.815536] x21: ffffffc1e08df000 x20: ffffffc1e09125d0
[ 6096.815546] x19: ffffffc1e09125d0 x18: 0000000000000bb2
[ 6096.815558] x17: 0000007f9e011f60 x16: 000000000000826b
[ 6096.815568] x15: 0000000000000000 x14: 0000000000000001
[ 6096.815579] x13: 0000000000000efd x12: 071c71c71c71c71c
[ 6096.815590] x11: 000000000000000b x10: 0000000000000a10
[ 6096.815601] x9 : ffffffc1673071e0 x8 : ffffffc1b2ee2670
[ 6096.815612] x7 : fefefeff646c606d x6 : 0000002c6f67b1bb
[ 6096.815624] x5 : 0000000000000000 x4 : 0000000000000000
[ 6096.815634] x3 : ffffff80094df110 x2 : 0000000000000000
[ 6096.815647] x1 : ffffffc1f2c17490 x0 : 0000000000000004

[ 6096.815662] —[ end trace 1ec078e5fb7b67ac ]—
[ 6096.815748] Call trace:
[ 6096.815759] [] __vb2_queue_cancel+0x11c/0x188
[ 6096.815767] [] vb2_core_queue_release+0x2c/0x58
[ 6096.815774] [] _vb2_fop_release+0x84/0xa0
[ 6096.815783] [] tegra_channel_close+0x64/0x140
[ 6096.815792] [] v4l2_release+0x48/0xa0
[ 6096.815803] [] __fput+0x90/0x1d0
[ 6096.815810] [] ____fput+0x20/0x30
[ 6096.815821] [] task_work_run+0xbc/0xd8
[ 6096.815831] [] do_exit+0x2c4/0xa08
[ 6096.815838] [] do_group_exit+0x40/0xa8
[ 6096.815847] [] get_signal+0x26c/0x578
[ 6096.815856] [] do_signal+0x130/0x500
[ 6096.815864] [] do_notify_resume+0x90/0xb0
[ 6096.815873] [] work_pending+0x8/0x10
[ 6165.406770] ------------[ cut here ]------------
[ 6165.406927] WARNING: CPU: 0 PID: 10079 at drivers/media/v4l2-core/videobuf2-core.c:1667 __vb2_queue_cancel+0x11c/0x188
[ 6165.407109] Modules linked in: bnep fuse zram overlay spidev nvgpu bluedroid_pm ip_tables x_tables

[ 6165.407162] CPU: 0 PID: 10079 Comm: v4l2-ctl Tainted: G W 4.9.140-tegra #3
[ 6165.407168] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[ 6165.407175] task: ffffffc184b2f000 task.stack: ffffffc166050000
[ 6165.407184] PC is at __vb2_queue_cancel+0x11c/0x188
[ 6165.407192] LR is at __vb2_queue_cancel+0x34/0x188
[ 6165.407199] pc : [] lr : [] pstate: 20400045
[ 6165.407203] sp : ffffffc166053ae0
[ 6165.407208] x29: ffffffc166053ae0 x28: 0000000000000008
[ 6165.407221] x27: ffffff8008f72000 x26: ffffffc166053de8
[ 6165.407232] x25: ffffffc1bd5ccae8 x24: ffffffc1e096af98
[ 6165.407244] x23: 0000000000000001 x22: ffffffc1e0912018
[ 6165.407255] x21: ffffffc1e08df000 x20: ffffffc1e09125d0
[ 6165.407266] x19: ffffffc1e09125d0 x18: 0000000000000000
[ 6165.407278] x17: 0000007fab7d0f90 x16: ffffff800813a6d0
[ 6165.407289] x15: 0000000000000000 x14: 0000000000000001
[ 6165.407301] x13: 000000000000074c x12: 071c71c71c71c71c
[ 6165.407312] x11: 000000000000000b x10: 0000000000000a10
[ 6165.407325] x9 : ffffffc1660531e0 x8 : ffffffc184b2fa70
[ 6165.407336] x7 : fefefeff646c606d x6 : 0000002cef2ae89b
[ 6165.407348] x5 : 0000000000000000 x4 : 0000000000000000
[ 6165.407360] x3 : ffffff80094df110 x2 : 0000000000000000
[ 6165.407371] x1 : ffffffc1f2c17490 x0 : 0000000000000004

[ 6165.407387] —[ end trace 1ec078e5fb7b67ad ]—
[ 6165.407471] Call trace:
[ 6165.407482] [] __vb2_queue_cancel+0x11c/0x188
[ 6165.407489] [] vb2_core_queue_release+0x2c/0x58
[ 6165.407496] [] _vb2_fop_release+0x84/0xa0
[ 6165.407505] [] tegra_channel_close+0x64/0x140
[ 6165.407514] [] v4l2_release+0x48/0xa0
[ 6165.407525] [] __fput+0x90/0x1d0
[ 6165.407532] [] ____fput+0x20/0x30
[ 6165.407543] [] task_work_run+0xbc/0xd8
[ 6165.407553] [] do_exit+0x2c4/0xa08
[ 6165.407560] [] do_group_exit+0x40/0xa8
[ 6165.407569] [] get_signal+0x26c/0x578
[ 6165.407579] [] do_signal+0x130/0x500
[ 6165.407586] [] do_notify_resume+0x90/0xb0
[ 6165.407596] [] work_pending+0x8/0x10
[ 6187.888052] ------------[ cut here ]------------
[ 6187.888204] WARNING: CPU: 0 PID: 10087 at drivers/media/v4l2-core/videobuf2-core.c:1667 __vb2_queue_cancel+0x11c/0x188
[ 6187.888391] Modules linked in: bnep fuse zram overlay spidev nvgpu bluedroid_pm ip_tables x_tables

[ 6187.888470] CPU: 0 PID: 10087 Comm: v4l2-ctl Tainted: G W 4.9.140-tegra #3
[ 6187.888474] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[ 6187.888481] task: ffffffc19cd5aa00 task.stack: ffffffc166050000
[ 6187.888490] PC is at __vb2_queue_cancel+0x11c/0x188
[ 6187.888498] LR is at __vb2_queue_cancel+0x34/0x188
[ 6187.888504] pc : [] lr : [] pstate: 20400045
[ 6187.888508] sp : ffffffc166053ae0
[ 6187.888513] x29: ffffffc166053ae0 x28: 0000000000000008
[ 6187.888527] x27: ffffff8008f72000 x26: ffffffc166053de8
[ 6187.888539] x25: ffffffc1bd5ccae8 x24: ffffffc1e096af98
[ 6187.888551] x23: 0000000000000001 x22: ffffffc1e0912018
[ 6187.888563] x21: ffffffc1e08df000 x20: ffffffc1e09125d0
[ 6187.888575] x19: ffffffc1e09125d0 x18: 0000007fab467824
[ 6187.888587] x17: 0000007fab7d0f90 x16: ffffff800813a6d0
[ 6187.888599] x15: 0000000000000000 x14: 0000000000000001
[ 6187.888611] x13: 0000000000001585 x12: 071c71c71c71c71c
[ 6187.888623] x11: 000000000000000b x10: 0000000000000a10
[ 6187.888636] x9 : ffffffc1660531e0 x8 : ffffffc19cd5b470
[ 6187.888648] x7 : 0000000000000000 x6 : 0000002d190a353b
[ 6187.888660] x5 : 0000000000000000 x4 : 0000000000000000
[ 6187.888673] x3 : ffffff80094df110 x2 : 0000000000000000
[ 6187.888686] x1 : ffffffc1f2c17490 x0 : 0000000000000004

[ 6187.888703] —[ end trace 1ec078e5fb7b67ae ]—
[ 6187.888791] Call trace:
[ 6187.888802] [] __vb2_queue_cancel+0x11c/0x188
[ 6187.888809] [] vb2_core_queue_release+0x2c/0x58
[ 6187.888817] [] _vb2_fop_release+0x84/0xa0
[ 6187.888827] [] tegra_channel_close+0x64/0x140
[ 6187.888836] [] v4l2_release+0x48/0xa0
[ 6187.888847] [] __fput+0x90/0x1d0
[ 6187.888855] [] ____fput+0x20/0x30
[ 6187.888867] [] task_work_run+0xbc/0xd8
[ 6187.888876] [] do_exit+0x2c4/0xa08
[ 6187.888884] [] do_group_exit+0x40/0xa8
[ 6187.888893] [] get_signal+0x26c/0x578
[ 6187.888903] [] do_signal+0x130/0x500
[ 6187.888911] [] do_notify_resume+0x90/0xb0
[ 6187.888921] [] work_pending+0x8/0x10

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Hi suchb,

Have you managed to get the camera working well?
Any result can be shared?

Thanks