Nvarguscamerasrc hang system

Porting driver from imx274 to imx334.

12bit rggb bayer, 3840X2160 30fps.
Set gain/exposure/fps functions to dummy.

Save raw image successed by

v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat=RG12 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=ss.raw

But if run

gst-launch-1.0 nvarguscamerasrc ! fakesink

Desktop will hang then reboot.

Dts list below

#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>
#define CAM1_PWDN	TEGRA_GPIO(S, 7)

/ {
	tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		status = "okay";

		num_csi_lanes = <4>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <12>;

		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <750000>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;


		modules {
			module0 {
				badge = "imx334_rear_imx334";
				position = "rear";
				status = "okay";
				orientation = "0";
				cam_module0_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx334 6-001a";
					proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/imx334_a@1a";
				};

			};
		};
	};

	gpio@6000d000 {
		camera-control-output-low {
			gpio-hog;
			output-low;
			gpios = < CAM1_PWDN 0 >;
			label = "cam1-pwdn";
		};
	};

	host1x {
		vi {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx334_vi_in0: endpoint {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx334_csi_out0>;
					};
				};
			};
		};

		nvcsi {
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx334_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <4>;
							remote-endpoint = <&imx334_out0>;
						};
					};
					port@1 {
						reg = <1>;
						imx334_csi_out0: endpoint@1 {
							remote-endpoint = <&imx334_vi_in0>;
						};
					};
				};
			};
		};

		i2c@546c0000 {
			clock-frequency = <200000>;
			imx334_a@1a {
				compatible = "nvidia,imx334";
				/* I2C device address */
				reg = <0x1a>;

				/* V4L2 device node location */
				devnode = "video0";

				/* Physical dimensions of sensor */
				physical_w = "3.674";
				physical_h = "2.738";

				clocks = <&tegra_car TEGRA210_CLK_CLK_OUT_3>;
				clock-names = "clk_out_3";
				clock-frequency = <24000000>;


				reset-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;

				sensor_model = "imx334";

				use_sensor_mode_id = "true";

				mode0 {
					mclk_khz = "24000";
					num_lanes = "4";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					discontinuous_clk = "no";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "3840";
					active_h = "2160";

				        dynamic_pixel_bit_depth = "12";
        				csi_pixel_bit_depth = "12";
        				mode_type = "bayer";
        				pixel_phase = "rggb";

					readout_orientation = "0";
					line_length = "4538";

					inherent_gain = "1";
					pix_clk_hz = "297000000";

					gain_factor = "10000";
					min_gain_val = "11250";/* 1DB*/
					max_gain_val = "320000";/* 32DB*/
					step_gain_val = "625";
					default_gain = "11250";

					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					framerate_factor = "1000000";
					min_framerate = "1500000";/*1.5 */
					max_framerate = "30000000";/*30*/
					step_framerate = "1";
					default_framerate = "30000000";

					exposure_factor = "1000000";
					min_exp_time = "34";/* us */
					max_exp_time = "358733";/* us */
					step_exp_time = "1";
					default_exp_time = "12000";/* us */
					#default_exp_time = "12000";/* us */
					
					embedded_metadata_height = "0";
				};

				ports {
					#address-cells = <1>;
					#size-cells = <0>;

					port@0 {
						reg = <0>;
						imx334_out0: endpoint {
							port-index = <0>;
							bus-width = <4>;
							remote-endpoint = <&imx334_csi_in0>;
						};
					};
				};

			};
		};
	};
};

Thanks for your help!!

Did you check the raw image?
Have confirm below command to check if able streaming continuously.

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

The raw image data all zeros.

And the stream is continuous and maintain 30 fps.

Thank you!

Modify all of the control function like set_frame_rate() to dummy to try.

All control functions set to dummy already.

static struct tegracam_ctrl_ops imx334_ctrl_ops = {
	.numctrls = ARRAY_SIZE(ctrl_cid_list),
	.ctrl_cid_list = ctrl_cid_list,
	.set_gain = imx334_set_gain,
	.set_exposure = imx334_set_exposure,
	.set_frame_rate = imx334_set_frame_rate,
	.set_group_hold = imx334_set_group_hold,
	// .fill_string_ctrl = imx334_fill_string_ctrl,
};

static int imx334_set_gain(struct tegracam_device *tc_dev, s64 val)
{

	return 0;
}

static int imx334_set_exposure(struct tegracam_device *tc_dev, s64 val)
{
	return 0;
}

static int imx334_set_frame_rate(struct tegracam_device *tc_dev, s64 val)
{
	return 0;

}


static int imx334_set_group_hold(struct tegracam_device *tc_dev, bool val)
{
	return 0;
}

Thank you!

  1. Try discontinuous_clk=yes
  2. Have some delay after sensor stream on REG programing.

Add 18ms delay after stream on , nothing changed.
Set discontinuous_clk=yes, argus_daemon crashed.

@ShaneCCC ,How can I do for this situation?
Why argus deamon hang OS?
Is there some logs to trace it?

Argus hang could be unable capture successfully from sensor and Nano didn’t implement recovery at some situation could cause OS hang.
Maybe consult with vendor if any sensor mode to try. And dump the device tree to confirm the tegra_sinterface is correct.