AGX Orin 32GB platform, a decoding chip includes 4 camera channels, and there are abnormal MIPI outputs

你好:
基于agx orin 32G(5.0.2固件版本)做自定义底板的摄像头开发,摄像头解码芯片使用的是RN6864M,视频流整体结构如下图。


当前存在问题:
1、现有tegra-camera-platform配置都是一个i2c地址对应一路摄像头,而RN6864M是一个i2c地址对应4个摄像头,应该如何正确添加设备树.
2、orin使用设备树后(
rn6864-camera-a00.txt (22.7 KB)
rn6864-mode-a00.txt (6.8 KB)),MIPI_CSI1能收到摄像头#1数据,MIPI_CSI3能收到摄像头#5数据,MIPI_CSI2和MIPI_CSI4收不到摄像头数据;测量MIPI_CSI2和MIPI_CSI4的数据线与时钟线均有信号输入,把设备树MIPI_CSI2的port配置与MIPI_CSI1的port配置替换,依旧是MIPI_CSI2没有摄像头数据。(其中0x2e和0x2f是为了能输出节点而添加的)
3、解码器的一个mipi是两路摄像头信号复用,通过设置了MIPI_CSI1中vi和i2c的vc-id属性,摄像头信号没有变化(虚拟通道设置没生效);
以上几点是否能提供什么解决思路?

驱动添加后视频节点链路如下:
orin@nvidia-agx-orin:~$ media-ctl -p -d /dev/media0
Media controller API version 5.10.104

Media device information

driver tegra-camrtc-ca
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 5.10.104

Device topology

  • entity 1: 13e40000.host1x:nvcsi@15a00000- (2 pads, 2 links)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev0
    pad0: Sink
    ← “rn6864 2-002d”:0 [ENABLED]
    pad1: Source
    → “vi-output, rn6864 2-002d”:0 [ENABLED]

  • entity 4: 13e40000.host1x:nvcsi@15a00000- (2 pads, 2 links)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev1
    pad0: Sink
    ← “rn6864 2-002e”:0 [ENABLED]
    pad1: Source
    → “vi-output, rn6864 2-002e”:0 [ENABLED]

  • entity 7: 13e40000.host1x:nvcsi@15a00000- (2 pads, 2 links)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev2
    pad0: Sink
    ← “rn6864 2-002c”:0 [ENABLED]
    pad1: Source
    → “vi-output, rn6864 2-002c”:0 [ENABLED]

  • entity 10: 13e40000.host1x:nvcsi@15a00000- (2 pads, 2 links)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev3
    pad0: Sink
    ← “rn6864 2-002f”:0 [ENABLED]
    pad1: Source
    → “vi-output, rn6864 2-002f”:0 [ENABLED]

  • entity 13: rn6864 2-002d (1 pad, 1 link)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev4
    pad0: Source
    [fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb]
    → “13e40000.host1x:nvcsi@15a00000-”:0 [ENABLED]

  • entity 15: vi-output, rn6864 2-002d (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video0
    pad0: Sink
    ← “13e40000.host1x:nvcsi@15a00000-”:1 [ENABLED]

  • entity 33: rn6864 2-002e (1 pad, 1 link)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev5
    pad0: Source
    [fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb]
    → “13e40000.host1x:nvcsi@15a00000-”:0 [ENABLED]

  • entity 35: vi-output, rn6864 2-002e (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video1
    pad0: Sink
    ← “13e40000.host1x:nvcsi@15a00000-”:1 [ENABLED]

  • entity 45: rn6864 2-002c (1 pad, 1 link)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev6
    pad0: Source
    [fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb]
    → “13e40000.host1x:nvcsi@15a00000-”:0 [ENABLED]

  • entity 47: vi-output, rn6864 2-002c (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video2
    pad0: Sink
    ← “13e40000.host1x:nvcsi@15a00000-”:1 [ENABLED]

  • entity 57: rn6864 2-002f (1 pad, 1 link)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev7
    pad0: Source
    [fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb]
    → “13e40000.host1x:nvcsi@15a00000-”:0 [ENABLED]

  • entity 59: vi-output, rn6864 2-002f (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video3
    pad0: Sink
    ← “13e40000.host1x:nvcsi@15a00000-”:1 [ENABLED]

运行"4l2-ctl -d /dev/video1 --set-fmt-video=width=1920,height=1080,pixelformat=NV16 --stream-mmap=3 --stream-to=/home/orin/out0.yuv --stream-skip=9 --stream-count=1"时,反馈错误如下:
[ 2216.183243] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 2216.190976] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 2216.201644] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 2216.209363] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 2216.220076] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 2218.979591] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 2218.988755] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 2218.999242] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 2219.006974] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 2219.017627] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 2219.025354] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 2219.036066] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel

Thanks♪(・ω・)ノ

hello 408901091,

let me double confirm the Jetpack release version you’re now using.

I’ve checked your device tree, you’re developing camera use-case with four 4-lane camera, right?
if yes, it’s incorrect num_csi_lanes settings within tegra-camera-platform {}, it should be total active CSI lanes, which should be 16 in this configuration.

你好,JerryChang:
很感谢能收到你的回复!
1、当前刷了系统但未更新jetpack,系统信息如下:
orin@nvidia-agx-orin:~$ uname -a
Linux nvidia-agx-orin 5.10.104-tegra #29 SMP PREEMPT Mon Feb 26 18:48:41 CST 2024 aarch64 aarch64 aarch64 GNU/Linux
2、当前使用的是八个4-lane的摄像头,Orin每个MIPI_CSI各包含了两路摄像头的复用(如问题上的图);同时,总的八个摄像头仅有两个i2c地址(0x2C和0x2D),i2c地址0x2E和0x2F实际是不存在的,为了验证mipi2和mipi4是否有输出。 如上情况,期望八个摄像头能在/dev下生成八个video设备,在tegra-camera-platform {}下该如何配置?
3、修改了tegra-camera-platform {}下的 num_csi_lanes为16后,依旧只有那两路有画面,虚拟通道的数据也是没有变化。

hello 408901091,

please also check release tag to confirm L4T version, such as… $ cat /etc/nv_tegra_release

since your dumped Media device information shows only 4 camera nodes available,
please also check $ ls /dev/video*, how many video nodes has register to linux system now?

as you may using a device-tree overlay file to register the camera module, those device tree settings may be over-written by later dtbo. hence, you may have another approach to disassembler the dtb file (final dtb binary) into text file for examination,
for instance, $ dtc -I dtb -O dts -o temp.dts tegra234-xxx.dtb

hi,JerryChang:
orin@nvidia-agx-orin:/boot/dtb$ cat /etc/nv_tegra_release

R35 (release), REVISION: 1.0, GCID: 31250864, BOARD: t186ref, EABI: aarch64, DATE: Thu Aug 11 03:40:29 UTC 2022

orin@nvidia-agx-orin:~$ ls /dev/video*
/dev/video0 /dev/video1 /dev/video2 /dev/video3

$ dtc -I dtb -O dts -o temp.dts tegra234-xxx.dtb
temp.dts.txt (433.1 KB)

In the temp.dts file, no obvious anomalies were found in the configured parameters for the RN6864 camera.

在nvcsi->VI流程中,关于参数port-index和reg参数是否有什么绑定关系?

hello 408901091,

all right,
please moving forward to the latest release version, i.e. JetPack 5.1.3 since it has include several camera software stack bug fixes (especially serializer/deserializer chip camera use-case.)

there’re only 4 camera node definitions according to your device tree,
it’s known issue that DT settings must be identical with your real hardware setups.
so, please have 4 physical camera device connect to CSI-A, CSI-C, CSI-E, CSI-G for further verification.

BTW,
you should note that the port definition has the following… Sensor --> CSI --> VI
here’s bug of your 4th camera node port-index, which using CSI-G.
for instance,

		rn6864_a@2f {
			mode0 {
				tegra_sinterface = "serial_g";

			ports {
					endpoint@0 {
						vc-id = <0x00>;
						port-index = <0x05>;   <== it should be 6. 
						bus-width = <0x04>;

BTW2,
did you meant the reg = <0x00>; property settings as following?

		rn6864_a@2d {
			ports {
				#address-cells = <0x01>;
				#size-cells = <0x00>;
				port@0 {
					reg = <0x00>;

you may ignore that reg settings.
according to the port bindings, it’s checking port-index, vc-id, remote-endpoint.

你好,JerryChang。
谢谢你的回复!根据你的建议,系统已升级到JetPack 5.1.3 :

cat /etc/nv_tegra_release

R35 (release), REVISION: 5.0, GCID: 35550185, BOARD: t186ref, EABI: aarch64, DATE: Tue Feb 20 04:46:31 UTC 2024

 当前硬件连接状态是正确的,两个BTW2也做了相关相应修改。但还是和之前一样,只有vi0和vi2有数据。
 现在想通过camera,nvcsi,tegra-capture-vi逐个节点做状态确认,有什么好的方法或工具吗?
 想要了解camera,nvcsi,tegra-capture-vi代码实现,有什么参考文档或地址吗?

hello 408901091,

you may visit jetson-linux-r3550 page to download [Driver Package (BSP) Sources] package.
please extract kernel_src.tbz2 package to obtain public kernel sources,
here’s IMX390 as reference driver for using SerDes chips.
for instance, $public_sources/kernel_src/hardware/nvidia/platform/t23x/common/kernel-dts/t234-common-modules/tegra234-camera-imx390-a00.dtsi

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