Orin camera

我们的Orin当前版本R35.1,使用了3片max96712,第一片(video0-video3),第二片(video4-7),第三片(video8-11),通过gstreamer测试相机,目前第一路的4个相机使用都是正常,每次上电只使用第二路上的相机的或第三路相机,都可以正常使用,但是一旦两路相机都被gstreamer使用之后,单独再运行gstreamer都没有图像数据,必须两路96712上的都使用才能正常出图,即使某一路没接相机,也必须用gstreamer运行起来,所有图像才正常,我怀疑是csi或vi的配置问题,下面是我csi与vi的device-tree:
tegra-capture-vi {
num-channels = <12>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ox3cc_vi_in0: endpoint {
vc-id = <0>;
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out0>;
};
};
port@1 {
reg = <1>;
ox3cc_vi_in1: endpoint {
vc-id = <1>;
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out1>;
};
};
port@2 {
reg = <2>;
ox3cc_vi_in2: endpoint {
vc-id = <2>;
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out2>;
};
};
port@3 {
reg = <3>;
ox3cc_vi_in3: endpoint {
vc-id = <3>;
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out3>;
};
};
port@3 {
reg = <3>;
ox3cc_vi_in3: endpoint {
vc-id = <3>;
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out3>;
};
};
port@4 {
reg = <4>;
ox3cc_vi_in4: endpoint {
vc-id = <0>;
port-index = <2>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out4>;
};
};
port@5 {
reg = <5>;
ox3cc_vi_in5: endpoint {
vc-id = <1>;
port-index = <2>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out5>;
};
};
port@6 {
reg = <6>;
ox3cc_vi_in6: endpoint {
vc-id = <2>;
port-index = <2>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out6>;
};
};
port@7 {
reg = <7>;
ox3cc_vi_in7: endpoint {
vc-id = <3>;
port-index = <2>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out7>;
};
};
port@8 {
reg = <8>;
ox3cc_vi_in8: endpoint {
vc-id = <0>;
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out8>;
};
};
port@9 {
reg = <9>;
ox3cc_vi_in9: endpoint {
vc-id = <1>;
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out9>;
};
};
port@10 {
reg = <10>;
ox3cc_vi_in10: endpoint {
vc-id = <2>;
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out10>;
};
};
port@11 {
reg = <11>;
ox3cc_vi_in11: endpoint {
vc-id = <3>;
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out11>;
};
};
};
};

host1x@13e00000 {
	nvcsi@15a00000 {
		num-channels = <12>;
		#address-cells = <1>;
		#size-cells = <0>;
		channel@0 {
			reg = <0>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in0: endpoint@0 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out0>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out0: endpoint@1 {
						remote-endpoint = <&ox3cc_vi_in0>;
					};
				};
			};
		};
		channel@1 {
			reg = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
						ox3cc_csi_in1: endpoint@2 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out1>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out1: endpoint@3 {
						remote-endpoint = <&ox3cc_vi_in1>;
					};
				};
			};
		};
		channel@2 {
			reg = <2>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in2: endpoint@4 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out2>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out2: endpoint@5 {
						remote-endpoint = <&ox3cc_vi_in2>;
					};
				};
			};
		};
		channel@3 {
			reg = <3>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in3: endpoint@6 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out3>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out3: endpoint@7 {
						remote-endpoint = <&ox3cc_vi_in3>;
					};
				};
			};
		};
		channel@4 {
			reg = <4>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in4: endpoint@8 {
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out8>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out4: endpoint@9 {
						remote-endpoint = <&ox3cc_vi_in4>;
					};
				};
			};
		};
		channel@5 {
			reg = <5>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in5: endpoint@10 {
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out9>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out5: endpoint@11 {
						remote-endpoint = <&ox3cc_vi_in5>;
					};
				};
			};
		};
		channel@6 {
			reg = <6>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in6: endpoint@12 {
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out10>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out6: endpoint@13 {
						remote-endpoint = <&ox3cc_vi_in6>;
					};
				};
			};
		};
		channel@7 {
			reg = <7>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in7: endpoint@14 {
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out11>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out7: endpoint@15 {
						remote-endpoint = <&ox3cc_vi_in7>;
					};
				};
			};
		};
		channel@8 {
			reg = <8>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in8: endpoint@16 {
						port-index = <4>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out4>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out8: endpoint@17 {
						remote-endpoint = <&ox3cc_vi_in8>;
					};
				};
			};
		};
		channel@9 {
			reg = <9>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in9: endpoint@18 {
						port-index = <4>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out5>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out9: endpoint@19 {
						remote-endpoint = <&ox3cc_vi_in9>;
					};
				};
			};
		};
		channel@10 {
			reg = <10>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in10: endpoint@20 {
						port-index = <4>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out6>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out10: endpoint@21 {
						remote-endpoint = <&ox3cc_vi_in10>;
					};
				};
			};
		};
		channel@11 {
			reg = <11>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ox3cc_csi_in11: endpoint@22 {
						port-index = <4>;
						bus-width = <4>;
						remote-endpoint = <&ox3cc_ox3cc_out7>;
					};
				};
				port@1 {
					reg = <1>;
					ox3cc_csi_out11: endpoint@23 {
						remote-endpoint = <&ox3cc_vi_in11>;
					};
				};
			};
		};
	};
};

Do you use v4l2src or nvarguscamerasrc?
Those nvcsi/vi configure are fine.

v4l2

OK, I don’t think that could be the problem of NVCSI/VI
It could be the max96712 driver’s issue.

出问题的时候即使96712对应4路不接相机,只要调用gstreamer命令,另一路96712对应的相机就能出图,应该不是96712的问题吧

而且我们用示波器打过max96712的mipi输出,是有信号的,但vi capture驱动报超时

Could you confirm by v4l2-ctl command?
Is it possible bypass the Max96712 connect to Orin to confirm?

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

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

我可以这样,把第二路max96712(video4-7)的驱动中涉及到96712和前端串行器的代码关掉,只是初始化生成4个video设备,然后使用第三路max96712 video8时,调用v4l2-ctl --set-fmt-video=width=1920,height=1080 --set-ctrl bypass_mode=0 --stream-mmap -d /dev/video4 ,看video8是否出图,如果能应该就和max96712没关系,因为video4到7这个时候没有96712相当于,你看这样行不行

Sorry for the late response, have you managed to get issue resolved or still need the support? Thanks

Yes,we need ,we still not found the relationship between vidio4 and video8

1686306863918
我们发现video4-video11对应的是vi 1,而video0-video3是vi 0

You can modify below dts to try. In the vi mapping the first value of the array is stream # second is the vi unit. Orin have two vi units.

	tegra-capture-vi {
181 		compatible = "nvidia,tegra-camrtc-capture-vi";
182 
183 		nvidia,vi-devices = <&vi0 &vi1>;
184 		nvidia,vi-mapping-size = <6>;
185 		nvidia,vi-mapping =
186 			<0 0>,
187 			<1 0>,
188 			<2 1>,
189 			<3 1>,
190 			<4 0>,
191 			<5 1>;
192 		nvidia,vi-mapping-names = "csi-stream-id", "vi-unit-id";
193 		nvidia,vi-max-channels = <72>;
194 	};

请问下nvcsi 驱动里哪里可以查是否接收到mipi数据,我们现在仍然有port8和port4必须同时运行,后端才能收到数据

No, only the trace log for debugging.

Thanks

video4-7和video5-8还会引起这个topic上的kernel panic

Is this still an issue to support? Any result can be shared? Thanks

仍然没有找到问题,csi2/3和cs4/5对应的相机还是必须同时运行调用才能显示数据,仍然未找到rtcpu报timeout的原因

The dts have duplicated port@3

’’’
port@3 {
reg = <3>;
ox3cc_vi_in3: endpoint {
vc-id = <3>;
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out3>;
};
};
port@3 {
reg = <3>;
ox3cc_vi_in3: endpoint {
vc-id = <3>;
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ox3cc_csi_out3>;
};
’’’

生成的dtb文件已经没有重复了,同时我们也删除了dts文件重复的端口,现象仍未改变

Does the first time launch camera without problem after reboot? If yes I would suspect the SER/DESER chips doesn’t reset well cause the problem