The two cameras have the same image

Hi
I used two OV5693 cameras attached to the CSI_C and CSI_E interfaces.After modifying the DT, the system can find video0 and video1, but when shown with nvgstcapture --cap-dev-node 0 and nvgstcapture --cap-dev-node 1, the images of the two cameras are the same
Thanks

images is voide0

hello ben_blake,

could you please try to access camera sensor with nvcamerasrc, specify the sensor id into the pipeline.
for example,

$ gst-launch-1.0 nvcamerasrc sensor-id=X ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvoverlaysink -ev

Hi Jerry Chang
This one I’ve tried,is the same

Could it be a DT problem?
tegra186-camera-e3326-a00.dtsi

/*
 * Copyright (c) 2015-2017, NVIDIA CORPORATION.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/ {
	host1x {
		vi@15700000 {
			num-channels = <2>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					e3326_vi_in0: endpoint {
						csi-port = <2>;
						bus-width = <2>;
						remote-endpoint = <&e3326_csi_out0>;
					};
				};
				port@1 {
					reg = <1>;
					e3326_vi_in1: endpoint {
						csi-port = <4>;
						bus-width = <2>;
						remote-endpoint = <&e3326_csi_out1>;
					};
				};
			};
		};

		nvcsi@150c0000 {
			num-channels = <2>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						e3326_csi_in0: endpoint@0 {
							csi-port = <2>;
							bus-width = <2>;
							remote-endpoint = <&e3326_ov5693_out0>;
						};
					};
					port@1 {
						reg = <1>;
						e3326_csi_out0: endpoint@1 {
							remote-endpoint = <&e3326_vi_in0>;
						};
					};
				};
			};
			channel@1 {
				reg = <1>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						e3326_csi_in1: endpoint@2 {
							csi-port = <4>;
							bus-width = <2>;
							remote-endpoint = <&e3326_ov5693_out1>;
						};
					};
					port@1 {
						reg = <1>;
						e3326_csi_out1: endpoint@3 {
							remote-endpoint = <&e3326_vi_in1>;
						};
					};
				};
			};
		};
	};

	i2c@3180000 {
		ov5693_c@10 {
			compatible = "nvidia,ov5693";
			/* I2C device address */
			reg = <0x10>;

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

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

			/* Define any required hw resources needed by driver */
			/* ie. clocks, io pins, power sources */
			avdd-reg = "vana";
			iovdd-reg = "vif";

			/* Sensor output flip settings */
			vertical-flip = "true";

			mode0 { // OV5693_MODE_2592X1944
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "2592";
				active_h = "1944";
				pixel_t = "bayer_bggr";
				readout_orientation = "90";
				line_length = "2688";
				inherent_gain = "1";
				mclk_multiplier = "6.67";
				pix_clk_hz = "160000000";

				min_gain_val = "1.0";
				max_gain_val = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.816577";
				max_framerate = "30";
				min_exp_time = "34";
				max_exp_time = "550385";
			};

			mode1 { //OV5693_MODE_2592X1458
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "2592";
				active_h = "1458";
				pixel_t = "bayer_bggr";
				readout_orientation = "90";
				line_length = "2688";
				inherent_gain = "1";
				mclk_multiplier = "6.67";
				pix_clk_hz = "160000000";

				min_gain_val = "1.0";
				max_gain_val = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.816577";
				max_framerate = "30";
				min_exp_time = "34";
				max_exp_time = "550385";
			};

			mode2 { //OV5693_MODE_1280X720
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "1280";
				active_h = "720";
				pixel_t = "bayer_bggr";
				readout_orientation = "90";
				line_length = "1752";
				inherent_gain = "1";
				mclk_multiplier = "6.67";
				pix_clk_hz = "160000000";

				min_gain_val = "1.0";
				max_gain_val = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "2.787078";
				max_framerate = "120";
				min_exp_time = "22";
				max_exp_time = "358733";
			};

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

				port@0 {
					reg = <0>;
					e3326_ov5693_out0: endpoint {
						csi-port = <2>;
						bus-width = <2>;
						remote-endpoint = <&e3326_csi_in0>;
					};
				};
			};
		};
	};

	i2c@31c0000 {
		ov5693_e@10 {
			compatible = "nvidia,ov5693";
			/* I2C device address */
			reg = <0x10>;

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

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

			/* Define any required hw resources needed by driver */
			/* ie. clocks, io pins, power sources */
			avdd-reg = "vana";
			iovdd-reg = "vif";

			/* Sensor output flip settings */
			vertical-flip = "true";

			mode0 { // OV5693_MODE_2592X1944
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_e";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "2592";
				active_h = "1944";
				pixel_t = "bayer_bggr";
				readout_orientation = "90";
				line_length = "2688";
				inherent_gain = "1";
				mclk_multiplier = "6.67";
				pix_clk_hz = "160000000";

				min_gain_val = "1.0";
				max_gain_val = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.816577";
				max_framerate = "30";
				min_exp_time = "34";
				max_exp_time = "550385";
			};

			mode1 { //OV5693_MODE_2592X1458
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_e";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "2592";
				active_h = "1458";
				pixel_t = "bayer_bggr";
				readout_orientation = "90";
				line_length = "2688";
				inherent_gain = "1";
				mclk_multiplier = "6.67";
				pix_clk_hz = "160000000";

				min_gain_val = "1.0";
				max_gain_val = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.816577";
				max_framerate = "30";
				min_exp_time = "34";
				max_exp_time = "550385";
			};

			mode2 { //OV5693_MODE_1280X720
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_e";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "1280";
				active_h = "720";
				pixel_t = "bayer_bggr";
				readout_orientation = "90";
				line_length = "1752";
				inherent_gain = "1";
				mclk_multiplier = "6.67";
				pix_clk_hz = "160000000";

				min_gain_val = "1.0";
				max_gain_val = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "2.787078";
				max_framerate = "120";
				min_exp_time = "22";
				max_exp_time = "358733";
			};

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

				port@0 {
					reg = <0>;
					e3326_ov5693_out1: endpoint {
						csi-port = <4>;
						bus-width = <2>;
						remote-endpoint = <&e3326_csi_in1>;
					};
				};
			};
		};
	};

	e3326_lens_ov5693@P5V27C {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "2.67";
		f_number = "2.0";
		aperture = "2.0";
	};

	tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		/**
		* Physical settings to calculate max ISO BW
		*
		* num_csi_lanes = <>;
		* Total number of CSI lanes when all cameras are active
		*
		* max_lane_speed = <>;
		* Max lane speed in Kbit/s
		*
		* min_bits_per_pixel = <>;
		* Min bits per pixel
		*
		* vi_peak_byte_per_pixel = <>;
		* Max byte per pixel for the VI ISO case
		*
		* vi_bw_margin_pct = <>;
		* Vi bandwidth margin in percentage
		*
		* max_pixel_rate = <>;
		* Max pixel rate in Kpixel/s for the ISP ISO case
		*
		* isp_peak_byte_per_pixel = <>;
		* Max byte per pixel for the ISP ISO case
		*
		* isp_bw_margin_pct = <>;
		* Isp bandwidth margin in percentage
		*/
		num_csi_lanes = <4>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <160000>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;

		/**
		* The general guideline for naming badge_info contains 3 parts, and is as follows,
		* The first part is the camera_board_id for the module; if the module is in a FFD
		* platform, then use the platform name for this part.
		* The second part contains the position of the module, ex. “rear” or “front”.
		* The third part contains the last 6 characters of a part number which is found
		* in the module's specsheet from the vender.
		*/
		modules {
			module0 {
				badge = "e3326_rear_P5V27C";
				position = "rear";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ov5693 2-0010";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ov5693_c@10";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_ov5693@P5V27C/";
				};
			};
			module1 {
				badge = "e3326_front_P5V27C";
				position = "front";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ov5693 6-0010";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@31c0000/ov5693_e@10";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_ov5693@P5V27C/";
				};
			};
		};
	};
};

tegra186-quill-camera-plugin-manager.dtsi

fragment-e3326@0 {
			//ids = "3326-*";
			ids = ">=3310-1000-800";

			/* VI number of channels */
			override@0 {
				target = <&vi_base>;
				_overlay_ {
					num-channels=<2>;
				};
			};

			/* CSI number of channels */
			override@1 {
				target = <&csi_base>;
				_overlay_ {
					num-channels=<2>;
				};
			};
			/* tegra-camera-platform settings */
			override@2 {
				target = <&tcp>;
				_overlay_ {
					num_csi_lanes = <4>;
					max_lane_speed = <1500000>;
					min_bits_per_pixel = <10>;
					vi_peak_byte_per_pixel = <2>;
					vi_bw_margin_pct = <25>;
					//max_pixel_rate = <200000>;
					isp_peak_byte_per_pixel = <5>;
					isp_bw_margin_pct = <25>;
				};
			};
			/* Camera 0: Module */
			override@3 {
				target = <&e3326_cam0>;
				_overlay_ {
					status = "okay";
				};
			};
			override@4 {
				target = <&cam_module0>;
				_overlay_ {
					status = "okay";
					badge = "e3326_rear_P5V27C";
					position = "rear";
					orientation = "1";
				};
			};
			override@5 {
				target = <&cam_module0_drivernode0>;
				_overlay_ {
					status = "okay";
					pcl_id = "v4l2_sensor";
					devname = "ov5693 2-0010";
					proc-device-tree = "/proc/device-tree/i2c@3180000/ov5693_c@10";
				};
			};
			override@6 {
				target = <&cam_module0_drivernode1>;
				_overlay_ {
					status = "okay";
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_ov5693@P5V27C/";
				};
			};
			/* Camera 0: VI */
			override@7 {
				target = <&vi_port0>;
				_overlay_ {
					status = "okay";
				};
			};
			override@8 {
				target = <&e3326_vi_in0>;
				_overlay_ {
					status = "okay";
					csi-port = <2>;
					bus-width = <2>;
					remote-endpoint = <&e3326_csi_out0>;
				};
			};
			/* Camera 0: CSI */
			override@9 {
				target = <&csi_chan0>;
				_overlay_ {
					status = "okay";
				};
			};
			override@10 {
				target = <&csi_chan0_port0>;
				_overlay_ {
					status = "okay";
				};
			};
			override@11 {
				target = <&e3326_csi_in0>;
				_overlay_ {
					status = "okay";
					csi-port = <2>;
					bus-width = <2>;
					remote-endpoint = <&e3326_ov5693_out0>;
				};
			};
			override@12 {
				target = <&csi_chan0_port1>;
				_overlay_ {
					status = "okay";
				};
			};
			override@13 {
				target = <&e3326_csi_out0>;
				_overlay_ {
					status = "okay";
					remote-endpoint = <&e3326_vi_in0>;
				};
			};
			/* Camera 1: Module */
			override@14 {
				target = <&e3326_cam1>;
				_overlay_ {
					status = "okay";
				};
			};
			override@15 {
				target = <&cam_module1>;
				_overlay_ {
					status = "okay";
					badge = "e3326_front_P5V27C";
					position = "front";
					orientation = "1";
				};
			};
			override@16 {
				target = <&cam_module1_drivernode0>;
				_overlay_ {
					status = "okay";
					pcl_id = "v4l2_sensor";
					devname = "ov5693 6-0010";
					proc-device-tree = "/proc/device-tree/i2c@31c0000/ov5693_e@10";
				};
			};
			override@17 {
				target = <&cam_module1_drivernode1>;
				_overlay_ {
					status = "okay";
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_ov5693@P5V27C/";
				};
			};
			/* Camera 1: VI */
			override@18 {
				target = <&vi_port1>;
				_overlay_ {
					status = "okay";
				};
			};
			override@19 {
				target = <&e3326_vi_in1>;
				_overlay_ {
					status = "okay";
					csi-port = <4>;
					bus-width = <2>;
					remote-endpoint = <&e3326_csi_out1>;
				};
			};
			/* Camera 1: CSI */
			override@20 {
				target = <&csi_chan1>;
				_overlay_ {
					status = "okay";
				};
			};
			override@21 {
				target = <&csi_chan1_port0>;
				_overlay_ {
					status = "okay";
				};
			};
			override@22 {
				target = <&e3326_csi_in1>;
				_overlay_ {
					status = "okay";
					csi-port = <4>;
					bus-width = <2>;
					remote-endpoint = <&e3326_ov5693_out1>;
				};
			};
			override@23 {
				target = <&csi_chan1_port1>;
				_overlay_ {
					status = "okay";
				};
			};
			override@24 {
				target = <&e3326_csi_out1>;
				_overlay_ {
					status = "okay";
					remote-endpoint = <&e3326_vi_in1>;
				};
			};
			override@25 {
				target = <&{/gpio@2200000}>;
				_overlay_ {
					camera-control-input {
						status = "disabled";
					};
					camera-control-output-low {
						gpio-hog;
//						gpios = <CAM0_RST_L 0 CAM0_PWDN 0>;
//						label = "cam0-rst", "cam0-pwdn";
						gpios = <CAM0_RST_L 0 CAM0_PWDN 0
							 CAM1_RST_L 0 CAM1_PWDN 0>;
						label = "cam0-rst", "cam0-pwdn",
							"cam1-rst", "cam1-pwdn";
						output-low;
						status = "okay";
					};
					camera-control-output-high {
						status = "disabled";
					};
				};
			};
			override@26 {
				target = <&{/gpio@c2f0000}>;
				_overlay_ {
					camera-control-input {
						status = "disabled";
					};
				};
			};
		};

hello ben_blake,

looks both of your camera sensor connected to 0x10, do you have i2c mux device?
please refer to below device tree as example, thanks

sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-modules/tegra186-camera-e3333-a00.dtsi

Hi Jerry Chang

Instead of using i2c mux, I use a different i2c interface, and my camera address is 0x10.
I refer to this file,only i2c is different and everything else is the same
Thanks

Who can help me check if this is caused by the problem of DT?
THANKS

hello ben_blake,

please try to access camera sensor with v4l2 standard controls instead,
for example,

v4l2-ctl -d /dev/video0 --set-fmt-video=width=2592,height=1944,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=10 --stream-to=test.raw

please check the raw files by 3rdparty viewing tools, such as 7yuv.
thanks

$ sudo media-ctl -p
Media controller API version 0.1.0

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

Device topology
- entity 1: 150c0000.nvcsi-4 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		<- "ov5693 6-0010":0 [ENABLED]
	pad1: Source
		-> "vi-output, ov5693 6-0010":0 [ENABLED]

- entity 2: 150c0000.nvcsi-2 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	pad0: Sink
		<- "ov5693 2-0010":0 [ENABLED]
	pad1: Source
		-> "vi-output, ov5693 2-0010":0 [ENABLED]

- entity 3: ov5693 6-0010 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev2
	pad0: Source
		[fmt:SRGGB10/2592x1944 field:none]
		-> "150c0000.nvcsi-4":0 [ENABLED]

- entity 4: ov5693 2-0010 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev3
	pad0: Source
		[fmt:SRGGB10/2592x1458 field:none]
		-> "150c0000.nvcsi-2":0 [ENABLED]

- entity 5: vi-output, ov5693 2-0010 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "150c0000.nvcsi-2":1 [ENABLED]

- entity 6: vi-output, ov5693 6-0010 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video1
	pad0: Sink
		<- "150c0000.nvcsi-4":1 [ENABLED]

hello ben_blake,

  1. had you check the raw files dumped by v4l2 standard controls?
  2. please measure the signals of camera sensor boards while using commands to access camera-0 and camera-1,
    thanks