Wow, that was an incredibly fast response, thank you!
That's very helpful. I think I already have the device tree adjustments I needed, but it's very helpful to have those confirmed.
I think I follow about the media controller, those multiple nodes are enabling each camera. I found the thread on the ADV7482 viewtopic.php?t=285492 which is very informative. I'm working on internalizing that information now...
I'm actually at the point that I have some signs of life, though my resolution isn't configured correctly. At first, I tried setting up the embedded video stream as in the IMX477s, but I think I understand now that was not the right approach and I should have stayed closer to the original implementation. I reverted, and also went with the slightly simpler set of pads in that mailing list submission (thank you for that link!) and now I'm definitely exactly where you suggested: setting up the media-ctrl links. There are some examples in an Avnet python script and This V4L2 tutorial
Interestingly, I was getting output in the gst-device-monitor when I had ripped out some of the media-ctrl bindings (but I think that's because I'm not linking things properly...)
I have the following media-ctl links:But the formatting ones get an error:I don't think this is directly related yet, but I'm getting this printout from unicam: I've been working to understand the connection flow of the v4l2 format as it interacts with unicam. Specifically, I saw "v4l2_subdev_get_try_format" sometimes return all 0s, (ap1302_get_fmt is the v4l2_subdev_pad_ops get_fmt, and calls ap1302_get_pad_format, then v4l2_subdev_get_pad_format with those requests)
Tomorrow, I'm going to try to see if I can increase the verbosity or add some logs into the unicam, v4l2, and media controller modules to see if I can track this down better. If you have tips, I'm happy to take them - you've already been a massive help, so thank you!
That's very helpful. I think I already have the device tree adjustments I needed, but it's very helpful to have those confirmed.
I think I follow about the media controller, those multiple nodes are enabling each camera. I found the thread on the ADV7482 viewtopic.php?t=285492 which is very informative. I'm working on internalizing that information now...
I'm actually at the point that I have some signs of life, though my resolution isn't configured correctly. At first, I tried setting up the embedded video stream as in the IMX477s, but I think I understand now that was not the right approach and I should have stayed closer to the original implementation. I reverted, and also went with the slightly simpler set of pads in that mailing list submission (thank you for that link!) and now I'm definitely exactly where you suggested: setting up the media-ctrl links. There are some examples in an Avnet python script and This V4L2 tutorial
Code:
$ media-ctl --print-topologyMedia controller API version 6.6.22Media device information------------------------driver unicammodel unicamserial bus info platform:fe801000.csihw revision 0x0driver version 6.6.22Device topology- entity 1: ap1302.10-003c (3 pads, 3 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev2pad0: Sink[fmt:SGRBG12_1X12/1280x800 field:none colorspace:srgb crop.bounds:(0,0)/2560x800 crop:(0,0)/2560x800]<- "ar0144 0":0 [ENABLED,IMMUTABLE]pad1: Sink[fmt:SGRBG12_1X12/1280x800 field:none colorspace:srgb crop.bounds:(0,0)/2560x800 crop:(0,0)/2560x800]<- "ar0144 1":0 [ENABLED,IMMUTABLE]pad2: Source[fmt:UYVY8_1X16/2560x800 field:none colorspace:srgb crop.bounds:(0,0)/2560x800 crop:(0,0)/2560x800]-> "unicam-image":0 [ENABLED,IMMUTABLE]- entity 5: ar0144 0 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev0pad0: Source[fmt:SGRBG12_1X12/1280x800 field:none colorspace:srgb]-> "ap1302.10-003c":0 [ENABLED,IMMUTABLE]- entity 9: ar0144 1 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev1pad0: Source[fmt:SGRBG12_1X12/1280x800 field:none colorspace:srgb]-> "ap1302.10-003c":1 [ENABLED,IMMUTABLE]- entity 13: unicam-image (1 pad, 1 link) type Node subtype V4L flags 1 device node name /dev/video0pad0: Sink<- "ap1302.10-003c":2 [ENABLED,IMMUTABLE]$ v4l2-ctl --log-statusStatus Log: [ 2172.235924] unicam fe801000.csi: ================= START STATUS ================= [ 2172.259454] ap1302 10-003c: log > F(0) 0/0 [ 2172.259473] ap1302 10-003c: log > S(132) ^M <<... a bunch of other ap1302 log printouts showing no errors or warnings, and the frame counters>> [ 2172.267628] unicam fe801000.csi: -----Receiver status----- [ 2172.267636] unicam fe801000.csi: V4L2 width/height: 2560x800 [ 2172.267645] unicam fe801000.csi: Mediabus format: 0000200f [ 2172.267653] unicam fe801000.csi: V4L2 format: 59565955 [ 2172.267688] unicam fe801000.csi: Unpacking/packing: 0 / 0 [ 2172.267697] unicam fe801000.csi: ----Live data---- [ 2172.267703] unicam fe801000.csi: Programmed stride: 5120 [ 2172.267711] unicam fe801000.csi: Detected resolution: 0x0 [ 2172.267718] unicam fe801000.csi: Write pointer: cee00000 [ 2172.267726] unicam fe801000.csi: ================== END STATUS ==================$ gst-device-monitor-1.0 | grep unicam -A 50
Interestingly, I was getting output in the gst-device-monitor when I had ripped out some of the media-ctrl bindings (but I think that's because I'm not linking things properly...)
I have the following media-ctl links:
Code:
# Succeedmedia-ctl -v -d /dev/media0 -l '"ar0144 0":0 -> "ap1302.10-003c":0[1]'media-ctl -v -d /dev/media0 -l '"ar0144 1":0 -> "ap1302.10-003c":1[1]'media-ctl -v -d /dev/media0 -l '"ap1302.10-003c":2 -> "unicam-image":0[1]'# Failsudo media-ctl -v -d /dev/media0 -V "'ar0144 0':0 [fmt:UYVY8_1X16/1280x800 field:none]"sudo media-ctl -v -d /dev/media0 -V "'ar0144 1':0 [fmt:UYVY8_1X16/1280x800 field:none]"sudo media-ctl -v -d /dev/media0 -V "'ap1302.10-003c':2 [fmt:UYVY8_1X16/2560x800 field:none]"
Code:
$ sudo media-ctl -v -d /dev/media0 -V "'ar0144 0':0 [fmt:UYVY8_1X16/1280x800 field:none]"Opening media device /dev/media0Enumerating entitieslooking up device: 81:17looking up device: 81:15looking up device: 81:16looking up device: 81:14Found 4 entitiesEnumerating pads and linksSetting up format UYVY8_1X16 1280x800 on pad ar0144 0/0Unable to set format: Operation not permitted (-1)Unable to setup formats: Operation not permitted (1)
Code:
[ 2293.159305] unicam fe801000.csi: unicam_enum_fmt_vid_cap subdev->enum_mbus_code idx 1 returned -22 - index invalid
Code:
[ 5753.337475] ap1302 10-003c: ap1302_get_fmt() pad[2] 1[ 5736.018285] ap1302 10-003c: ap1302_get_pad_format() call v4l2_subdev_get_pad_format, got format [1095722144] 0x0 code:0000... from ...dev_info(ap1302->dev, "%s() pad[%d] %d\n", __func__, fmt->pad, fmt->which);dev_info(ap1302->dev, "%s() got format %dx%d code:%04x\n", __func__, fmt->width, fmt->height, fmt->code);
Tomorrow, I'm going to try to see if I can increase the verbosity or add some logs into the unicam, v4l2, and media controller modules to see if I can track this down better. If you have tips, I'm happy to take them - you've already been a massive help, so thank you!
Statistics: Posted by nb-5 — Fri May 24, 2024 12:12 am