Some final problems with my Auvidea J20 / Raspberry pi IMX219 driver. (TX2 / 28.2)

Drivers almost ready, but i still have some final problems i really would love some help with:
Only 2 video sources enabled for now, but i guess the rest will work after this last bug is fixed.

Both this lines captures a nice picture from both video sources:

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=t0.raw --verbose

v4l2-ctl -d /dev/video1 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=t0.raw --verbose

This line captures crisp and clear video:

DISPLAY=:0 gst-launch-1.0 nvcamerasrc sensor-id=0 contrast=1 wbmode=3 saturation=1 fpsRange=“30 30” ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1’ ! nvegltransform ! nveglglessink

But doing the same from sensor-id=1 crashes and dumps the core:

DISPLAY=:0 gst-launch-1.0 nvcamerasrc sensor-id=1 contrast=1 wbmode=3 saturation=1 fpsRange=“30 30” ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1’ ! nvegltransform ! nveglglessink

Setting pipeline to PAUSED …

Using winsys: x11
Socket read error. Camera Daemon stopped functioning…
gst_nvcamera_open() failed ret=0
ERROR: Pipeline doesn’t want to pause.
Got context from element ‘eglglessink0’: gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
ERROR: from element /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Additional debug info:
gstbasesrc.c(3354): gst_base_src_start (): /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0:
Failed to start
Setting pipeline to NULL …
Caught SIGSEGV
#0 0x0000007fae508130 in pthread_join (threadid=548329710080,
#1 0x0000007fae5beeb0 in ?? () from /lib/aarch64-linux-gnu/libglib-2.0.so.0
#2 0x0000000000000011 in ?? ()
Spinning. Please run ‘gdb gst-launch-1.0 2057’ to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

So why does this happen when v4l2-ctl works on both sources ?

Another thing is that CSI-A and CSI-B / video0 and video1 i swapped, port 4 of the J20 (CSI-B) is video0, this is wrong…

What parts of the dtsi does v4l2-ctl use, and what part does gstreamer / nccamera use ? really cant find any fault in the dtsi, have included it so maybe someone could have a look ?

I get a lot of emails / messages about the driver this day’s, the thing is that i have received a lot of support from the nice people at Ridgerun ( @DavidSoto and Co… ), so the source files will be sent to them when it’s finished, you can probably ask them nicely for a copy afterwards :)

here is my dtsi:

/*
 * Copyright (c) 2015-2016, 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/>.
 */

#include "dt-bindings/clock/tegra186-clock.h"

/* camera control gpio definitions */
#define CAM0_RST_L	TEGRA_MAIN_GPIO(R, 5)
#define CAM0_PWDN	TEGRA_MAIN_GPIO(R, 0)
#define CAM1_RST_L	TEGRA_MAIN_GPIO(R, 1)
#define CAM1_PWDN	TEGRA_MAIN_GPIO(L, 6)
// #define CAM2_RST_L	TEGRA_MAIN_GPIO(R, 1)
// #define CAM2_PWDN	TEGRA_MAIN_GPIO(R, 0)

/ {
	host1x {
		vi@15700000 {
			num-channels = <6>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					status = "okay";
					e3326_imx219_a_vi_in0: endpoint {
						csi-port = <0>;
						bus-width = <2>;
						remote-endpoint = <&e3326_imx219_a_csi_out0>;
						status = "okay";
					};
				};
				port@1 {
					reg = <1>;
					status = "okay";
					e3326_imx219_b_vi_in0: endpoint {
						csi-port = <1>;
						bus-width = <2>;
						remote-endpoint = <&e3326_imx219_b_csi_out0>;
						status = "okay";
					};
				};
				port@2 {
					reg = <2>;
					status = "disabled";
					e3326_imx219_c_vi_in0: endpoint {
						csi-port = <2>;
						bus-width = <2>;
						remote-endpoint = <&e3326_imx219_c_csi_out0>;
						status = "disabled";
					};
				};
				port@3 {
					reg = <3>;
					status = "disabled";
					e3326_imx219_d_vi_in0: endpoint {
						csi-port = <3>;
						bus-width = <2>;
						remote-endpoint = <&e3326_imx219_d_csi_out0>;
						status = "disabled";
					};
				};
				port@4 {
					reg = <4>;
					status = "disabled";
					e3326_imx219_e_vi_in0: endpoint {
						csi-port = <4>;
						bus-width = <2>;
						remote-endpoint = <&e3326_imx219_e_csi_out0>;
						status = "disabled";
					};
				};
				port@5 {
					reg = <5>;
					status = "disabled";
					e3326_imx219_f_vi_in0: endpoint {
						csi-port = <5>;
						bus-width = <2>;
						remote-endpoint = <&e3326_imx219_f_csi_out0>;
						status = "disabled";
					};
				};
			};
		};

		nvcsi@150c0000 {
			num-channels = <6>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					status = "okay";
					port@0 {
						reg = <0>;
						e3326_imx219_a_csi_in0: endpoint@0 {
							csi-port = <0>;
							bus-width = <2>;
							status = "okay";
							remote-endpoint = <&e3326_imx219_a_out>;
						};
					};
					port@1 {
						reg = <1>;
						e3326_imx219_a_csi_out0: endpoint@1 {
						status = "okay";
						remote-endpoint = <&e3326_imx219_a_vi_in0>;
						};
					};
				};
			};
			channel@1 {
				reg = <1>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					status = "okay";
					port@0 {
						reg = <0>;
						e3326_imx219_b_csi_in0: endpoint@0 {
							csi-port = <1>;
							bus-width = <2>;
							status = "okay";
							remote-endpoint = <&e3326_imx219_b_out>;
						};
					};
					port@1 {
						reg = <1>;
						e3326_imx219_b_csi_out0: endpoint@1 {
						status = "okay";
						remote-endpoint = <&e3326_imx219_b_vi_in0>;
						};
					};
				};
			};
			channel@2 {
				reg = <2>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					status = "disabled";
					port@0 {
						reg = <0>;
						e3326_imx219_c_csi_in0: endpoint@0 {
							csi-port = <2>;
							bus-width = <2>;
							status = "disabled";
							remote-endpoint = <&e3326_imx219_c_out>;
						};
					};
					port@1 {
						reg = <1>;
						e3326_imx219_c_csi_out0: endpoint@1 {
						status = "disabled";
						remote-endpoint = <&e3326_imx219_c_vi_in0>;
						};
					};
				};
			};
			channel@3 {
				reg = <3>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					status = "disabled";
					port@0 {
						reg = <0>;
						e3326_imx219_d_csi_in0: endpoint@0 {
							csi-port = <3>;
							bus-width = <2>;
							status = "disabled";
							remote-endpoint = <&e3326_imx219_d_out>;
						};
					};
					port@1 {
						reg = <1>;
						e3326_imx219_d_csi_out0: endpoint@1 {
						status = "disabled";
						remote-endpoint = <&e3326_imx219_d_vi_in0>;
						};
					};
				};
			};
			channel@4 {
				reg = <4>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					status = "disabled";
					port@0 {
						reg = <0>;
						e3326_imx219_e_csi_in0: endpoint@0 {
							csi-port = <4>;
							bus-width = <2>;
							status = "disabled";
							remote-endpoint = <&e3326_imx219_e_out>;
						};
					};
					port@1 {
						reg = <1>;
						e3326_imx219_e_csi_out0: endpoint@1 {
						status = "disabled";
						remote-endpoint = <&e3326_imx219_e_vi_in0>;
						};
					};
				};
			};
			channel@5 {
				reg = <5>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					status = "disabled";
					port@0 {
						reg = <0>;
						e3326_imx219_f_csi_in0: endpoint@0 {
              				csi-port = <5>;
							bus-width = <2>;
							status = "disabled";
							remote-endpoint = <&e3326_imx219_f_out>;
						};
					};
					port@1 {
						reg = <1>;
						e3326_imx219_f_csi_out0: endpoint@1 {
						status = "disabled";
						remote-endpoint = <&e3326_imx219_f_vi_in0>;
						};
					};
				};
			};
		};
	};

  i2c@c240000 {
		imx219_a@10 {
			status = "okay";

			devnode = "video0";
			compatible = "nvidia,imx219";
			reg = <0x10>;

			clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH2>,
					 <&tegra_car TEGRA186_CLK_PLLP_OUT0>;
			clock-names = "extperiph2","pllp_grtba";
			mclk = "extperiph2";
			clock-frequency = <24000000>;
			reset-gpios = <&tegra_main_gpio CAM1_RST_L GPIO_ACTIVE_HIGH>;
			//pwdn-gpios = <&tegra_main_gpio CAM_PWDN GPIO_ACTIVE_HIGH>;

			refclk_hz = <27000000>;
			physical_w = "5.095";
			physical_h = "4.930";

			sensor_model ="imx219";
			

     mode0 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_a";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "3280";
				active_h = "2464";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3446";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "21";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode1 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_a";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode2 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_a";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1640";
				active_h = "1232";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode3 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_a";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1280";
				active_h = "720";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3560";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode4 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_a";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "820";
				active_h = "616";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
      };
			ports {
				#address-cells = <1>;
				#size-cells = <0>;

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

		imx219_b@12 {
			status = "okay";

			devnode = "video1";
			compatible = "nvidia,imx219";
			reg = <0x12>;

			clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH2>,
					 <&tegra_car TEGRA186_CLK_PLLP_OUT0>;
			clock-names = "extperiph2","pllp_grtba";
			mclk = "extperiph2";
			clock-frequency = <24000000>;
			reset-gpios = <&tegra_main_gpio CAM1_RST_L GPIO_ACTIVE_HIGH>;
			//pwdn-gpios = <&tegra_main_gpio CAM_PWDN GPIO_ACTIVE_HIGH>;

			refclk_hz = <27000000>;
			physical_w = "5.095";
			physical_h = "4.930";

			sensor_model ="imx219";

      mode0 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_b";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "3280";
				active_h = "2464";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3446";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "21";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";

			};
			mode1 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_b";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode2 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_b";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1640";
				active_h = "1232";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode3 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_b";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1280";
				active_h = "720";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3560";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode4 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_b";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "820";
				active_h = "616";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
      };
			ports {
				#address-cells = <1>;
				#size-cells = <0>;

				port@0 {
					reg = <0>;
					e3326_imx219_b_out: endpoint {
						csi-port = <1>;
						bus-width = <2>;
						remote-endpoint = <&e3326_imx219_b_csi_in0>;
					};
				};
			};
		};
	};

  i2c@3180000 {	
		imx219_c@10 {
			status = "disable";

			devnode = "video2";
			compatible = "nvidia,imx219";
			reg = <0x10>;

			clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>;
			clock-names = "extperiph1";
			mclk = "extperiph1";
			reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;

			physical_w = "5.095";
			physical_h = "4.930";

			sensor_model ="imx219";

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

				active_w = "3280";
				active_h = "2464";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3446";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "21";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";

			};
			mode1 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode2 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1640";
				active_h = "1232";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode3 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1280";
				active_h = "720";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3560";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode4 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "820";
				active_h = "616";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
      };
			ports {
				#address-cells = <1>;
				#size-cells = <0>;

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

		imx219_d@12 {
			status = "disable";

			devnode = "video3";
			compatible = "nvidia,imx219";
			reg = <0x12>;

			clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>;
			clock-names = "extperiph1";
			mclk = "extperiph1";
			reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;

			physical_w = "5.095";
			physical_h = "4.930";

			sensor_model ="imx219";

      mode0 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_d";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "3280";
				active_h = "2464";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3446";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "21";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";

			};
			mode1 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_d";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode2 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_d";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1640";
				active_h = "1232";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode3 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_d";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1280";
				active_h = "720";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3560";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode4 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_d";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "820";
				active_h = "616";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
      };
			ports {
				#address-cells = <1>;
				#size-cells = <0>;

				port@0 {
					reg = <0>;
					e3326_imx219_d_out: endpoint {
						csi-port = <3>;
						bus-width = <2>;
						remote-endpoint = <&e3326_imx219_d_csi_in0>;
					};
				};
			};
		};
	};

  i2c@c250000 {
		imx219_e@10 {
			status = "disabled";

			devnode = "video4";
			compatible = "nvidia,imx219";
			reg = <0x10>;

			clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH3>;
			clock-names = "extperiph3";
			mclk = "extperiph3";
			reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;

			physical_w = "5.095";
			physical_h = "4.930";

			sensor_model ="imx219";

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

				active_w = "3280";
				active_h = "2464";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3446";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "21";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";

			};
			mode1 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_e";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode2 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_e";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1640";
				active_h = "1232";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode3 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_e";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1280";
				active_h = "720";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3560";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode4 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_e";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "820";
				active_h = "616";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
      };
			ports {
				#address-cells = <1>;
				#size-cells = <0>;

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

		imx219_f@12 {
			status = "disabled";

			devnode = "video5";
			compatible = "nvidia,imx219";
			reg = <0x12>;

			clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH3>;
			clock-names = "extperiph3";
			mclk = "extperiph3";
			reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;

			physical_w = "5.095";
			physical_h = "4.930";

			sensor_model ="imx219";

      mode0 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_f";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "3280";
				active_h = "2464";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3446";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "21";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";

			};
			mode1 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_f";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode2 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_f";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1640";
				active_h = "1232";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode3 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_f";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "1280";
				active_h = "720";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3560";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
			};
			mode4 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_f";
				discontinuous_clk = "yes";
				cil_settletime = "0";

				active_w = "820";
				active_h = "616";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "25";
				pix_clk_hz = "170000000";

				min_gain_val = "1.0";
				max_gain_val = "16.0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "64";
				min_framerate = "1.462526";
				max_framerate = "30";
				min_exp_time = "13";
				max_exp_time = "683709";
				embedded_metadata_height = "2";
      };
			ports {
				#address-cells = <1>;
				#size-cells = <0>;

				port@0 {
					reg = <0>;
					e3326_imx219_f_out: endpoint {
						csi-port = <5>;
						bus-width = <2>;
						remote-endpoint = <&e3326_imx219_f_csi_in0>;
					};
				};
			};
		};
	};

  e3326_lens_imx219_a@P5V27C {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "2.67";
		f_number = "2.0";
		aperture = "2.0";
	};
		e3326_lens_imx219_b@P5V27C {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "2.67";
		f_number = "2.0";
		aperture = "2.0";
	};
		e3326_lens_imx219_c@P5V27C {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "2.67";
		f_number = "2.0";
		aperture = "2.0";
	};
		e3326_lens_imx219_d@P5V27C {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "2.67";
		f_number = "2.0";
		aperture = "2.0";
	};
		e3326_lens_imx219_e@P5V27C {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "2.67";
		f_number = "2.0";
		aperture = "2.0";
	};
		e3326_lens_imx219_f@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";

		num_csi_lanes = <12>;
		max_lane_speed = <1500000>;
		max_pixel_rate = <7500000>;
		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 = "e3322_bottomleft_A819P2";	// A815P2 ?? e3323_top_CH06P1 
				position = "bottomleft";
				orientation = "1";
				status = "okay";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "imx219 0-0010";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@c240000/imx219_a@10";			
					status = "okay";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_imx219_a@P5V27C/";
					status = "okay";
				};
			};
			module1 {
				badge = "e3322_centerleft_A819P2";
				position = "centerleft";
				orientation = "1";
				status = "okay";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 1-0012";
					proc-device-tree = "/proc/device-tree/i2c@c240000/imx219_b@12";
					status = "okay";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_imx219_b@P5V27C/";
					status = "okay";
				};
			};
			module2 {
				badge = "e3322_centerright_A819P2";
				position = "centerright";
				orientation = "1";
				status = "disabled";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 2-0010";
					proc-device-tree = "/proc/device-tree/i2c@3180000/imx219_c@10";
					status = "disabled";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_imx219_c@P5V27C/";
					status = "disabled";
				};
			};
			module3 {
				badge = "e3322_topleft_A819P2";
				position = "topleft";
				orientation = "1";
				status = "disabled";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 3-0012";
					proc-device-tree = "/proc/device-tree/i2c@3180000/imx219_d@12";
					status = "disabled";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_imx219_d@P5V27C/";
					status = "disabled";
				};
			};
			module4 {
				badge = "e3322_bottomright_A819P2";
				position = "bottomright";
				orientation = "1";
				status = "disabled";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 4-0010";
					proc-device-tree = "/proc/device-tree/i2c@c250000/imx219_e@10";
					status = "disabled";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_imx219_e@P5V27C/";
					status = "disabled";
				};
			};
			module5 {
				badge = "e3322_topright_A819P2";
				position = "topright";
				orientation = "1";
				status = "disabled";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 5-0012";
					proc-device-tree = "/proc/device-tree/i2c@c250000/imx219_f@12";
					status = "disabled";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_imx219_f@P5V27C/";
					status = "disabled";
				};
			};
		};
	};
};

hello Spawn32,

v4l2-ctl parse several properties from sensor device tree.
you could check sensor_common_parse_*_props() functions for more details.

sources/kernel/kernel-4.4/drivers/media/platform/tegra/camera/sensor_common.c

in addition, gstreamer and nvcamera will also reading the properties in the modeX {…}

looks you had 6-cameras, may I know what’s the status for camera2, 3, 4, and 5?
moreover, I’m wondering there’s regulator issue.
please try below commands to keep camera0 running and then launching camera1
for example,

$ nvgstcapture-1.0 --prev-res=4 --image-res=4 --video-res=4 --sensor-id=0 --overlayConfig="1, 100, 100, 1280, 720" -m 2
$ nvgstcapture-1.0 --prev-res=4 --image-res=4 --video-res=4 --sensor-id=1 --overlayConfig="2, 500, 500, 1280, 720" -m 2

Hi @JerryChang,
Thank you for you input / help :)

I only have 2 x imx219 physical her for testing right now, so i have disabled video2-5 in the dtsi to keep it simpler, they should work when video0 and video1 is correct i think.

The Rpi Imx219 camera has 3 on-board volt regulators that are enabled by your cam-reset, so as long as the camera reset works like it should it will be ok i think…

I am new to the tx2 board, so i have a question, do i need to reserve / hog the cam reset pins like i have seen in some dtsi example here ?

I think this is where my problem is, so might need to hook up my analyzer…

I thought by having them like:

#define CAM0_RST_L TEGRA_MAIN_GPIO(R, 5)
#define CAM1_RST_L TEGRA_MAIN_GPIO(R, 1)

and labeling them:
reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;

and the calling them in the drive was ok, but they need to be reserved / hog’d as well ?

It’s nice to know what somebody is working on a Raspberry Pi camera driver for Jetson, but decision to not share your driver code is rather disappointing…

-albertr

@albertr .
You probably misunderstood me,i am all for open source, and this is originally open source driver’s.

But for me it would be morally wrong to just start spreading this around, i will send it to the original author, and i know they can then be asked for a copy.

I am not a professional programmer so the code will probably need a clean up before it’s re distributed :)

I’v got tons of help and tips from this guy’s, so the last thing i can do is doing this the right way.

Fun fact, i was contacted about a mount back from someone on this board, he wanted a copy of the old original Auvidea J20 drivers and we agreed to work on this together and bring it up to 28.2.

Pretty fast he was able to get it to work on 28.1, and i got it to work on 28.2, at least that was what i thought, turns out that i was on the pr release of 28.2 and that version was something in the middle of 28.2 final and 28.1, he couldn’t get my files to work on his 28.2 (final) sent me a email that i had faults in my code, and that was it, never replied to any emails after that … think he has other plans than open source with it :)

But for anyone working on the same thing:

If your using the Auvidea J20, get it to bring up the Gpio led, no point working on the imx219 driver before that…

Use correct addresses in the dtsi, this has changed a lot
.
Use embedded_metadata_height = “2”; in your dtsi

And use camera_common_initialize in the imx219_probing…