Thread 中讨论的其他器件:AM67、
工具与软件:
我将 CSI 摄像头连接到板、并且传感器已成功探测、但无法通过摄像头捕捉图像。 "v4l2-ctl --stream-mmap"、"yavta -c"或"gst-launch-1.0 v4l2src"均无法捕获图像。 我可能错过了什么?
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.
摄像头采集失败的原因可能有多种。
1.检查视频设备节点
确保使用正确的视频设备节点进行采集。 请参阅此常见问题解答:
2.检查链路频率
需要正确配置传感器和 D-PHY 的链路频率。 参考: https://docs.kernel.org/driver-api/media/tx-rx.html#pixel-rate。
3.配置介质图形
导致捕获失败的最常见错误是介质图形配置不正确。 探测传感器后、需要用户空间正确设置介质图中的实体和布线。 例如、下面是在 AM62A 上探测 IMX219传感器后的介质图:
root@am62axx-evm:~# media-ctl -p -d /dev/media0 Media controller API version 6.6.32 Media device information ------------------------ driver j721e-csi2rx model TI-CSI2RX serial bus info platform:30102000.ticsi2rx hw revision 0x1 driver version 6.6.32 Device topology - entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 routes: 0/0 -> 1/0 [ACTIVE] pad0: Sink [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range] <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE] pad1: Source [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range] -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE] pad2: Source -> "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] pad5: Source -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE] pad6: Source -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE] - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev1 routes: 0/0 -> 1/0 [ACTIVE] pad0: Sink [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range] <- "imx219 4-0010":0 [ENABLED,IMMUTABLE] pad1: Source [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range] -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE] pad2: Source pad3: Source pad4: Source - entity 15: imx219 4-0010 (1 pad, 1 link, 0 routes) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev2 pad0: Source [stream:0 fmt:SRGGB10_1X10/3280x2464 field:none colorspace:raw xfer:none quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
请注意、"imx219 4-0010"的格式与"cdns_csi2rx.30101000.csi-bridge"和"30102000.ticsi2rx"的格式不同。 这种格式不匹配会妨碍图像捕捉正常运行。
要解决此问题、请运行以下命令以更改三个实体之间的格式:
root@am62axx-evm:~# media-ctl -V '"imx219 4-0010":0 [fmt:SRGGB8_1X8/1920x1080 field:none]' root@am62axx-evm:~# media-ctl -V '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:SRGGB8_1X8/1920x1080 field:none]' root@am62axx-evm:~# media-ctl -V '"30102000.ticsi2rx":0 [fmt:SRGGB8_1X8/1920x1080 field:none]'
现在重新运行"media-ctl -p"命令以验证整个媒体图的图像格式是否相同:
root@am62axx-evm:~# media-ctl -p Media controller API version 6.6.32 Media device information ------------------------ driver j721e-csi2rx model TI-CSI2RX serial bus info platform:30102000.ticsi2rx hw revision 0x1 driver version 6.6.32 Device topology - entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 routes: 0/0 -> 1/0 [ACTIVE] pad0: Sink [stream:0 fmt:SRGGB8_1X8/1920x1080 field:none] <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE] pad1: Source [stream:0 fmt:SRGGB8_1X8/1920x1080 field:none] -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE] pad2: Source -> "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] pad5: Source -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE] pad6: Source -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE] - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev1 routes: 0/0 -> 1/0 [ACTIVE] pad0: Sink [stream:0 fmt:SRGGB8_1X8/1920x1080 field:none] <- "imx219 4-0010":0 [ENABLED,IMMUTABLE] pad1: Source [stream:0 fmt:SRGGB8_1X8/1920x1080 field:none] -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE] pad2: Source pad3: Source pad4: Source - entity 15: imx219 4-0010 (1 pad, 1 link, 0 routes) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev2 pad0: Source [stream:0 fmt:SRGGB8_1X8/1920x1080 field:none colorspace:raw xfer:none quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(688,700)/1920x1080] -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
对于具有多个虚拟通道的传感器、请参阅以下有关在媒体图中设置路由的常见问题解答
有关 CSI 摄像头的其他常见问题、请参阅此常见问题解答: