About IMX390 camera issue with Jetson Xavier

Hello All,
I‘m using IMX390+MAX9295A+MAX96718F on Xavier, and the camera module is sensing SG2-IMX390C-5200-GMSL2-Hxxx.
SG2-IMX390C-5200-GMSL2-Hxxx_cn.pdf (2.0 MB)
I’m using Xavier, Jetpack 4.6.1.
Now there are some problems:
1.Due to the deserializer rate limiting, the serializer and deserializer now operate in 3Gbps rate mode, now there is device node /dev/video0, but when I use the commands it looks like something is wrong:there is no camera formats and the topology looks like incorrect

crrc@crrc-desktop:~$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'RG10'
        Name        : 10-bit Bayer RGRG/GBGB

crrc@crrc-desktop:~$

and

crrc@crrc-desktop:~$ sudo media-ctl -p -d /dev/media0
[sudo] password for crrc:
Media controller API version 0.1.0

Media device information
------------------------
driver          tegra194-vi5
model           NVIDIA Tegra Video Input Device
serial
bus info
hw revision     0x3
driver version  0.0.0

Device topology
- entity 1: 15a00000.nvcsi--1 (2 pads, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        pad0: Sink
        pad1: Source
                -> "vi-output, 15a00000.nvcsi--1":0 [ENABLED]

- entity 4: vi-output, 15a00000.nvcsi--1 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "15a00000.nvcsi--1":1 [ENABLED]

What are the possible causes of the above problems?

2.The following error was produced when I wanted to capture the image:

crrc@crrc-desktop:~$ gst-launch-1.0 v4l2src ! 'video/x-bayer, format=rggb, width=1920, height=1080, framerate=30/1' ! multifilesink location=image.raww
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Is there a problem with my device tree configuration?

Here are my dtsi files. I’ve reserved a dual-camera configuration, but I’m currently only using one camera module.
tegra194-p2888-0000-camera-imx390-a00.dtsi

i2c@3180000 {
        max9296_dser: max9296@28 {
	        compatible = "nvidia,max9296";
	        reg = <0x28>;
	        csi-mode = "2x4";
	        max-src = <2>;
	        reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
        };
	max9295_prim: max9295_prim@40 {
		compatible = "nvidia,max9295";
		reg = <0x40>;
		is-prim-ser;
	};
	max9295_ser0: max9295_1a@42 {
		compatible = "nvidia,max9295";
		reg = <0x42>;
		nvidia,gmsl-dser-device = <&max9296_dser>;
	};
	imx390_1a@22 {
		def-addr = <0x21>;
		clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>,
				<&bpmp_clks TEGRA194_CLK_EXTPERIPH1>;
		clock-names = "extperiph1", "pllp_grtba";
		mclk = "extperiph1";
		nvidia,gmsl-ser-device = <&max9295_ser0>;
		nvidia,gmsl-dser-device = <&max9296_dser>;
	};
}

tegra194-camera-imx390-a00.dtsi

host1x {
		vi@15c10000 {
			num-channels = <2>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_vi_in0: endpoint {
						vc-id = <0>;
						port-index = <0>;
						bus-width = <4>;//<2>;
						remote-endpoint = <&imx390_csi_out0>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_vi_in1: endpoint {
						vc-id = <1>;
						port-index = <0>;
						bus-width = <2>;
						remote-endpoint = <&imx390_csi_out1>;
					};
				};
			};
		};

		nvcsi@15a00000 {
			num-channels = <2>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx390_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <4>;//<2>;
							remote-endpoint = <&imx390_imx390_out0>;
						};
					};
					port@1 {
						reg = <1>;
						imx390_csi_out0: endpoint@1 {
							remote-endpoint = <&imx390_vi_in0>;
						};
					};
				};
			};
			channel@1 {
				reg = <1>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx390_csi_in1: endpoint@2 {
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&imx390_imx390_out1>;
						};
					};
					port@1 {
						reg = <1>;
						imx390_csi_out1: endpoint@3 {
							remote-endpoint = <&imx390_vi_in1>;
						};
					};
				};
			};
		};
	};
i2c@3180000 {
			imx390_1a@22 {
				compatible = "nvidia,imx390";
				reg = <0x22>;
				devnode = "video0";
				physical_w = "15.0";
				physical_h = "12.5";
				sensor_model ="imx390";
				use_sensor_mode_id = "true";
				post_crop_frame_drop = "0";
				use_decibel_gain = "true";
				mode0 {/*mode IMX390_MODE_1920X1080_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 = "1920";
					active_h = "1080";
					readout_orientation = "0";
					line_length = "2200";
					inherent_gain = "1";
					pix_clk_hz = "74250000";
					serdes_pix_clk_hz = "320000000";//"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";
				};
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx390_imx390_out0: endpoint {
							vc-id = <0>;
							port-index = <0>;
							bus-width = <4>;
							remote-endpoint = <&imx390_csi_in0>;
						};
					};
				};
				gmsl-link {
					src-csi-port = "b";
					dst-csi-port = "a";
					serdes-csi-link = "a";
					csi-mode = "2x4";
					st-vc = <0>;
					vc-id = <0>;
					num-lanes = <4>;
					streams = "ued-u1", "raw12";
				};
			};
tegra-camera-platform {
		num_csi_lanes = <4>;
		max_lane_speed = <1500000>;//<4000000>;
		min_bits_per_pixel = <10>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;
		modules {
			module0 {
				badge = "imx390_rear";
				position = "rear";
				orientation = "1";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx390 2-0022";
					proc-device-tree = "/proc/device-tree/i2c@3180000/imx390_1a@22";
				};
			};
		};
	};

tegra194-p2822-camera-modules.dtsi

host1x {
		vi_base: vi@15c10000 {
			ports {
				vi_port0: port@0 {
					status = "okay";
					vi_in0: endpoint {
						vc-id = <0>;
						status = "okay";
					};
				};
				vi_port1: port@1 {
					status = "okay";
					vi_in1: endpoint {
						vc-id = <1>;//<0>;
						status = "oaky";
					};
				};
				vi_port2: port@2 {
					status = "disabled";
					vi_in2: endpoint {
						vc-id = <2>;//<0>;
						status = "disabled";
					};
				};
				vi_port3: port@3 {
					status = "disabled";
					vi_in3: endpoint {
						vc-id = <3>;//<0>;
						status = "disabled";
					};
				};
				vi_port4: port@4 {
					status = "disabled";
					vi_in4: endpoint {
						vc-id = <4>;//<0>;
						status = "disabled";
					};
				};
				vi_port5: port@5 {
					status = "disabled";
					vi_in5: endpoint {
						vc-id = <5>;//<0>;
						status = "disabled";
					};
				};
			};
		};
		csi_base: nvcsi@15a00000 {
			num-tpg-channels = <36>;
			csi_chan0: channel@0 {
				status = "okay";
				ports {
					csi_chan0_port0: port@0 {
						status = "okay";
						csi_in0: endpoint@0 {
							status = "okay";
						};
					};
					csi_chan0_port1: port@1 {
						status = "okay";
						csi_out0: endpoint@1 {
							status = "okay";
						};
					};
				};
			};
			csi_chan1: channel@1 {
				status = "okay";
				ports {
					csi_chan1_port0: port@0 {
						status = "okay";
						csi_in1: endpoint@2 {
							status = "okay";
						};
					};
					csi_chan1_port1: port@1 {
						status = "okay";
						csi_out1: endpoint@3 {
							status = "okay";
						};
					};
				};
			};
			csi_chan2: channel@2 {
				status = "disabled";
				ports {
					csi_chan2_port0: port@0 {
						status = "disabled";
						csi_in2: endpoint@4 {
							status = "disabled";
						};
					};
					csi_chan2_port1: port@1 {
						status = "disabled";
						csi_out2: endpoint@5 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan3: channel@3 {
				status = "disabled";
				ports {
					csi_chan3_port0: port@0 {
						status = "disabled";
						csi_in3: endpoint@6 {
							status = "disabled";
						};
					};
					csi_chan3_port1: port@1 {
						status = "disabled";
						csi_out3: endpoint@7 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan4: channel@4 {
				status = "disabled";
				ports {
					csi_chan4_port0: port@0 {
						status = "disabled";
						csi_in4: endpoint@8 {
							status = "disabled";
						};
					};
					csi_chan4_port1: port@1 {
						status = "disabled";
						csi_out4: endpoint@9 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan5: channel@5 {
				status = "disabled";
				ports {
					csi_chan5_port0: port@0 {
						status = "disabled";
						csi_in5: endpoint@10 {
							status = "disabled";
						};
					};
					csi_chan5_port1: port@1 {
						status = "disabled";
						csi_out5: endpoint@11 {
							status = "disabled";
						};
					};
				};
			};
		};

		slvs_ec_base: slvs-ec@15ac0000 {
			status = "okay";
			streams {
				slvs_ec_stream0: stream@0 {
					status = "okay";
					ports {
						slvs_ec_stream0_port0: port@0 {
							status = "okay";
							e3377_slvs_ec_in0: endpoint@0 {
								status = "okay";
							};
						};
						slvs_ec_stream0_port1: port@1 {
							status = "okay";
							e3377_slvs_ec_out0: endpoint@1 {
								status = "okay";
							};
						};
					};
				};
			};
		};
	};
i2c@3180000 {
		max9296_dser: max9296@28 {
			status = "okay";
		};
		max9295_prim: max9295_prim@40 {
			status = "okay";
		};
		max9295_ser0: max9295_1a@42 {
			status = "okay";
		};
		imx390_cam0: imx390_1a@22 {
			status = "okay";
		};
}
tcp: tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		modules {
			cam_module0: module0 {
				status = "okay";
				cam_module0_drivernode0: drivernode0 {
					status = "okay";
				};
				cam_module0_drivernode1: drivernode1 {
					status = "okay";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module1: module1 {
				status = "disabled";
				cam_module1_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module1_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
}

tegra194-p2822-0000-camera-imx390-a00.txt (5.5 KB)
tegra194-p2822-camera-modules.txt (8.5 KB)
tegra194-camera-imx390-a00.txt (8.8 KB)

I am very much in need of help and look forward to any reply or suggestion.
Thanks ALL.

I don’t think v4l2src would working for bayer sensors.
Please check by v4l2-ctl.

v4l2-ctl --set-fmt-video=width=1920,height=1080 --set-ctrl bypass_mode=0 --stream-mmap

Hello, ShaneCCC,
I tried but it didn’t work

crrc@crrc-desktop:~$ v4l2-ctl --set-fmt-video=width=1920,height=1080 --set-ctrl bypass_mode=0 --stream-mmap                                      VIDIOC_S_FMT: failed: Inappropriate ioctl for device

Could this be because of a misconfiguration, the same as the first issue I said?
And I also tried this and get same results.

Get the trace log to check if receive any data from sensor.

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

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