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: Dangling sink streams: mask 0x2 Error While Setting Up Multiple Cameras

Part Number: AM625

Tool/software:

Hello all,

I'm trying to make my dual camera setup work on my AM625. 1x ISX021 camera, 1x OV2311 camera. However when I try to execute the below script I get an  ``Dangling sink streams: mask 0x2`` error. I think this error happens because I'm doing something wrong on my media-ctl setup script but do have a look please:

```

#!/bin/bash

setup_isx021(){
ISX021_CAM_FMT='[fmt:UYVY8_1X16/1920x1280 field: none]'

i=0
for media_id in {0..0}; do
# MAX96717 FORMATS
MAX96716_FMT_STR="["
CSI2RX_FMT_STR="["
for name in `media-ctl -d $media_id -p | grep entity | grep isx021_mipi | cut -d ' ' -f 5`; do

CAM_SUBDEV=`media-ctl -d $media_id -p -e "isx021_mipi $name" | grep v4l-subdev | awk '{print $4}'`

MAX96717_NAME=`media-ctl -d $media_id -p -e "isx021_mipi $name" | grep max96717 | cut -d "\"" -f 2`
media-ctl -d $media_id -V "'$MAX96717_NAME':0 $ISX021_CAM_FMT"

MAX96716_NAME=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d "\"" -f 2`
MAX96716_PAD=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d : -f 2 | awk '{print $1}'`

CSI_BRIDGE_NAME=`media-ctl -d $media_id -p -e "$MAX96716_NAME" | grep csi-bridge | cut -d "\"" -f 2`

CSI2RX_NAME=`media-ctl -d $media_id -p -e "$CSI_BRIDGE_NAME" | grep "ticsi2rx\"" | cut -d "\"" -f 2`

CSI2RX_CONTEXT_NAME="$CSI2RX_NAME context $MAX96716_PAD"

if [ "$MAX96716_FMT_STR" != "[" ]; then
MAX96716_FMT_STR="${MAX96716_FMT_STR}, "
CSI2RX_FMT_STR="${CSI2RX_FMT_STR}, "
fi
MAX96716_FMT_STR="${MAX96716_FMT_STR}${MAX96716_PAD}/0 -> $(($MAX96716_PAD + 2))/0 [1]"
CSI2RX_FMT_STR="${CSI2RX_FMT_STR}0/${MAX96716_PAD} -> $(($MAX96716_PAD+1))/0 [1]"

echo "ISX021 Camera $i detected"
echo " device = "`media-ctl -d $media_id -p -e "$CSI2RX_CONTEXT_NAME" | grep video | awk '{print $4}'`
echo " name = isx021"
echo " format = $ISX021_CAM_FMT"
echo " subdev_id = $CAM_SUBDEV"
echo " isp_required = yes"
echo " ldc_required = no"

((i++))
done

MAX96716_FMT_STR="${MAX96716_FMT_STR}]"
CSI2RX_FMT_STR="${CSI2RX_FMT_STR}]"

media-ctl -d $media_id -p | grep entity | grep isx021_mipi -q
if [ "$?" == "0" ]; then
# MAX96716 ROUTING & FORMATS
echo $MAX96716_NAME $MAX96716_FMT_STR
media-ctl -d $media_id -R "'$MAX96716_NAME' $MAX96716_FMT_STR"
for name in `media-ctl -d $media_id -p | grep entity | grep isx021_mipi | cut -d ' ' -f 5`; do
MAX96717_NAME=`media-ctl -d $media_id -p -e "isx021_mipi $name" | grep max96717 | cut -d "\"" -f 2`
MAX96716_NAME=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d "\"" -f 2`
MAX96716_PAD=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d : -f 2 | awk '{print $1}'`
media-ctl -d $media_id -V "'$MAX96716_NAME':$MAX96716_PAD $ISX021_CAM_FMT"
done

# CSI2RX ROUTING
media-ctl -d $media_id -R "'$CSI2RX_NAME' $CSI2RX_FMT_STR"
#media-ctl -d 0 -R '"cdns_csi2rx.30101000.csi-bridge" [0/1 -> 1/1 [1]]'
#media-ctl -d 0 -V '"cdns_csi2rx.30101000.csi-bridge":0/1 [fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]'
#media-ctl -d 0 -R '"30102000.ticsi2rx" [0/1 -> 2/0 [1]]'
#media-ctl -d 0 -V '"30102000.ticsi2rx":0/1 [fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]'
fi
done
}

setup_ov2311(){
OV2311_CAM_FMT='[fmt:Y8_1X8/1280x800 field: none]'

i=0
for media_id in {0..0}; do
# MAX96717 FORMATS
MAX96716_FMT_STR="["
CSI2RX_FMT_STR="["
for name in `media-ctl -d $media_id -p | grep entity | grep ov2311_mipi | cut -d ' ' -f 5`; do

CAM_SUBDEV=`media-ctl -d $media_id -p -e "ov2311_mipi $name" | grep v4l-subdev | awk '{print $4}'`

MAX96717_NAME=`media-ctl -d $media_id -p -e "ov2311_mipi $name" | grep max96717 | cut -d "\"" -f 2`
media-ctl -d $media_id -V "'$MAX96717_NAME':0 $OV2311_CAM_FMT"

MAX96716_NAME=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d "\"" -f 2`
MAX96716_PAD=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d : -f 2 | awk '{print $1}'`

CSI_BRIDGE_NAME=`media-ctl -d $media_id -p -e "$MAX96716_NAME" | grep csi-bridge | cut -d "\"" -f 2`

CSI2RX_NAME=`media-ctl -d $media_id -p -e "$CSI_BRIDGE_NAME" | grep "ticsi2rx\"" | cut -d "\"" -f 2`

CSI2RX_CONTEXT_NAME="$CSI2RX_NAME context $MAX96716_PAD"

if [ "$MAX96716_FMT_STR" != "[" ]; then
MAX96716_FMT_STR="${MAX96716_FMT_STR}, "
CSI2RX_FMT_STR="${CSI2RX_FMT_STR}, "
fi
MAX96716_FMT_STR="${MAX96716_FMT_STR}${MAX96716_PAD}/0 -> $(($MAX96716_PAD + 2))/0 [1]"
CSI2RX_FMT_STR="${CSI2RX_FMT_STR}0/${MAX96716_PAD} -> $(($MAX96716_PAD+1))/0 [1]"

echo "OV2311 Camera $i detected"
echo " device = "`media-ctl -d $media_id -p -e "$CSI2RX_CONTEXT_NAME" | grep video | awk '{print $4}'`
echo " name = ov2311"
echo " format = $OV2311_CAM_FMT"
echo " subdev_id = $CAM_SUBDEV"
echo " isp_required = yes"
echo " ldc_required = no"

((i++))
done

MAX96716_FMT_STR="${MAX96716_FMT_STR}]"
CSI2RX_FMT_STR="${CSI2RX_FMT_STR}]"

media-ctl -d $media_id -p | grep entity | grep ov2311_mipi -q
if [ "$?" == "0" ]; then
# MAX96716 ROUTING & FORMATS
echo $MAX96716_NAME $MAX96716_FMT_STR
media-ctl -d $media_id -R "'$MAX96716_NAME' $MAX96716_FMT_STR"
for name in `media-ctl -d $media_id -p | grep entity | grep ov2311_mipi | cut -d ' ' -f 5`; do
MAX96717_NAME=`media-ctl -d $media_id -p -e "ov2311_mipi $name" | grep max96717 | cut -d "\"" -f 2`
MAX96716_NAME=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d "\"" -f 2`
MAX96716_PAD=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d : -f 2 | awk '{print $1}'`
media-ctl -d $media_id -V "'$MAX96716_NAME':$MAX96716_PAD $OV2311_CAM_FMT"
done

# CSI2RX ROUTING
media-ctl -d $media_id -R "'$CSI2RX_NAME' $CSI2RX_FMT_STR"
#media-ctl -d 0 -R '"cdns_csi2rx.30101000.csi-bridge" [0/0 -> 1/0 [1]]'
#media-ctl -d 0 -V '"cdns_csi2rx.30101000.csi-bridge":0/0 [fmt:Y8_1X8/1280x800 field:none colorspace:srgb]'
#media-ctl -d 0 -R '"30102000.ticsi2rx" [0/0 -> 1/0 [1]]'
#media-ctl -d 0 -V '"30102000.ticsi2rx":0/0 [fmt:Y8_1X8/1280x800 field:none colorspace:srgb]'
fi
done
}

setup_isx021
setup_ov2311

# bridge: route both streams into CSI-bridge pad0
media-ctl -d 0 -R '"cdns_csi2rx.30101000.csi-bridge" [0/0 -> 1/0 [1], 0/1 -> 1/1 [1]]'
media-ctl -d 0 -V '"cdns_csi2rx.30101000.csi-bridge":0/0 [fmt:Y8_1X8/1280x800 field:none colorspace:srgb]'
media-ctl -d 0 -V '"cdns_csi2rx.30101000.csi-bridge":0/1 [fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]'

# CSI2RX: context0 ← OV2311, context1 ← ISX021
media-ctl -d 0 -R '"30102000.ticsi2rx" [0/0 -> 1/0 [1], 0/1 -> 2/0 [1]]'
media-ctl -d 0 -V '"30102000.ticsi2rx":0/0 [fmt:Y8_1X8/1280x800 field:none colorspace:srgb]'
media-ctl -d 0 -V '"30102000.ticsi2rx":0/1 [fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]'
```

And here is the `media-ctl -p` output:

root@myd-am62x:~# ./setup_cameras.sh 
ISX021 Camera 0 detected
    device = /dev/video1
    name = isx021
    format = [fmt:UYVY8_1X16/1920x1280 field: none]
    subdev_id = /dev/v4l-subdev5
    isp_required = yes
    ldc_required = no
max96716 1-004c [1/0 -> 3/0 [1]]
OV2311 Camera 0 detected
    device = /dev/video0
    name = ov2311
    format = [fmt:Y8_1X8/1280x800 field: none]
    subdev_id = /dev/v4l-subdev6
    isp_required = yes
    ldc_required = no
max96716 1-004c [0/0 -> 2/0 [1]]
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 -> 3/0 [ACTIVE]
	pad0: Sink
		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
		<- "max96717 1-0040":1 [ENABLED,IMMUTABLE]
	pad1: Sink
		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
		<- "max96717 1-0041":1 [ENABLED,IMMUTABLE]
	pad2: Source
		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
		-> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
	pad3: Source
		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]

- 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]
		<- "ov2311_mipi 1-0010":0 [ENABLED,IMMUTABLE]
	pad1: Source
		[stream:0 fmt:Y8_1X8/1280x800 field:none]
		-> "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]
		<- "isx021_mipi 1-001a":0 [ENABLED,IMMUTABLE]
	pad1: Source
		[stream:0 fmt:UYVY8_1X16/1920x1280 field:none]
		-> "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]


and I get the `Dangling sink streams: mask 0x2` error when I execute the following commands:
```
v4l2-ctl --device /dev/video1 --set-fmt-video=width=1920,height=1280,pixelformat=UYVY --stream-mmap --stream-to=frame.raw --stream-count=1

```

Dmesg output:

[ 7208.698540] j721e-csi2rx 30102000.ticsi2rx: Dangling sink streams: mask 0x2

```

v4l2-ctl --device /dev/video0 --set-fmt-video=width=1280,height=800,pixelformat=GREY --stream-mmap --stream-to=frame.raw --stream-count=1

```

Dmesg output:

[ 7233.079826] j721e-csi2rx 30102000.ticsi2rx: Dangling sink streams: mask 0x2
[ 7233.087193] ------------[ cut here ]------------
[ 7233.091806] WARNING: CPU: 1 PID: 2975 at drivers/media/common/videobuf2/videobuf2-core.c:1063 vb2_buffer_done+0x1b8/0x244 [videobuf2_common]
[ 7233.104421] Modules linked in: cfg80211 rfkill isx021_mipi ov2311_mipi xhci_plat_hcd snd_soc_hdmi_codec rpmsg_ctrl max96717 rpmsg_char dwc3 cdns_csi2rx irq_pruss_intc pru_rproc snd_soc_simple_card snd_soc_simple_card_utils crct10dif_ce display_connector dwc3_am62 rti_wdt j721e_csi2rx tidss sii902x drm_dma_helper ti_k3_r5_remoteproc videobuf2_dma_contig at24 drm_kms_helper videobuf2_memops virtio_rpmsg_bus videobuf2_v4l2 rpmsg_ns ti_k3_m4_remoteproc cfbfillrect max96716 ti_k3_common videobuf2_common v4l2_fwnode syscopyarea cfbimgblt k3_j72xx_bandgap sysfillrect v4l2_async sysimgblt extcon_ptn5150 mcrc fb_sys_fops videodev cfbcopyarea sa2ul snd_soc_davinci_mcasp mc snd_soc_ti_udma rtc_ti_k3 snd_soc_ti_edma m_can_platform snd_soc_ti_sdma m_can pruss cdns_dphy_rx can_dev drm fuse drm_panel_orientation_quirks ipv6
[ 7233.176123] CPU: 1 PID: 2975 Comm: v4l2-ctl Tainted: G        W          6.1.46-g09315e93456b-dirty #12
[ 7233.185500] Hardware name: Texas Instruments K3 AM625 SoC (DT)
[ 7233.191319] pstate: 800000c5 (Nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 7233.198266] pc : vb2_buffer_done+0x1b8/0x244 [videobuf2_common]
[ 7233.204197] lr : ti_csi2rx_cleanup_buffers+0xf4/0x130 [j721e_csi2rx]
[ 7233.210546] sp : ffff800011693a80
[ 7233.213849] x29: ffff800011693a80 x28: ffff0000092fe600 x27: ffff0000039614b8
[ 7233.220976] x26: 0000000000000000 x25: 0000000000000000 x24: ffff0000039615a8
[ 7233.228101] x23: dead000000000100 x22: 0000000000000001 x21: ffff0000039615b8
[ 7233.235226] x20: 0000000000000003 x19: ffff000009db8c00 x18: ffffffffffffffff
[ 7233.242351] x17: 0000000000000000 x16: 0000000000000000 x15: ffff800091693557
[ 7233.249475] x14: 00000000000003a2 x13: 0000000000000001 x12: 0000000000000000
[ 7233.256598] x11: 0000000000000001 x10: 00000000000009b0 x9 : ffff800011693810
[ 7233.263723] x8 : ffff00007f2b9180 x7 : 0000800000000000 x6 : ffff00007f2b91a8
[ 7233.270849] x5 : ffff00007f2b9568 x4 : 0000000000000000 x3 : ffff00000396144c
[ 7233.277975] x2 : ffff0000039615b8 x1 : 0000000000000003 x0 : 0000000000000000
[ 7233.285101] Call trace:
[ 7233.287539]  vb2_buffer_done+0x1b8/0x244 [videobuf2_common]
[ 7233.293117]  ti_csi2rx_cleanup_buffers+0xf4/0x130 [j721e_csi2rx]
[ 7233.299118]  ti_csi2rx_start_streaming+0x6c/0x25c [j721e_csi2rx]
[ 7233.305118]  vb2_start_streaming+0x68/0x15c [videobuf2_common]
[ 7233.310951]  vb2_core_streamon+0x90/0x190 [videobuf2_common]
[ 7233.316612]  vb2_ioctl_streamon+0x5c/0xb0 [videobuf2_v4l2]
[ 7233.322104]  v4l_streamon+0x24/0x30 [videodev]
[ 7233.326622]  __video_do_ioctl+0x184/0x3d0 [videodev]
[ 7233.331632]  video_usercopy+0x214/0x6c4 [videodev]
[ 7233.336468]  video_ioctl2+0x18/0x2c [videodev]
[ 7233.340957]  v4l2_ioctl+0x40/0x60 [videodev]
[ 7233.345272]  __arm64_sys_ioctl+0xa8/0xf0
[ 7233.349193]  invoke_syscall+0x48/0x114
[ 7233.352937]  el0_svc_common.constprop.0+0xd4/0xfc
[ 7233.357632]  do_el0_svc+0x30/0xd0
[ 7233.360940]  el0_svc+0x2c/0x84
[ 7233.363990]  el0t_64_sync_handler+0xbc/0x140
[ 7233.368248]  el0t_64_sync+0x18c/0x190
[ 7233.371905] ---[ end trace 0000000000000000 ]---

Also it may be worth mentioning that below script works:

```

setup_ov2311(){
OV2311_CAM_FMT='[fmt:Y8_1X8/1280x800 field: none]'

i=0
for media_id in {0..0}; do
# MAX96717 FORMATS
MAX96716_FMT_STR="["
CSI2RX_FMT_STR="["
for name in `media-ctl -d $media_id -p | grep entity | grep ov2311_mipi | cut -d ' ' -f 5`; do

CAM_SUBDEV=`media-ctl -d $media_id -p -e "ov2311_mipi $name" | grep v4l-subdev | awk '{print $4}'`

MAX96717_NAME=`media-ctl -d $media_id -p -e "ov2311_mipi $name" | grep max96717 | cut -d "\"" -f 2`
media-ctl -d $media_id -V "'$MAX96717_NAME':0 $OV2311_CAM_FMT"

MAX96716_NAME=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d "\"" -f 2`
MAX96716_PAD=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d : -f 2 | awk '{print $1}'`

CSI_BRIDGE_NAME=`media-ctl -d $media_id -p -e "$MAX96716_NAME" | grep csi-bridge | cut -d "\"" -f 2`

CSI2RX_NAME=`media-ctl -d $media_id -p -e "$CSI_BRIDGE_NAME" | grep "ticsi2rx\"" | cut -d "\"" -f 2`

CSI2RX_CONTEXT_NAME="$CSI2RX_NAME context $MAX96716_PAD"

if [ "$MAX96716_FMT_STR" != "[" ]; then
MAX96716_FMT_STR="${MAX96716_FMT_STR}, "
CSI2RX_FMT_STR="${CSI2RX_FMT_STR}, "
fi
MAX96716_FMT_STR="${MAX96716_FMT_STR}${MAX96716_PAD}/0 -> $(($MAX96716_PAD + 2))/0 [1]"
CSI2RX_FMT_STR="${CSI2RX_FMT_STR}0/${MAX96716_PAD} -> $(($MAX96716_PAD+1))/0 [1]"

echo "OV2311 Camera $i detected"
echo " device = "`media-ctl -d $media_id -p -e "$CSI2RX_CONTEXT_NAME" | grep video | awk '{print $4}'`
echo " name = ov2311"
echo " format = $OV2311_CAM_FMT"
echo " subdev_id = $CAM_SUBDEV"
echo " isp_required = yes"
echo " ldc_required = no"

((i++))
done

MAX96716_FMT_STR="${MAX96716_FMT_STR}]"
CSI2RX_FMT_STR="${CSI2RX_FMT_STR}]"

media-ctl -d $media_id -p | grep entity | grep ov2311_mipi -q
if [ "$?" == "0" ]; then
# MAX96716 ROUTING & FORMATS
echo $MAX96716_NAME $MAX96716_FMT_STR
media-ctl -d $media_id -R "'$MAX96716_NAME' $MAX96716_FMT_STR"
for name in `media-ctl -d $media_id -p | grep entity | grep ov2311_mipi | cut -d ' ' -f 5`; do
MAX96717_NAME=`media-ctl -d $media_id -p -e "ov2311_mipi $name" | grep max96717 | cut -d "\"" -f 2`
MAX96716_NAME=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d "\"" -f 2`
MAX96716_PAD=`media-ctl -d $media_id -p -e "$MAX96717_NAME" | grep max96716 | cut -d : -f 2 | awk '{print $1}'`
media-ctl -d $media_id -V "'$MAX96716_NAME':$MAX96716_PAD $OV2311_CAM_FMT"
done

# CSI2RX ROUTING
media-ctl -d $media_id -R "'$CSI2RX_NAME' $CSI2RX_FMT_STR"
media-ctl -d 0 -R '"cdns_csi2rx.30101000.csi-bridge" [0/0 -> 1/0 [1]]'
media-ctl -d 0 -V '"cdns_csi2rx.30101000.csi-bridge":0/0 [fmt:Y8_1X8/1280x800 field:none colorspace:srgb]'
media-ctl -d 0 -R '"30102000.ticsi2rx" [0/0 -> 1/0 [1]]'
media-ctl -d 0 -V '"30102000.ticsi2rx":0/0 [fmt:Y8_1X8/1280x800 field:none colorspace:srgb]'
fi
done
}

#setup_isx021
setup_ov2311
```
So when I only route the OV2311 everything works and I can get a stream from my camera. But when I add ISX021 camera into my equation, I get the `Dangling sink streams: mask 0x2` error.

Can you give me directions about what is wrong? 

Thanks.

  • Hi,

    I don't think your deserializer is set up properly:

    - 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 -> 3/0 [ACTIVE]
    	pad0: Sink
    		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    		<- "max96717 1-0040":1 [ENABLED,IMMUTABLE]
    	pad1: Sink
    		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    		<- "max96717 1-0041":1 [ENABLED,IMMUTABLE]
    	pad2: Source
    		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    		-> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    	pad3: Source
    		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    

    It should be something like this:

    - 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]
    

    Regards,

    Jianzhong