[IMX219] four cameras, but two camera doesn't work

Continuing the discussion from [IMX219] Four camera don't work on Nano custom board design:

Hello,

I want to return to the above topic. Now, I have four cameras, so I tested this setup and unfortunately, it didn’t work. Two cameras work fine and two cameras have errors during boot:

[    2.832691] imx219 32-0010: imx219_power_get: unable to request reset_gpio (-16)
[    2.840178] imx219 32-0010: unable to power get
[    2.844754] imx219 32-0010: tegra camera driver registration failed
[    2.851235] imx219 33-0010: imx219_power_get: unable to request reset_gpio (-16)
[    2.858717] imx219 33-0010: unable to power get
[    2.863293] imx219 33-0010: tegra camera driver registration failed

And in catalog /dev I see only 2 cameras, which work fine.
Hardware connections are below:
[PWDN] → [i2c mux address] → [CSI channel] → [port-index in dts] [status, when 4 cameras are connected)
CAM1_PWDN → i2c-30 → CSI_E → port-index = <4> (work fine)
CAM0_PWDN → i2c-31 → CSI_C → port-index = <2> (work fine)
CAM0_PWDN → i2c-32 → CSI_A → port-index = <0> (doesn’t work)
CAM1_PWDN → i2c-33 → CSI_F → port-index = <5> (doesn’t work)

I tested a few configurations of the connection two cameras:

  1. CSI_A and CSI_F, then cameras works
  2. CSI_A and CSI_E, then the camera connected to CSI_A works only. Camera connected to CSI_E plot log:
    [ 2.811106] imx219 30-0010: imx219_board_setup: error during i2c read probe (-121)
    [ 2.818838] imx219 30-0010: board setup failed
  3. CSI_A and CSI_C, then the camera connected to CSI_A works only. Camera connected to CSI_C plot log:
    [ 5.012817] imx219 31-0010: imx219_board_setup: error during i2c read probe (-110)
    [ 5.020725] imx219 31-0010: board setup failed
  4. CSI_C and CSI_F, then cameras works. What is interesting in the log from Connector for CSI_A is other than standard when the camera isn’t connected
    [ 2.852544] imx219 32-0010: imx219_power_get: unable to request reset_gpio (-16)
    [ 2.860025] imx219 32-0010: unable to power get
    [ 2.864600] imx219 32-0010: tegra camera driver registration failed
    The standard log when a camera isn’t connected is: imx219_board_setup: error during i2c read probe (-121).
  5. CSI_E and CSI_F, then the camera connected to CSI_F works only. Camera connected to CSI_E plot log:
    [ 2.815436] imx219 30-0010: imx219_board_setup: error during i2c read probe (-121)
    [ 2.823177] imx219 30-0010: board setup failed

The hardware looks correct because every camera work in some configuration of connection. Problems are when two cameras use one PWDN pin. I tested four separately PWDN pins but it didn’t help.
Can you check out my device tree?

tegra210-camera-rbpcv2-dual-imx219.dtsi (41.7 KB)
tegra210-porg-camera-rbpcv2-dual-imx219.dtsi (1.9 KB)

Looks like HW problem cause I2C failed communication.

My fragment of the circuit with switch:


I use one pin PWDN for two cameras, Is it fine?

I don’t think using the same pin would be fine.

I added two gpio so every camera has its own pwdn. Device tree:

#include "tegra210-camera-rbpcv2-dual-imx219.dtsi"

#define CAM0_PWDN	TEGRA_GPIO(D, 3) //CAM_E
#define CAM1_PWDN	TEGRA_GPIO(G, 2) //CAM_C
#define CAM2_PWDN	TEGRA_GPIO(S, 7) //CAM_A
#define CAM3_PWDN	TEGRA_GPIO(T, 0) //CAM_F



#define CAMERA_I2C_MUX_BUS(x) (0x1E + x)

/* camera control gpio definitions */

/ {

	gpio@6000d000 {
		camera-control-output-low {
			status = "okay";
			gpio-hog;
			output-low;
			gpios = < CAM0_PWDN 0  CAM1_PWDN 0  CAM2_PWDN 0  CAM3_PWDN 0>;
			label = "cam0-pwdn", "cam1-pwdn", "cam2-pwdn", "cam3-pwdn";
		};
	};

	en_vdd_cam: regulator@13 {
		compatible = "regulator-fixed-sync";
		/*eg = <13>;*/
		regulator-name = "en-vdd-cam";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};

		host1x {
		i2c@546c0000 {
			tca9548_70: tca9548@70 {
				status = "okay";
				compatible = "nxp,pca9548";
				reg = <0x70>;
				#address-cells = <1>;
				#size-cells = <0>;
				vcc-supply = <&en_vdd_cam>;
				skip_mux_detect = "yes";	
				force_bus_start = <CAMERA_I2C_MUX_BUS(0)>;			
				i2c@0 {
					status = "okay";
					reg = <0>;
					i2c-mux,deselect-on-exit;
					#address-cells = <1>;
					#size-cells = <0>;
					rbpcv2_imx219_e@10 {
						status = "okay";
						reset-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
					};
				};
				i2c@1 {
					status = "okay";
					reg = <1>;
					i2c-mux,deselect-on-exit;
					#address-cells = <1>;
					#size-cells = <0>;
					rbpcv2_imx219_c@10 {
						status = "okay";   						
						reset-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
					};
				};
				i2c@2 {
					status = "okay";
					reg = <2>;
					i2c-mux,deselect-on-exit;
					#address-cells = <1>;
					#size-cells = <0>;
					rbpcv2_imx219_a@10 {
						status = "okay";  
						reset-gpios = <&gpio CAM2_PWDN GPIO_ACTIVE_HIGH>;
					};
				};
				i2c@3 {
					status = "okay";
					reg = <3>;
					i2c-mux,deselect-on-exit;
					#address-cells = <1>;
					#size-cells = <0>;
					rbpcv2_imx219_f@10 {
						status = "okay";
						reset-gpios = <&gpio CAM3_PWDN GPIO_ACTIVE_HIGH>;
					};
				};
			};
		};
	};
};

In pinmux settings are like below:

			uart3_rts_pd3 {
				nvidia,pins = "uart3_rts_pd3";
				nvidia,function = "uartc";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};
			uart2_rts_pg2 {
				nvidia,pins = "uart2_rts_pg2";
				nvidia,function = "rsvd2";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};
			cam1_pwdn_ps7 {
				nvidia,pins = "cam1_pwdn_ps7";
				nvidia,function = "rsvd1";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};

			cam2_pwdn_pt0 {
				nvidia,pins = "cam2_pwdn_pt0";
				nvidia,function = "rsvd1";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};

In this configuration, work only two cameras are connected to CSI_E and CSI_C. Others return errors:
imx219 32-0010: imx219_board_setup: error during i2c read probe (-121)
imx219 32-0010: board setup failed
imx219 33-0010: imx219_board_setup: error during i2c read probe (-121)
imx219 33-0010: board setup failed
Is it everything that I must change in the device tree for four pwdn pins?

You may need to probe those power down/Reset … PINs to confirm their state.

Hello,

I found that pwdn pins are shaped. After correcting this mistake, all cameras are present in /dev/video* catalog. But I can run 3 cameras only (the queue doesn’t influence for error. Always, the last camera doesn’t work).
When I change the resolution to 1920x1080, then all cameras work fine.
Which resolution is recommended as the highest for 4 cameras?

Below are logs:

Working camera:

$gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12' ! nvvidconv flip-method=0 ! 'video/x-raw,width=480, height=272' ! nvvidconv ! nvegltransform ! nveglglessink -e

Setting pipeline to PAUSED ...

Using winsys: x11 
Pipeline is live and does not need PREROLL ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21,000000 fps Duration = 47619048 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28,000001 fps Duration = 35714284 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29,999999 fps Duration = 33333334 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29,999999 fps Duration = 33333334 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59,999999 fps Duration = 16666667 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120,000005 fps Duration = 8333333 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 0 
   Output Stream W = 3264 H = 2464 
   seconds to Run    = 0 
   Frame Rate = 21,000000 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.

the last camera:

$gst-launch-1.0 nvarguscamerasrc sensor_id=3 ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12' ! nvvidconv flip-method=0 ! 'video/x-raw,width=480, height=272' ! nvvidconv ! nvegltransform ! nveglglessink -e

Setting pipeline to PAUSED ...

Using winsys: x11 
Pipeline is live and does not need PREROLL ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21,000000 fps Duration = 47619048 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28,000001 fps Duration = 35714284 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29,999999 fps Duration = 33333334 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29,999999 fps Duration = 33333334 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59,999999 fps Duration = 16666667 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120,000005 fps Duration = 8333333 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 3 
   Camera mode  = 0 
   Output Stream W = 3264 H = 2464 
   seconds to Run    = 0 
   Frame Rate = 21,000000 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
NvRmChannelSubmit: NvError_IoctlFailed with error code 22
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 112, SyncPointValue = 0)
fence_set_name ioctl failed with 22
(Argus) Error InsufficientMemory:  (propagating from src/eglstream/ImageImpl.cpp, function copyToNvBuffer(), line 553)
(Argus) Error InvalidState: Failed to copy to NvBuffer (in src/eglstream/ImageImpl.cpp, function createNvBuffer(), line 374)
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD... Exiting...
NvBufferGetParams failed for src_dmabuf_fd
nvbuffer_transform Failed
NvRmChannelSubmit: NvError_IoctlFailed with error code 22
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 112, SyncPointValue = 0)
fence_set_name ioctl failed with 22
(Argus) Error InsufficientMemory:  (propagating from src/eglstream/ImageImpl.cpp, function copyToNvBuffer(), line 553)
(Argus) Error InvalidState: Failed to copy to NvBuffer (in src/eglstream/ImageImpl.cpp, function createNvBuffer(), line 374)

during the above command, below are dmesg logs:

[  251.565246] vi 54080000.vi: pin_array_ids: could not map attachment err=-12
[  251.572425] falcon 54340000.vic: nvhost_ioctl_channel_submit: failed with err -12
[  251.615225] vi 54080000.vi: pin_array_ids: could not map attachment err=-12
[  251.627028] falcon 54340000.vic: nvhost_ioctl_channel_submit: failed with err -12
[  251.653979] falcon 54340000.vic: submit_add_gathers: failed to copy user inputs: class_ids=0000000078005be8 num_cmdbufs=3
[  251.665893] falcon 54340000.vic: nvhost_ioctl_channel_submit: failed with err -22
[  251.669581] falcon 54340000.vic: submit_add_gathers: failed to copy user inputs: class_ids=000000005c6dbd28 num_cmdbufs=3
[  251.669587] falcon 54340000.vic: nvhost_ioctl_channel_submit: failed with err -22
[  251.694921] (NULL device *): nvhost_sync_fence_set_name: failed to get fence
[  251.721835] (NULL device *): nvhost_sync_fence_set_name: failed to get fence
[  251.761531] (NULL device *): nvhost_sync_fence_set_name: failed to get fence
[  251.769227] (NULL device *): nvhost_sync_fence_set_name: failed to get fence
[  251.778732] (NULL device *): nvhost_sync_fence_set_name: failed to get fence
[  251.789592] (NULL device *): nvhost_sync_fence_set_name: failed to get fence
[  251.808772] (NULL device *): nvhost_sync_fence_set_name: failed to get fence
[  251.822805] (NULL device *): nvhost_sync_fence_set_name: failed to get fence
[  251.837638] (NULL device *): nvhost_sync_fence_set_name: failed to get fence
[  251.908469] (NULL device *): nvhost_sync_fence_set_name: failed to get fence
[  251.952110] (NULL device *): nvhost_sync_fence_set_name: failed to get fence

The latest camera working individualy?
Try boost system performance to try.

sudo nvpmodel -m 0
sudo jetson_clocks
sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate

echo userspace > /sys/devices/13e10000.host1x/15340000.vic/devfreq/15340000.vic/governor

echo 1 > /sys/kernel/debug/bpmp/debug/clk/vic/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vic/state
cat /sys/kernel/debug/bpmp/debug/clk/vic/max_rate > /sys/kernel/debug/bpmp/debug/clk/vic/rate

Thanks for reply.
Unfortunately, I don’t have directory /sys/kernel/debug/bpmp. Below is contents of directory /sys/kernel/debug:

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