The problem about using ar0234

Hi, everyone:
I am using a camera named ar0234, and the driver is coded by myself according to ov9281.c
Now when i debug my driver, i met a problem:
i use command

v4l2-ctl --set-fmt-video=width=1920,height=1200,pixelformat=GREY -c sensor_mode=60 --stream-mmap --stream-count=1 -d /dev/video0

It show

tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 131072
tegra194-vi5 15c10000.vi: no reply from camera processor
tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel

i try to trace it,
trace log is show

 kworker/0:1-10177 [000] ....  5194.716538: rtcpu_vinotify_event: tstamp:162652867415 tag:FS channel:0x00 frame:1 vi_tstamp:162652724717 data:0x00000010
     kworker/0:1-10177 [000] ....  5194.716542: rtcpu_vinotify_event: tstamp:162652867582 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:162652724720 data:0x00000000
     kworker/0:1-10177 [000] ....  5194.716544: rtcpu_vinotify_event: tstamp:162652867725 tag:CHANSEL_NOMATCH channel:0x01 frame:1 vi_tstamp:162652724800 data:0x00000649
     kworker/0:1-10177 [000] ....  5194.716590: rtos_queue_send_from_isr_failed: tstamp:162653249556 queue:0x0bcb41f8
     kworker/0:1-10177 [000] ....  5194.716592: rtos_queue_send_from_isr_failed: tstamp:162653249709 queue:0x0bcb8a60
     kworker/0:1-10177 [000] ....  5194.716594: rtos_queue_send_from_isr_failed: tstamp:162653249862 queue:0x0bcba5e0
     kworker/0:1-10177 [000] ....  5194.716595: rtos_queue_send_from_isr_failed: tstamp:162653250007 queue:0x0bcbb3a0
     kworker/0:1-10177 [000] ....  5194.716596: rtos_queue_send_from_isr_failed: tstamp:162653250154 queue:0x0bcbc160
     kworker/0:1-10177 [000] ....  5194.716598: rtcpu_vinotify_event: tstamp:162653409752 tag:FE channel:0x00 frame:1 vi_tstamp:162653234729 data:0x00000020
     kworker/0:1-10177 [000] ....  5194.716599: rtcpu_vinotify_event: tstamp:162653409911 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:1 vi_tstamp:162653234730 data:0x01000000
     kworker/0:1-10177 [000] ....  5194.716601: rtcpu_vinotify_event: tstamp:162653410073 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:162611923488 data:0x01020001
     kworker/0:1-10177 [000] ....  5194.716602: rtcpu_vinotify_event: tstamp:162653410216 tag:ATOMP_FE channel:0x00 frame:1 vi_tstamp:162653234731 data:0x00000000
     kworker/0:1-10177 [000] ....  5194.716604: rtcpu_vinotify_event: tstamp:162653410374 tag:FS channel:0x00 frame:2 vi_tstamp:162653243646 data:0x00000010
     kworker/0:1-10177 [000] ....  5194.716605: rtcpu_vinotify_event: tstamp:162653410516 tag:ATOMP_FS channel:0x00 frame:2 vi_tstamp:162653243649 data:0x00000000
     kworker/0:1-10177 [000] ....  5194.716606: rtcpu_vinotify_event: tstamp:162653410671 tag:CHANSEL_NOMATCH channel:0x01 frame:2 vi_tstamp:162653243728 data:0x00000649
     kworker/0:1-10177 [000] ....  5194.716607: rtcpu_vinotify_event: tstamp:162653756881 tag:FE channel:0x00 frame:2 vi_tstamp:162653753658 data:0x00000020
     kworker/0:1-10177 [000] ....  5194.772527: rtcpu_vinotify_event: tstamp:162654278123 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:2 vi_tstamp:162653753658 data:0x01000000
     kworker/0:1-10177 [000] ....  5194.772529: rtcpu_vinotify_event: tstamp:162654278268 tag:RESERVED_19 channel:0x23 frame:2 vi_tstamp:162628535136 data:0x01020001
     kworker/0:1-10177 [000] ....  5194.772531: rtcpu_vinotify_event: tstamp:162654278436 tag:ATOMP_FE channel:0x00 frame:2 vi_tstamp:162653753660 data:0x00000000
     kworker/0:1-10177 [000] ....  5194.772532: rtcpu_vinotify_event: tstamp:162654278574 tag:FS channel:0x00 frame:3 vi_tstamp:162653762575 data:0x00000010
     kworker/0:1-10177 [000] ....  5194.772533: rtcpu_vinotify_event: tstamp:162654278735 tag:CHANSEL_NOMATCH channel:0x01 frame:3 vi_tstamp:162653762657 data:0x00000649
     kworker/0:1-10177 [000] ....  5194.772535: rtcpu_vinotify_event: tstamp:162654278871 tag:FE channel:0x00 frame:3 vi_tstamp:162654272587 data:0x00000020
     kworker/0:1-10177 [000] ....  5194.772536: rtcpu_vinotify_event: tstamp:162654820509 tag:FS channel:0x00 frame:4 vi_tstamp:162654281505 data:0x00000010
     kworker/0:1-10177 [000] ....  5194.772537: rtcpu_vinotify_event: tstamp:162654820646 tag:CHANSEL_NOMATCH channel:0x01 frame:4 vi_tstamp:162654281586 data:0x00000649
     kworker/0:1-10177 [000] ....  5194.772539: rtcpu_vinotify_event: tstamp:162654820806 tag:FE channel:0x00 frame:4 vi_tstamp:162654791515 data:0x0000002

The details could see trace-log-1101
trace-log-1101 (92.3 KB)

Thank your help me to solve this issue…

hello ultwcz1997,

this failure, tegra194-vi5 15c10000.vi: no reply from camera processor
it meant VI engine cannot receive camera frames.

could you please use $ v4l2-ctl -d /dev/video0 --list-formats-ext to examine the reported sensor formats.

BTW,
I doubt this is command, -c sensor_mode=60. do you really have 60 sensor modes available?
are you going to call TEGRA_CAMERA_CID_SENSOR_MODE_ID for mode selections? it should be sensor_modes as control flag.

hello @JerryChang,
$ v4l2-ctl -d /dev/video0 --list-formats-ext

Index       : 0
Type        : Video Capture
Pixel Format: 'GREY'
Name        : 8-bit Greyscale
	Size: Discrete 1920x1200
		Interval: Discrete 0.017s (60.000 fps)
	Size: Discrete 1920x1200
		Interval: Discrete 0.017s (60.000 fps)
	Size: Discrete 910x600
		Interval: Discrete 0.008s (120.000 fps)
	Size: Discrete 910x600
		Interval: Discrete 0.008s (120.000 fps)
	Size: Discrete 1920x1080
		Interval: Discrete 0.017s (60.000 fps)

Index       : 1
Type        : Video Capture
Pixel Format: 'Y10 '
Name        : 10-bit Greyscale
	Size: Discrete 1920x1200
		Interval: Discrete 0.017s (60.000 fps)
	Size: Discrete 1920x1200
		Interval: Discrete 0.017s (60.000 fps)
	Size: Discrete 910x600
		Interval: Discrete 0.008s (120.000 fps)
	Size: Discrete 910x600
		Interval: Discrete 0.008s (120.000 fps)
	Size: Discrete 1920x1080
		Interval: Discrete 0.017s (60.000 fps)

Sorry, sensor_mode wrote error.

BTW, the $v4l2-ctl --get-fmt-video -d /dev/video0 shows follow,

Format Video Capture:
	Width/Height      : 1920/1200
	Pixel Format      : 'Y10 '
	Field             : None
	Bytes per Line    : 3840
	Size Image        : 4608000
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Full Range)
	Flags             : 

Why it only shows one format, what should i do next?

Thank you.

hello ultwcz1997,

may I know what’s your sensor device tree settings, did you report pixel format correctly?
please see-also Sensor Software Driver Programming, you may review [Property-Value Pairs] settings.
thanks

Hi,JerryChang,
Thanks you reply.
The device tree settings is following:

i2c@3180000 {
		tca9548@70 {
			i2c@0 {
				ar0234_a@10 {
					compatible = "nvidia,ar0234";

					reg = <0x10>;
					devnode = "video0";

					/* Physical dimensions of sensor */
					physical_w = "5.78";
					physical_h = "3.62";

					sensor_model ="ar0234";
					
					use_sensor_mode_id = "true";

					/* Sensor output flip and mirror settings */
					vertical-flip = "false";
					horizontal-mirror = "false";

					mode0 { /* mode ar0234_mode_1920x1200_10bit_60fps */
						mclk_khz = "24000";
						num_lanes = "2";
						tegra_sinterface = "serial_a";
						phy_mode = "DPHY";
						discontinuous_clk = "no";
						dpcm_enable = "false";
						cil_settletime = "0";

						active_w = "1920";
						active_h = "1200";
						mode_type = "mono";
						pixel_phase = "grey";
						csi_pixel_bit_depth = "10";
						readout_orientation = "0";
						line_length = "2448";	// 0x0264 *4
						inherent_gain = "1";
						//mclk_multiplier = "2";
						pix_clk_hz = "180000000";	

						gain_factor = "128";
						min_gain_val = "128"; /* 1x */
						max_gain_val = "2048"; /* 15.9924x */
						step_gain_val = "1";	/* 1/128 */
						default_gain = "128";

						framerate_factor = "1000000";
						min_framerate = "1121986";	/* 1.12 fps */
						max_framerate = "60000000";	/* 60 fps  */
						step_framerate = "1";
						default_framerate = "60000000";

						exposure_factor = "1000000";
						min_exp_time = "14";	/* 13.6us */
						max_exp_time = "890936";	/* us */
						step_exp_time = "1";
						default_exp_time = "2500";
						embedded_metadata_height = "0";
					};

					mode1 { /* mode ar0234_mode_1920x1200_8bit_60fps */
						mclk_khz = "24000";
						num_lanes = "2";
						tegra_sinterface = "serial_a";
						phy_mode = "DPHY";
						discontinuous_clk = "no";
						dpcm_enable = "false";
						cil_settletime = "0";

						active_w = "1920";
						active_h = "1200";
						mode_type = "mono";
						pixel_phase = "grey";
						csi_pixel_bit_depth = "8";
						readout_orientation = "0";
						line_length = "2448";	
						inherent_gain = "1";
						//mclk_multiplier = "2";
						pix_clk_hz = "180000000";	

						gain_factor = "128";
						min_gain_val = "128";
						max_gain_val = "2048";
						step_gain_val = "1";	
						default_gain = "128";

						framerate_factor = "1000000";
						min_framerate = "1121986";	/* 1.12 fps */
						max_framerate = "60000000";	/* 60 fps  */
						step_framerate = "1";
						default_framerate = "60000000";

						exposure_factor = "1000000";
						min_exp_time = "14";	/* us */
						max_exp_time = "890936";	/* us */
						step_exp_time = "1";
						default_exp_time = "2500";

						embedded_metadata_height = "0";
						
					};

					mode2 { /* mode ar0234_mode_910x600_10bit_120fps */
						mclk_khz = "24000";
						num_lanes = "2";
						tegra_sinterface = "serial_a";
						phy_mode = "DPHY";
						discontinuous_clk = "no";
						dpcm_enable = "false";
						cil_settletime = "0";

						active_w = "910";
						active_h = "600";
						mode_type = "mono";
						pixel_phase = "grey";
						csi_pixel_bit_depth = "10";
						readout_orientation = "0";
						line_length = "612";	// 0x02D8 * 2
						inherent_gain = "1";
						//mclk_multiplier = "2";
						pix_clk_hz = "45000000";	// 100 MHz -> 800Mbps -> 800 / 10 = 80Mpix(pre lane), 2 lane(must multiplier 2)

						gain_factor = "128";
						min_gain_val = "128"; /* 1 dB */
						max_gain_val = "2048"; /* 16 dB */
						step_gain_val = "1";	/* 0.0625 dB */
						default_gain = "128";

						framerate_factor = "1000000";
						min_framerate = "1121986";	/* 1.67 fps */
						max_framerate = "120000000";	/* 120 fps  */
						step_framerate = "1";
						default_framerate = "120000000";

						exposure_factor = "1000000";
						min_exp_time = "14";	/* us */
						max_exp_time = "890936";	/* us */
						step_exp_time = "1";
						default_exp_time = "2500";

						embedded_metadata_height = "0";
					};

					mode3 { /* mode ar0234_mode_910x600_8bit_120fps */
						mclk_khz = "24000";
						num_lanes = "2";
						tegra_sinterface = "serial_a";
						phy_mode = "DPHY";
						discontinuous_clk = "no";
						dpcm_enable = "false";
						cil_settletime = "0";

						active_w = "910";
						active_h = "600";
						mode_type = "mono";
						pixel_phase = "grey";
						csi_pixel_bit_depth = "8";
						readout_orientation = "0";
						line_length = "612";	
						inherent_gain = "1";
						mclk_multiplier = "2";
						pix_clk_hz = "45000000";	

						gain_factor = "128";
						min_gain_val = "128"; /* 1 dB */
						max_gain_val = "2048"; /* 16 dB */
						step_gain_val = "1";	/* 0.0625 dB */
						default_gain = "128";

						framerate_factor = "1000000";
						min_framerate = "1121986";	/* 1.67 fps */
						max_framerate = "120000000";	/* 210 fps  */
						step_framerate = "1";
						default_framerate = "120000000";

						exposure_factor = "1000000";
						min_exp_time = "14";	/* us */
						max_exp_time = "890936";	/* us */
						step_exp_time = "1";
						default_exp_time = "2500";

						embedded_metadata_height = "0";

					};

					mode4 { /* mode ar0234_mode_1920x1080_10bit_60fps */
						mclk_khz = "24000";
						num_lanes = "2";
						tegra_sinterface = "serial_a";
						phy_mode = "DPHY";
						discontinuous_clk = "no";
						dpcm_enable = "false";
						cil_settletime = "0";

						active_w = "1920";
						active_h = "1080";
						mode_type = "mono";
						pixel_phase = "grey";
						csi_pixel_bit_depth = "10";
						readout_orientation = "0";
						line_length = "2448";	// 0x0264 * 4
						inherent_gain = "1";
						//mclk_multiplier = "2";
						pix_clk_hz = "180000000";	

						gain_factor = "128";
						min_gain_val = "128"; /* 1x */
						max_gain_val = "2048"; /* 15.9924x */
						step_gain_val = "1";	/* 1/128 */
						default_gain = "128";

						framerate_factor = "1000000";
						min_framerate = "1121986";	/* 1.12 fps */
						max_framerate = "60000000";	/* 60 fps  */
						step_framerate = "1";
						default_framerate = "60000000";

						exposure_factor = "1000000";
						min_exp_time = "14";	/* 13.6us */
						max_exp_time = "890936";	/* us */
						step_exp_time = "1";
						default_exp_time = "2500";

						embedded_metadata_height = "0";
					};
					
					ports {
						#address-cells = <1>;
						#size-cells = <0>;
						port@0 {
							reg = <0>;
							ar0234_out0: endpoint {
								port-index = <0>;
								bus-width = <2>;
								remote-endpoint = <&ar0234_csi_in0>;
							};
						};
					};
				};
			};

PS: mode2-mode4 is not really correct.
Thank you.

these two were incorrect.
please check Property-Value Pairs session for the table that describe the entries.

Hi JerryChang,
This is already fixed in the driver, and i have used it in ov9282 sensor sussessfully.
The main problem is register configuration uncorrectlly.
Thanks your suggestions.

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