Cam0 摄像头打开设备

你好,
jetpack版本:jetpack5.1.2
模块:Orin NX(16G) Orin NANO(4G)
摄像头:imax219
开发板:我们自己设计
使用nvgstcapture-1.0 打开csi2,正常,能够看到画面;使用同样的命令,打开csi0,打开失败,系统中存在/dev/video0. 输入nvgstcapture-1.0报错信息如下:
cam0.log (5.3 KB)

谢谢!

hello 814294789,

please refer to developer guide, Verifying the V4L2 Sensor Driver to have sanity test for your camera sensors.

BTW,
there’s polarity swap, i.e. CSI0 D1 and CSI1 D0 P/N will always been swizzled for P/N.
please use device tree property, lane_polarity to configure a polarity swap on any lane.

你好 JerryChang,

输入命令后的打印信息:
command.log (3.3 KB)
谢谢!

你好 JerryChang,polarity swap is only applied in X4 mode, how much polarity swap value is set, which pins should be connected to X2 mode, and whether polarity swap is required. The CSI part of the Jetson Orin Nano Developer Kit Carrier Board Specification is not well understood

hello 814294789,

is it correct you’ve two camera devices, they’re using CSI0 and CSI2?
please also check whether you’re able to access these two camera nodes via v4l2 IOCTL.

hello myll1997,

lane_polarity is to configure CSI0 D1 and CSI1 D0 P/N swaps.
please refer to Jetson Orin NX Series and Orin Nano Series Design Guide, and checking [Chapter 10. MIPI CSI Video Input] for more details.
you may see-also reference driver,
$public_sources/kernel_src/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-imx219.dtsi for lane_polarity property description.

你好 JerryChang,

我只有一个imx219.
当我将这个摄像头插到csi0,使用v4l2-ctl查看设备如下:
$ v4l2-ctl --list-device
NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
/dev/media0

vi-output, imx219 9-0010 (platform:tegra-capture-vi:1):
/dev/video0

当我将这个摄像头插到csi2,使用v4l2-ctl查看设备如下:
$ v4l2-ctl --list-device
NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
/dev/media0

vi-output, imx219 10-0010 (platform:tegra-capture-vi:2):
/dev/video0
谢谢!

微信图片_20240223154119
hello JerryChang:
Now that I’m having trouble tuning it, I’ll use Camera 1 (2-lane mode) as the input and have lane_polarity of whatever it should be

hello 814294789,

it looks normal, it’s register to video0 as you have only single camera device connected. (although they’re actually using different i2c bus).

please try v4l IOCTLs for fetching camera frames.
for instance,
$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100

please refer to CSI diff pair polarity swap - #3 by JerryChang, you might initial another new discussion thread for further question/supports.

你好 JerryChang,
这个命令在csi2上是可以设置,终端打印<<<<<<<<< 21.19 fps,
将imx219插到csi0,终端阻塞,无打印信息。但是从dmesg中捕获到一下的日志:
[ 2369.219886] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 2369.232656] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 2369.243613] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 2369.251369] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=1, csi_port=1
[ 2369.262054] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 2369.269780] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 1 vc- 0
[ 2369.280712] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel

谢谢!

hello 814294789,

please share your device tree property settings, did you have correct lane_polarity configuration?
also, please see-also tegra234-p3768-0000-a0.dtsi, which has device tree settings for moving i2c@0 to port-index = <1>; (i.e. CSI-B), you may removing that if you’re using a customize carrier board.
for example,

                i2c@0 {
                        rbpcv2_imx219_a@10 {
                                ...
                                ports {
                                        port@0 {
                                                endpoint {
                                                        port-index = <1>;
                                                };  
1 Like

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