This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AM625:可以&'在多摄像头应用中从第二个摄像头获取视频流

Guru**** 2330470 points
Other Parts Discussed in Thread: AM625
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1518847/am625-can-t-get-a-stream-from-my-second-camera-in-multiple-camera-application

器件型号:AM625

工具/软件:

大家好:

我正在设计在 AM625上运行双摄像头的设置。 我有两个摄像头:一个 ISX021和一个 OV2311、通过 MAX96716/MAX96717串行器/解串器对连接。 以下是我的`mΔ i edia-ctl -p`命令的输出:

root@myd-am62x:~# media-ctl -p
Media controller API version 6.1.46

Media device information
------------------------
driver          j721e-csi2rx
model           TI-CSI2RX
serial          
bus info        platform:30102000.ticsi2rx
hw revision     0x1
driver version  6.1.46

Device topology
- entity 1: 30102000.ticsi2rx (5 pads, 5 links, 2 routes)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	routes:
		0/0 -> 1/0 [ACTIVE]
		0/1 -> 2/0 [ACTIVE]
	pad0: Sink
		[stream:0 fmt:Y8_1X8/1280x800 field:none colorspace:srgb]
		[stream:1 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
		<- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
	pad1: Source
		[stream:0 fmt:Y8_1X8/1280x800 field:none colorspace:srgb]
		-> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
	pad2: Source
		[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
		-> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
	pad3: Source
		-> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
	pad4: Source
		-> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]

- entity 7: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 2 routes)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	routes:
		0/0 -> 1/0 [ACTIVE]
		0/1 -> 1/1 [ACTIVE]
	pad0: Sink
		[stream:0 fmt:Y8_1X8/1280x800 field:none colorspace:srgb]
		[stream:1 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
		<- "max96716 1-004c":2 [ENABLED,IMMUTABLE]
	pad1: Source
		[stream:0 fmt:Y8_1X8/1280x800 field:none colorspace:srgb]
		[stream:1 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
		-> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
	pad2: Source
	pad3: Source
	pad4: Source

- entity 13: max96716 1-004c (4 pads, 3 links, 2 routes)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev2
	routes:
		0/0 -> 2/0 [ACTIVE]
		1/0 -> 2/1 [ACTIVE]
	pad0: Sink
		[stream:0 fmt:Y8_1X8/1280x800 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
		<- "max96717 1-0040":1 [ENABLED,IMMUTABLE]
	pad1: Sink
		[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
		<- "max96717 1-0041":1 [ENABLED,IMMUTABLE]
	pad2: Source
		[stream:0 fmt:Y8_1X8/1280x800 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
		[stream:1 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
		-> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
	pad3: Source

- entity 20: max96717 1-0040 (2 pads, 2 links, 1 route)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev3
	routes:
		0/0 -> 1/0 [ACTIVE]
	pad0: Sink
		[stream:0 fmt:Y8_1X8/1280x800 field:none colorspace:srgb]
		<- "ov2311_mipi 1-0010":0 [ENABLED,IMMUTABLE]
	pad1: Source
		[stream:0 fmt:Y8_1X8/1280x800 field:none colorspace:srgb]
		-> "max96716 1-004c":0 [ENABLED,IMMUTABLE]

- entity 25: max96717 1-0041 (2 pads, 2 links, 1 route)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev4
	routes:
		0/0 -> 1/0 [ACTIVE]
	pad0: Sink
		[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
		<- "isx021_mipi 1-001a":0 [ENABLED,IMMUTABLE]
	pad1: Source
		[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
		-> "max96716 1-004c":1 [ENABLED,IMMUTABLE]

- entity 30: isx021_mipi 1-001a (1 pad, 1 link, 0 route)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev5
	pad0: Source
		[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
		-> "max96717 1-0041":0 [ENABLED,IMMUTABLE]

- entity 34: ov2311_mipi 1-0010 (1 pad, 1 link, 0 route)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev6
	pad0: Source
		[stream:0 fmt:Y8_1X8/1280x800 field:none colorspace:srgb]
		-> "max96717 1-0040":0 [ENABLED,IMMUTABLE]

- entity 40: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
             type Node subtype V4L flags 0
             device node name /dev/video0
	pad0: Sink
		<- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]

- entity 46: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
             type Node subtype V4L flags 0
             device node name /dev/video1
	pad0: Sink
		<- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]

- entity 52: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
             type Node subtype V4L flags 0
             device node name /dev/video2
	pad0: Sink
		<- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]

- entity 58: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
             type Node subtype V4L flags 0
             device node name /dev/video3
	pad0: Sink
		<- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]

问题是我可以成功从连接到解串器端口 A 的 OV2311摄像头获得视频流:

root@myd-am62x:~# v4l2-ctl --device /dev/video0 --set-fmt-video=width=1280,height=800,pixelformat=GREY --stream-mmap
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.16 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.16 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.16 fps

但是、我无法从连接到端口 B 的 ISX021摄像头获得视频流:

root@myd-am62x:~# v4l2-ctl --device /dev/video1 --set-fmt-video=width=1920,height=1280,pixelformat=YUYV --stream-mmap
^C

我已`解串器的` video_lock `和` CSI1_PKT_CNT 寄存器指示解串器正在接收帧(数据包计数正在增加、存在视频锁定)。

我还使用 devmem2从 AM62x Sitara 处理器读取一些寄存器(请参考技术参考手册)、下面是流式传输期间的结果:

root@myd-am62x:~# devmem2 0x30101200 w
/dev/mem opened.
Memory mapped at address 0xffff7fb54000.
Read at address  0x30101200 (0xffff7fb54200): 0x00000000
root@myd-am62x:~# devmem2 0x30101204 w
/dev/mem opened.
Memory mapped at address 0xffff84515000.
Read at address  0x30101204 (0xffff84515204): 0x80000011
root@myd-am62x:~# devmem2 0x30101208 w
/dev/mem opened.
Memory mapped at address 0xffffa3135000.
Read at address  0x30101208 (0xffffa3135208): 0x00000000
root@myd-am62x:~# devmem2 0x3010120C w
/dev/mem opened.
Memory mapped at address 0xffffb37f0000.
Read at address  0x3010120C (0xffffb37f020c): 0x00000100
root@myd-am62x:~# devmem2 0x30101210 w
/dev/mem opened.
Memory mapped at address 0xffffa0f4d000.
Read at address  0x30101210 (0xffffa0f4d210): 0x00000000
root@myd-am62x:~# devmem2 0x30101214 w
/dev/mem opened.
Memory mapped at address 0xffff8a80c000.
Read at address  0x30101214 (0xffff8a80c214): 0x00000000
root@myd-am62x:~# devmem2 0x30101218 w
/dev/mem opened.
Memory mapped at address 0xffffb48c8000.
Read at address  0x30101218 (0xffffb48c8218): 0x00000000
root@myd-am62x:~# devmem2 0x3010121C w
/dev/mem opened.
Memory mapped at address 0xffffaba8b000.
Read at address  0x3010121C (0xffffaba8b21c): 0x00000000
root@myd-am62x:~# devmem2 0x30101220 w
/dev/mem opened.
Memory mapped at address 0xffffa9962000.
Read at address  0x30101220 (0xffffa9962220): 0x00000000
root@myd-am62x:~# devmem2 0x30101224 w
/dev/mem opened.
Memory mapped at address 0xffff98c28000.
Read at address  0x30101224 (0xffff98c28224): 0x00000000
root@myd-am62x:~# devmem2 0x30101228 w
/dev/mem opened.
Memory mapped at address 0xffffad587000.
Read at address  0x30101228 (0xffffad587228): 0x00000000

我目前被困在这个问题上、希望就我应该检查或尝试启用 AM625上两个摄像头的流式传输的其他内容提供任何指导。

提前感谢!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Kaya、

    您使用"YuYV"从 ISX021捕获:

    root@MYD-am62x:~# v4l2-ctl --device /dev/video1 --set-fmt-video=width=1920、height=1280、pixelformat=YuYV --stream-mmap

    但"media-ctl -p"显示了 isx021_mipi 1-001A 的 UYVY:

    [stream:0 fmt:UYVY8_1x16/1920x1280字段:无色空间:sRGB xfer:sRGB YCbCr:601量化:全范围]

    这种不匹配可能是您无法从 ISX021捕获数据的原因。 请在 v4l2-ctl 捕获命令中尝试"UYVY"。

    此致、

    建中

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好: 徐建中

    这是一个拼写错误、我只是测试了不同的格式。 即使我尝试使用 UYVY、结果也不会改变:

    root@myd-am62x:~# v4l2-ctl --device /dev/video1 --set-fmt-video=width=1920,height=1280,pixelformat=UYVY --stream-mmap
    ^C
    

    可以在上面看到。

    谢谢。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    好的。 您可以逐一试用这些摄像头吗? 只需连接 ISX021、不要连接 ov2311、看看是否可以从 ISX021进行流式传输。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好: 徐建中

    很抱歉晚回复。 我逐个尝试、但输出没有变化。 我仍然无法从 ISX021获得图像。

    您能否检查 VC 映射的 dmesg 日志是否正确?

    ```μ s

    v4l2-ctl --device /dev/video0 --set-fmt-video=width=1280、height=800、pixelformat=gray --stream-mmap

    ```μ s

    [325458.596918] ov2311_mipi 1-0010: Active format not set, using default
    [325458.603394] max96716 1-004c: max96716_get_vc_maps: VC map for port 0 is 0x00
    [325458.610543] isx021_mipi 1-001a: Active format not set, using default
    [325458.616996] max96716 1-004c: max96716_get_vc_maps: VC map for port 1 is 0x55
    [325458.624136] ov2311_mipi 1-0010: Active format not set, using default
    [325458.630583] max96716 1-004c: Mapping sink 0/0 to output VC 0
    [325458.636333] isx021_mipi 1-001a: Active format not set, using default
    [325458.642781] max96716 1-004c: Mapping sink 1/0 to output VC 1
    [325458.649336] max96716 1-004c: Prepare for streaming
    [325458.654272] ov2311_mipi 1-0010: Active format not set, using default
    [325458.660722] max96716 1-004c: max96716_get_vc_maps: VC map for port 0 is 0x00
    [325458.667875] isx021_mipi 1-001a: Active format not set, using default
    [325458.674318] max96716 1-004c: max96716_get_vc_maps: VC map for port 1 is 0x55
    [325458.681465] max96716 1-004c: enable TX port 0
    [325458.685922] max96716 1-004c: enable RX port 0
    [325458.690379] max96716 1-004c: enable RX port 0 streams 0x1
    [325458.695873] ov2311_mipi 1-0010: Inside ov2311_set_stream
    [325458.701355] ov2311_mipi 1-0010: Inside, ov2311_start_streaming
    [325458.707293] ov2311_mipi 1-0010: ov2311_set_exposure, func begins.
    [325458.713485] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3208, value=0x0
    [325458.720994] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3501, value=0x1
    [325458.728421] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3502, value=0xA9
    [325458.735922] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3508, value=0x2
    [325458.743343] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3509, value=0x0
    [325458.750771] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3921, value=0x80
    [325458.758313] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3927, value=0x1
    [325458.765757] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3928, value=0xA9
    [325458.773286] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3929, value=0x9
    [325458.780696] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x392A, value=0x60
    [325458.788209] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3208, value=0x10
    [325458.795709] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3208, value=0xA0
    [325458.803219] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0xFFFF, value=0x0
    [325458.810631] ov2311_mipi 1-0010: ov2311_set_exposure: Initialization completed successfully.
    [325458.819085] ov2311_mipi 1-0010: I2C: max25614_write_reg = reg=0x2, value=0xE1
    [325458.826523] ov2311_mipi 1-0010: Runtime PM usage count underflow!
    [325458.832715] ov2311_mipi 1-0010: Runtime PM usage count underflow!
    [325458.838936] ov2311_mipi 1-0010: Runtime PM usage count underflow!
    [325458.845159] ov2311_mipi 1-0010: Runtime PM usage count underflow!
    [325458.851360] ov2311_mipi 1-0010: Runtime PM usage count underflow!
    [325458.857556] ov2311_mipi 1-0010: Runtime PM usage count underflow!
    [325458.863741] ov2311_mipi 1-0010: Runtime PM usage count underflow!
    [325458.869924] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x100, value=0x1
    [325458.977514] ov2311_mipi 1-0010: OV2311 current state = 0x1
    [325459.583485] max96716 1-004c: disable RX port 0 streams 0x1
    [325459.589247] ov2311_mipi 1-0010: Inside ov2311_set_stream
    [325459.595053] ov2311_mipi 1-0010: I2C: max25614_write_reg = reg=0x2, value=0xE0
    [325459.602869] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x3208, value=0x10
    [325459.610559] ov2311_mipi 1-0010: I2C: ov2311_write_reg = reg=0x100, value=0x0
    [325459.722945] ov2311_mipi 1-0010: OV2311 current state = 0x0
    [325459.728615] ov2311_mipi 1-0010: Runtime PM usage count underflow!
    [325459.734860] max96716 1-004c: disable RX port 0
    [325459.739446] max96716 1-004c: disable TX port 0
    

    ```μ s

    v4l2-ctl --device /dev/video1 --set-fmt-video=width=1920、height=1280、pixelformat=UYVY --stream-mmap

    ```μ s

    [325532.601047] ov2311_mipi 1-0010: Active format not set, using default
    [325532.607512] max96716 1-004c: max96716_get_vc_maps: VC map for port 0 is 0x00
    [325532.614656] isx021_mipi 1-001a: Active format not set, using default
    [325532.621106] max96716 1-004c: max96716_get_vc_maps: VC map for port 1 is 0x55
    [325532.628248] ov2311_mipi 1-0010: Active format not set, using default
    [325532.634697] max96716 1-004c: Mapping sink 0/0 to output VC 0
    [325532.640445] isx021_mipi 1-001a: Active format not set, using default
    [325532.646917] max96716 1-004c: Mapping sink 1/0 to output VC 1
    [325532.653206] max96716 1-004c: Prepare for streaming
    [325532.658147] ov2311_mipi 1-0010: Active format not set, using default
    [325532.664603] max96716 1-004c: max96716_get_vc_maps: VC map for port 0 is 0x00
    [325532.671755] isx021_mipi 1-001a: Active format not set, using default
    [325532.678198] max96716 1-004c: max96716_get_vc_maps: VC map for port 1 is 0x55
    [325532.685349] max96716 1-004c: enable TX port 0
    [325532.689804] max96716 1-004c: enable RX port 1
    [325532.694257] max96716 1-004c: enable RX port 1 streams 0x1
    [325532.699753] isx021_mipi 1-001a: Inside isx021_set_stream
    [325532.705246] isx021_mipi 1-001a: Inside, isx021_start_streaming
    [325532.711198] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0xABFA, value=0x0
    [325532.718798] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0xAC0A, value=0x100
    [325532.726436] isx021_mipi 1-001a: Runtime PM usage count underflow!
    [325532.732628] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0xABC0, value=0x0
    [325532.740057] isx021_mipi 1-001a: Runtime PM usage count underflow!
    [325532.746272] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0xABC2, value=0x0
    [325532.753742] isx021_mipi 1-001a: Runtime PM usage count underflow!
    [325532.759937] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0xABFC, value=0x0
    [325532.767382] isx021_mipi 1-001a: Runtime PM usage count underflow!
    [325532.773572] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0xABFE, value=0x0
    [325532.781009] isx021_mipi 1-001a: Runtime PM usage count underflow!
    [325532.787197] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0xAC00, value=0x0
    [325532.794639] isx021_mipi 1-001a: Runtime PM usage count underflow!
    [325532.800826] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0xAC0A, value=0x0
    [325532.808272] isx021_mipi 1-001a: Runtime PM usage count underflow!
    [325532.814460] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0xBEF0, value=0x53
    [325532.821961] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0x8A00, value=0x3880
    [325532.929908] isx021_mipi 1-001a: ISX021 current state = 0x5
    [325535.021327] max96716 1-004c: disable RX port 1 streams 0x1
    [325535.026986] isx021_mipi 1-001a: Inside isx021_set_stream
    [325535.032403] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0xBEF0, value=0x53
    [325535.049605] isx021_mipi 1-001a: I2C: isx021_write_reg = reg=0x8A00, value=0x38
    [325535.162038] isx021_mipi 1-001a: ISX021 current state = 0x2
    [325535.167640] isx021_mipi 1-001a: streaming stop success
    [325535.172872] isx021_mipi 1-001a: Runtime PM usage count underflow!
    [325535.179085] max96716 1-004c: disable RX port 1
    [325535.183638] max96716 1-004c: disable TX port 0
    

    谢谢。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:

    对不起,我没有说明自己。 我想看看当 ov2311未物理连接时、是否可以从 isx021进行流式传输。 这是单摄像头的用例。  

    这有助于 了解问题是由 isx021传感器本身引起还是由连接2个摄像头引起。

    此致、

    建中

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好: 徐建中

    当 ISX021是唯一连接的器件时、我可以成功从 ISX021获取流、但我必须修改 DTBO 才能使其正常工作。 我确认可以使用单链路 MAX96716应用从该摄像头获取数据流、但切换到双流应用时、无法从解串器的通道 B 端口获取数据流。

    谢谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    好的。 感谢您的确认。 一些其他问题:

    1. 端口 B 不能流式传输吗? 如果将 ov2311连接到端口 B、将 ISX021连接到端口 A、会出现什么行为?

    2.它与流媒体顺序有关吗? 如果您首先从端口 B 进行流式传输、它是否进行流式传输?

    3.你可以尝试同时串流,例如,  

    v4l2-ctl --device /dev/video0 --set-fmt-video=width=1280、height=800、pixelformat=gray --stream-mmap && v4l2-ctl --device /dev/video1 --set-fmt-video=width=1920、height=1280、pixelformat=UYVY --stream-mmap

    4.您使用的 SDK 版本是什么?