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: Can't get a stream from my second camera in multiple-camera application

Part Number: AM625

Tool/software:

Hello all,

I’m working on getting my dual camera setup running on the AM625. I have two cameras: one ISX021 and one OV2311, connected via a MAX96716/MAX96717 SerDes pair. Below is the output of my `media-ctl -p` command:

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]

The problem is that I can successfully get a video stream from the OV2311 camera connected to port A of the deserializer:

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

However, I cannot get a stream from the ISX021 camera connected to port B:

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

I verified that the deserializer’s `VIDEO_LOCK` and `CSI1_PKT_CNT` registers indicate the deserializer is receiving frames (packet count is increasing and video lock is present).

I also used devmem2 to read some registers from the AM62x Sitara processor (referencing the technical reference manual), and here are the results during streaming:

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

I’m currently stuck on this issue and would appreciate any guidance on what else I should check or try to enable streaming from both cameras on the AM625.

Thanks in advance!

  • Hello Kaya,

    You were using "YUYV" to capture from ISX021:

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

    But the "media-ctl -p" shows UYVY for isx021_mipi 1-001a:

    [stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]

    This mismatch may be the reason why you were not able to capture from ISX021. Please try "UYVY" in your v4l2-ctl capture command.

    Regards,

    Jianzhong

  • Hello ,

    That was a typo, I was just testing out the different formats. Result wont change even if I try with UYVY:

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

    as you can see above.

    Thanks.

  • Ok. Can you try the cameras one by one? Just connect ISX021, and don't connect ov2311, and see if you can stream from ISX021.

  • Hello ,

    Sorry for late response. I tried one by one but the output didn't change. I still cant get a image from ISX021.

    Can you check whether dmesg logs of vc mapping looks correct for you ?

    ```

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

    ```

    [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
    

    ```

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

    ```

    [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
    

    Thanks.

  • Hello,

    Sorry, I didn't make myself clear. I wanted to see if you could stream from isx021 when ov2311 was not connected physically. That's a single camera use case. 

    This can help understand whether the issue is caused by the isx021 sensor itself or caused by the connecting 2 cameras.

    Regards,

    Jianzhong

  • Hello ,

    I can successfully get a stream from the ISX021 when it is the only device connected, but I have to modify the DTBO to make that work. I’ve confirmed that I can obtain a stream from this camera using the single-link MAX96716 application, but when I switch to the dual-stream application, I cannot get a stream from the deserializer’s channel B port.

    Thanks

  • Ok. Thanks for the confirmation. Some additional questions:

    1. Is it always port B that can't stream? If you connect ov2311 to port B and ISX021 to port A, what's the behavior?

    2. Does it have to do with the streaming order? If you stream from port B first, does it stream?

    3. Can you try streaming both simultaneously, for example, 

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

    4. what is the SDK version you're using?