TC358746 on Orin NX

We have a driver for the TC358746, which we are using to take the parallel bus from an SDI receiver and convert to MIPI. We have had this working successfully with the Jetson Xavier NX on our custom carrier board. However, when trying a Jetson Orin NX on our carrier board, we have been unable to capture data. I am seeing the following kernel errors:

[ 1569.550056] tc358746 9-000e: tc358746_s_stream(1)++
[ 1569.558688] tc358746 9-000e: tc358746_g_cur_csi_settings(1)
[ 1569.564429] tc358746 9-000e: tc358746_enable_csi_module(1)++
[ 1569.570689] tc358746 9-000e: tc358746_wr_csi_control(8083)++
[ 1569.576524] tc358746 9-000e: CSI_CONFW 0xa3008083
[ 1569.581574] tc358746 9-000e: enable
[ 1569.585685] tc358746 9-000e: tc358746_s_stream–
[ 1572.063690] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 1572.072848] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 1572.082463] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1572.090331] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 1572.101116] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1572.109461] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel

I ahve also tried enabling tracing, and have attached the log.
trace-250331-1247.log (33.0 MB)

  1. Do you set the lane_polarity for Orin NX? You may reference to imx219/imx477 for this configuration for the CSI-0/1
  2. Confirm the pix_clk_hz for below NOTE.
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)

I have added the following mode definitions but I am still unable to capture:

  		mode0 { // 720p60
  			mclk_khz = "594000";
  			num_lanes = "2";
  			tegra_sinterface = "serial_a";
  			phy_mode = "DPHY";
  			discontinuous_clk = "yes";
  			dpcm_enable = "false";
  			cil_settletime = "0";

  			active_w = "1280";
  			active_h = "720";
  			pix_clk_hz = "74250000";
  			lane_polarity = "6";
  		};
  		mode1 { // 1080p30
  			mclk_khz = "594000";
  			num_lanes = "2";
  			tegra_sinterface = "serial_a";
  			phy_mode = "DPHY";
  			discontinuous_clk = "yes";
  			dpcm_enable = "false";
  			cil_settletime = "0";

  			active_w = "1920";
  			active_h = "1080";
  			pix_clk_hz = "74250000";
  			lane_polarity = "6";
  		};
  		mode2 { // 1080p60
  			mclk_khz = "1188000";
  			num_lanes = "2";
  			tegra_sinterface = "serial_a";
  			phy_mode = "DPHY";
  			discontinuous_clk = "yes";
  			dpcm_enable = "false";
  			cil_settletime = "0";

  			active_w = "1920";
  			active_h = "1080";
  			pix_clk_hz = "148500000";
  			lane_polarity = "6";
  		};

I have also tried hard-wiring the polarity to 6 in the kernel, which has not helped.

After replacing some of the dev_dbg calls in the kernel with dev_err (/sys/kernel/debug/dynamic_debug/control doesn’t seem to be working with JetPack 5.1.4), I have more details in the kernel log:

[ 137.471004] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_power_on
[ 137.488232] bwmgr API not supported
[ 137.496114] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_start_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 137.510544] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: phy mode unavailable in props, use default
[ 137.519675] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_set_config: stream_id=0, csi_port=0
[ 137.529249] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime is pulled from device of_node
[ 137.538898] tc358746 9-000e: tc358746_s_stream(1)++
[ 137.543924] tc358746 9-000e: tc358746_g_cur_csi_settings(1)
[ 137.549665] tc358746 9-000e: tc358746_enable_csi_module(1)++
[ 137.555900] tc358746 9-000e: tc358746_wr_csi_control(8083)++
[ 137.561732] tc358746 9-000e: CSI_CONFW 0xa3008083
[ 137.566782] tc358746 9-000e: enable
[ 137.570888] tc358746 9-000e: tc358746_s_stream–
[ 140.005450] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 140.014621] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 140.024217] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stop_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 140.035006] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 140.042751] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 140.053425] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_start_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 140.064287] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: phy mode unavailable in props, use default
[ 140.073490] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_set_config: stream_id=0, csi_port=0
[ 140.083079] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime is pulled from device of_node
[ 140.092394] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 140.100110] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 140.110877] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 140.120735] tc358746 9-000e: tc358746_s_stream(0)++
[ 140.125756] tc358746 9-000e: tc358746_g_cur_csi_settings(1)
[ 140.131498] tc358746 9-000e: tc358746_enable_csi_module(0)++
[ 140.137312] tc358746 9-000e: disable
[ 140.142714] tc358746 9-000e: tc358746_s_stream–
[ 140.147495] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stop_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0

I have attached the latest trace.
trace-250402-0910.log (32.3 MB)

When you say >1.5Gbps, is that per lane or total? Although by my calculations, doing 1080p30 or 720p60 should be doing 1.188Gbps in total, so either way, it shouldn’t be hitting this limit.

Also, I am not sure whether the modes should be added to the gs2971 (SDI decoder) entry or to the tcs358746 (parallel bus to MIPI) entry. The latter seems to have no effect; if I try adding the modes to the former, I seem to cause a NULL pointer exception in tegra_channel_populate_dev_info.

The trace log tell the SOT error. That could be the settle time issue.

I have tried setting cil_settletime to zero in the device tree but this has not helped.
I am not clear on how it should be set; according to Sensor Software Driver Programming — NVIDIA Jetson Linux Developer Guide 1 documentation one line says that it should be the value in nanoseconds, but the next line gives an equation that implies that it is actually a number of clock cycles. By my calculations, a 74.25MHz pixel clock would give a settle time between 65.5ns and 132.4ns, or a cil_settletime between 13362 and 27016.

I have tried updating the device tree with values of 20, 20000 and 100, but nothing has worked so far. This is an excerpt from the device tree:

  i2c@0 {
  	tc358746_1:video-receiver@0e {
  		compatible = "toshiba,tc358746";
  		reg = <0x0e>;

  		//devnode = "video0";
  		sensor_model ="tc358746";

  		reset-gpios = <&tegra_aon_gpio CAM0_RST_L GPIO_ACTIVE_LOW>;
  		clocks = <&tc_clock 0>;
  		clock-names = "refclk";

  		mode0 { // 720p60
  			mclk_khz = "297000";
  			num_lanes = "2";
  			tegra_sinterface = "serial_a";
  			phy_mode = "DPHY";
  			discontinuous_clk = "no";
  			dpcm_enable = "false";
  			cil_settletime = "100";
  			lane_polarity = "6";

  			active_w = "1280";
  			active_h = "720";
  			readout_orientation = "0";
  			deskew_initial_enable = "false";
  			deskew_periodic_enable = "false";
  			mode_type = "yuv";
  			pixel_phase = "uyvy";
  			csi_pixel_bit_depth = "16";
  			line_length = "1650";
  			inherent_gain = "1";
  			pix_clk_hz = "74250000";
  		};
  		mode1 { // 1080p30
  			mclk_khz = "297000";
  			num_lanes = "2";
  			tegra_sinterface = "serial_a";
  			phy_mode = "DPHY";
  			discontinuous_clk = "no";
  			dpcm_enable = "false";
  			cil_settletime = "100";
  			lane_polarity = "6";

  			active_w = "1920";
  			active_h = "1080";
  			readout_orientation = "0";
  			deskew_initial_enable = "false";
  			deskew_periodic_enable = "false";
  			mode_type = "yuv";
  			pixel_phase = "uyvy";
  			csi_pixel_bit_depth = "16";
  			line_length = "2200";
  			inherent_gain = "1";
  			pix_clk_hz = "74250000";
  		};
  		mode2 { // 1080p60
  			mclk_khz = "594000";
  			num_lanes = "2";
  			tegra_sinterface = "serial_a";
  			phy_mode = "DPHY";
  			discontinuous_clk = "yes";
  			dpcm_enable = "false";
  			cil_settletime = "0";

  			active_w = "1920";
  			active_h = "1080";
  			pix_clk_hz = "148500000";
  			lane_polarity = "6";
  		};

  		ports {
  			#address-cells = <1>;
  			#size-cells = <0>;
  			port@0 {
  				reg = <0>;
  				tc358746_in0: endpoint@0 {
  					port-index = <0>;
  					remote-endpoint = <&gs2971_out0>;
  				};
  			};
  			port@1 {
  				reg = <1>;
  				tc358746_out0: endpoint@1 {
  					port-index = <1>;
  					bus-width = <2>;
  					clock-lanes = <0>;
  					data-lanes = <1 2>;
  					link-frequencies = /bits/ 64 <121500000 297000000 594000000>;
  					remote-endpoint = <&tc_csi_in0>;
  				};
  			};
  		};
  	};
  };

The kernel shows the following:

[ 235.938683] gs2971 spi0.0: gs_g_input_status++
[ 235.943585] gs2971 spi0.0: REG_LINES_PER_FRAME + 750 read as 40760ec0
[ 235.950464] gs2971 spi0.0: REG_ACT_LINES_PER_FRAME read as 12d0
[ 235.956594] gs2971 spi0.0: gs_g_input_status–(0,0)
[ 235.961689] gs2971 spi0.0: gs_set_pad_format(1280x720,200f)++
[ 235.967611] gs2971 spi0.0: gs_set_pad_format(0x0,0)–
[ 235.972816] gs2971 spi0.0: gs_set_pad_format–
[ 235.977393] gs2971 spi0.0: gs_mbus_fmt(0)++
[ 235.981966] gs2971 spi0.0: gs_mbus_fmt(1280x720)–
[ 235.986900] gs2971 spi0.0: gs_set_pad_format(1280x720,200f)++
[ 235.992813] gs2971 spi0.0: gs_set_pad_format–
[ 235.997388] gs2971 spi0.0: gs_mbus_fmt(200f)++
[ 236.002260] gs2971 spi0.0: gs_mbus_fmt(1280x720)–
[ 236.009823] tc358746 9-000e: tc358746_s_power++
[ 236.014863] tc358746 9-000e: tc358746_get_remote_fmt(0)++
[ 236.020431] gs2971 spi0.0: gs_get_pad_format++
[ 236.025009] gs2971 spi0.0: gs_mbus_fmt(0)++
[ 236.029597] gs2971 spi0.0: gs_mbus_fmt(1280x720)–
[ 236.034538] tc358746 9-000e: Detected 1280x720
[ 236.039113] tc358746 9-000e: tc358746_set_fmt(1,200f)++
[ 236.044494] tc358746 9-000e: __tc358746_get_pad_format(1)++
[ 236.050230] gs2971 spi0.0: gs_g_volatile_ctrl(9f0902)++
[ 236.055857] gs2971 spi0.0: Read reg 0x22 as 12d0 → 0
[ 236.061066] gs2971 spi0.0: gs_g_volatile_ctrl(74250000)–
[ 236.066620] gs2971 spi0.0: gs_g_volatile_ctrl(9e0902)++
[ 236.072251] gs2971 spi0.0: gs_g_volatile_ctrl(370)–
[ 236.077377] tc358746 9-000e: tc358746_adjust_timings(1280,49152)++
[ 236.083740] tc358746 9-000e: tc358746_adjust_fifo_size(1280,49152)++
[ 236.090291] tc358746 9-000e: tc358746_adjust_timings(1280,1)–
[ 236.096290] tc358746 9-000e: tc358746_set_fmt–
[ 236.100958] tc358746 9-000e: tc358746_set_buffers++
[ 236.106522] tc358746 9-000e: FIFOCTL 0x32: WORDCNT 0xa00
[ 236.112016] tc358746 9-000e: tc358746_g_cur_csi_settings(1)
[ 236.117763] tc358746 9-000e: tc358746_set_csi++
[ 236.123893] tc358746 9-000e: tc358746_set_csi_color_space(200f)++
[ 236.130896] tc358746 9-000e: tc358746_set_csi_color_space–
[ 236.137007] tc358746 9-000e: tc358746_g_cur_csi_settings(1)
[ 236.143154] tc358746 9-000e: tc358746_set_pll(594000000,0)++
[ 236.148979] tc358746 9-000e: 594000000/6750000=88
[ 236.153821] tc358746 9-000e: <<0=88
[ 236.157408] tc358746 9-000e: tc358746_set_pll–
[ 236.162437] tc358746 9-000e: tc358746_g_cur_csi_settings(1)
[ 236.168175] tc358746 9-000e: tc358746_enable_csi_lanes(1,2)++
[ 236.175882] tc358746 9-000e: tc358746_enable_csi_lanes(7)–
[ 236.181997] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_power_on
[ 236.199293] bwmgr API not supported
[ 236.207455] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_start_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 236.221930] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: phy mode unavailable in props, use default
[ 236.231061] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_set_config: stream_id=0, csi_port=0
[ 236.240648] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime is pulled from device of_node
[ 236.249987] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: lane_polarity=6
[ 236.257019] tc358746 9-000e: tc358746_s_stream(1)++
[ 236.262049] tc358746 9-000e: tc358746_g_cur_csi_settings(1)
[ 236.267792] tc358746 9-000e: tc358746_enable_csi_module(1)++
[ 236.274314] tc358746 9-000e: tc358746_wr_csi_control(8083)++
[ 236.280160] tc358746 9-000e: CSI_CONFW 0xa3008083
[ 236.285221] tc358746 9-000e: enable
[ 236.289326] tc358746 9-000e: tc358746_s_stream–
[ 236.294099] gs2971 spi0.0: gs_s_stream(1)++
[ 236.298702] gs2971 spi0.0: gs_s_stream(1)–
[ 238.725719] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 238.734861] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 238.744445] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stop_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 238.755210] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 238.762925] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 238.773597] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_start_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 238.784438] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: phy mode unavailable in props, use default
[ 238.793582] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_set_config: stream_id=0, csi_port=0
[ 238.803179] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime is pulled from device of_node
[ 238.812489] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: lane_polarity=6
[ 238.819200] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 238.826900] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 238.837664] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 238.847196] gs2971 spi0.0: gs_s_stream(0)++
[ 238.851806] gs2971 spi0.0: gs_s_stream(0)–
[ 238.856124] tc358746 9-000e: tc358746_s_stream(0)++
[ 238.861144] tc358746 9-000e: tc358746_g_cur_csi_settings(1)
[ 238.866885] tc358746 9-000e: tc358746_enable_csi_module(0)++
[ 238.872709] tc358746 9-000e: disable
[ 238.877703] tc358746 9-000e: tc358746_s_stream–
[ 238.882467] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stop_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 238.897503] bwmgr API not supported

I have attached the latest trace logs.

trace-250414-1442.log (6.0 MB)
trace-250414-1151.log (32.2 MB)
trace-250414-1130.log (32.2 MB)

As an update, I seem to be able to capture NTSC (despite not having an NTSC mode defined in the mode table) but the picture is distorted.



The first image should be black, but has green noise on top.
The second image should show a black & white timecode at the top and coloured gradients underneath; again, there seems to be some sort of green noise.

What’s the output size. Maybe try preferred_stride for 256 alignment like below command.

v4l2-ctl -c preferred_stride=2048 

I am currently unable to capture with v4l2-ctl.
v4l2-ctl -d /dev/video0 --stream-count=1 --stream-to=frame.raw --verbose
gives me

VIDIOC_QUERYCAP: ok
New timings found
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: 702720 ts: 1238.314294 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 702720 ts: 1238.327628 delta: 13.334 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 702720 ts: 1238.344343 delta: 16.715 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 702720 ts: 1238.360994 delta: 16.651 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 4 bytesused: 702720 ts: 1238.377709 delta: 16.715 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 5 bytesused: 702720 ts: 1238.394360 delta: 16.651 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 6 bytesused: 702720 ts: 1238.411075 delta: 16.715 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 7 bytesused: 702720 ts: 1238.427726 delta: 16.651 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 8 bytesused: 702720 ts: 1238.444441 delta: 16.715 ms (error, ts-monotonic, ts-src-eof)

The kernel log contains

[ 1224.156518] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_power_on
[ 1224.174012] bwmgr API not supported
[ 1224.183183] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_start_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 1224.197631] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: phy mode unavailable in props, use default
[ 1224.206768] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_set_config: stream_id=0, csi_port=0
[ 1224.216339] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime is pulled from device of_node
[ 1224.225645] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: lane_polarity=6
[ 1224.232663] tc358746 9-000e: tc358746_s_stream(1)++
[ 1224.237686] tc358746 9-000e: tc358746_g_cur_csi_settings(0)
[ 1224.243423] tc358746 9-000e: tc358746_enable_csi_module(1)++
[ 1224.249672] tc358746 9-000e: tc358746_wr_csi_control(8083)++
[ 1224.255491] tc358746 9-000e: CSI_CONFW 0xa3008083
[ 1224.260561] tc358746 9-000e: enable
[ 1224.264695] tc358746 9-000e: tc358746_s_stream–
[ 1224.277097] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.293778] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.310542] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.327146] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.343829] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.360519] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.377197] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.393916] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.410557] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.427240] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.444002] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.460605] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.477292] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.493975] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.510654] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.527380] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.544175] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.560854] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.577620] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.594221] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.610903] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.627587] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.644272] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.660996] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.677635] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.694318] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.711079] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.727686] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.744371] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.761050] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.777736] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.794460] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.811097] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.827641] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.844407] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.861003] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.877684] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.894367] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.911052] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.927772] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.944423] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.961104] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.977864] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1224.994465] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.011152] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.027834] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.044515] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.061243] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.078033] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.094712] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.111478] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.128080] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.144763] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.161446] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.178131] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.194854] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.211492] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.228033] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.244790] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.261394] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.278080] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.294762] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.311449] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.328166] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.344810] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.361493] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.378251] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.394859] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.411539] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.428225] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.444907] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.461634] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.478273] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.494956] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.511720] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.528322] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.545005] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.561690] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.578378] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.595096] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.611740] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1225.622331] tc358746 9-000e: tc358746_s_stream(0)++
[ 1225.627422] tc358746 9-000e: tc358746_g_cur_csi_settings(0)
[ 1225.633198] tc358746 9-000e: tc358746_enable_csi_module(0)++
[ 1225.639068] tc358746 9-000e: disable
[ 1225.644129] tc358746 9-000e: tc358746_s_stream–
[ 1225.648929] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stop_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0

I have attached a trace of running v4l2-ctl.

trace-v4l2-ctl–250416-0921.log (463.5 KB)

The previous tests were done using our capture.c application, which I believe originally came from linuxtv.org. If I try to capture a circular test pattern, it seems to be stretched at the right hand side.

I suspect that the pixel doubling used by HD-SDI might be causing a problem here. However, if I halve the capture width from 1440 to 720, the result seems to be garbled:

The issue with SD capture was related to the pixel clock. I am now able to capture a reasonable picture, although there seems to be some shifting on alternating lines (I have seen similar when capturing NTSC on another MIPI device so I assume that this is a limitation of the Jetson).

I am still unable to capture HD-SDI resolutions such as 720p60.

Maybe try 32 alignment for 720p by set preferred_stride=736

I have tried forcing csi_settletime to 20 as it does not seem to be reading this from the device tree. This has not helped, nor has setting preferred_stride=736.

This is the kernel log from running v4l2-ctl:

[ 95.518030] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_power_on
[ 95.535446] bwmgr API not supported
[ 95.543285] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_start_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 95.557722] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: phy mode unavailable in props, use default
[ 95.566860] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_set_config: stream_id=0, csi_port=0
[ 95.576456] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime is pulled from device of_node
[ 95.585764] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime=20
[ 95.592661] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: lane_polarity=6
[ 95.599677] tc358746 9-000e: tc358746_s_stream(1)++
[ 95.604705] tc358746 9-000e: tc358746_g_cur_csi_settings(1)
[ 95.610432] tc358746 9-000e: tc358746_enable_csi_module(1)++
[ 95.616684] tc358746 9-000e: tc358746_wr_csi_control(8083)++
[ 95.622520] tc358746 9-000e: CSI_CONFW 0xa3008083
[ 95.627564] tc358746 9-000e: enable
[ 95.631672] tc358746 9-000e: tc358746_s_stream–
[ 98.213812] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 98.223001] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 98.233641] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stop_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 98.244457] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 98.252210] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 98.262877] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_start_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 98.273716] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: phy mode unavailable in props, use default
[ 98.282904] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_set_config: stream_id=0, csi_port=0
[ 98.292489] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime is pulled from device of_node
[ 98.301815] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime=20
[ 98.308715] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: lane_polarity=6
[ 98.315433] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 98.323141] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 98.333885] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 101.029785] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 101.038933] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 101.048565] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stop_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 101.059344] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 101.067068] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 101.077749] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_start_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 101.088625] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: phy mode unavailable in props, use default
[ 101.097762] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_set_config: stream_id=0, csi_port=0
[ 101.107341] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime is pulled from device of_node
[ 101.116654] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime=20
[ 101.123548] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: lane_polarity=6
[ 101.130260] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 101.137974] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 101.148713] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 103.845536] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 103.854672] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 103.864261] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stop_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 103.875018] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 103.882744] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 103.893422] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_start_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0
[ 103.904273] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: phy mode unavailable in props, use default
[ 103.913405] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_set_config: stream_id=0, csi_port=0
[ 103.922999] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime is pulled from device of_node
[ 103.932314] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: cil_settletime=20
[ 103.939204] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: lane_polarity=6
[ 103.945922] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 103.953622] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 103.964362] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 103.974604] tc358746 9-000e: tc358746_s_stream(0)++
[ 103.979671] tc358746 9-000e: tc358746_g_cur_csi_settings(1)
[ 103.985434] tc358746 9-000e: tc358746_enable_csi_module(0)++
[ 103.991282] tc358746 9-000e: disable
[ 103.996368] tc358746 9-000e: tc358746_s_stream–
[ 104.001178] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stop_streaming: csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0

I have attached the latest trace:

trace-250417-0934.log (6.0 MB)

The trace log tell the SOT error means the improper settle time.

What does that mean?

SOT means Start Of Transfer.

A settle time of 20 works for the Xavier. What should I use for the Orin?

Check below calculation to check the value.

cil_settletime NVIDIA recommendations for CPHY TX timings are:

t3-PREPARE = 40 ns

t3-PREBEGIN = 140 UI

The RX side t3-SETTLE timing should only be adjusted if the TX cannot meet the above. In that case, the constraints are:

t3-PREPARE + 6 UI < t3-SETTLE < t3-PREPARE + t3-PREBEGIN

For robustness, it is recommended that the t3-SETTLE value should should be chosen from the middle of the range.

Calculating the cil_settletime parameter:

cil_settletime = t3-SETTLE Ă— 0.408 - 2

For DPHY

THS settle time of the MIPI lane, in nanoseconds. Calculate the range of acceptable values with the formula:

85 ns + 6Ă—*UI* < (*cil_settletime*) Ă— (*lp_clock_period*) < 145 ns + 10Ă—*UI*

Where:

* *lp_clock_period* is 1/(408 MHz).
* *UI* is the unit interval, equal to the duration of the HS state on the clock lane.If the value is 0, the driver attempts to auto-calibrate according to the `mclk_multiplier` parameter.

See the [MIPI Alliance Specification for D-PHY](http://bfiles.chinaaet.com/justlxy/blog/20171110/1000019445-6364593011828743047249885.pdf) for details.

So are you saying that this line in the documentation is incorrect for the Orin?

85 ns + 6Ă—ui < (cil_settletime+6) Ă— (lp_clock_period) < 145 ns + 10Ă—ui

Where:

  • lp_clock_period is 1/(204 MHz).
  • ui is the unit interval, equal to the duration of the HS state on the clock lane.

Also, the link that you posted to the MIPI spec doesn’t work.

I’ve recalculated the settle time according to the new equation and I am now able to capture 720p60, 1080p30 and 1080p60 with a settle time of 40. Thank you for your assistance.

1 Like