工具/软件:
尊敬的 TI 专家:
我正在努力通过 MIPI/SCI2连接全新的 OnSemi ToF 传感器。
使用 TISDK 中的示例驱动程序(imx219.c)、我能够通过 i2c 成功地加载驱动程序和探头。
我修改了/opt/edgeai-gst-apps/scripts/setup_cameras.sh 脚本、以便为我的器件设置媒体流水线。
Pegasus ToF Camera 1 detected device = /dev/video-pegasustof-cam0 name = Pegasus ToF format = [fmt:SRGGB12_1X12/1280x960] subdev_id = /dev/v4l-pegasustof-subdev0 isp_required = yes
下面的 media-ctl -d 1 -p 的输出:
media-ctl -d 1 -p Media controller API version 6.6.44 Media device information ------------------------ driver j721e-csi2rx model TI-CSI2RX serial bus info platform:30122000.ticsi2rx hw revision 0x1 driver version 6.6.44 Device topology - entity 1: 30122000.ticsi2rx (5 pads, 5 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:SRGGB12_1X12/1280x960 field:none] <- "cdns_csi2rx.30121000.csi-bridge":1 [ENABLED,IMMUTABLE] pad1: Source [stream:0 fmt:SRGGB12_1X12/1280x960 field:none] -> "30122000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE] pad2: Source -> "30122000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE] pad3: Source -> "30122000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE] pad4: Source -> "30122000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE] - entity 7: cdns_csi2rx.30121000.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:SRGGB12_1X12/1280x960 field:none] <- "pegasustof 6-003c":0 [ENABLED,IMMUTABLE] pad1: Source [stream:0 fmt:SRGGB12_1X12/1280x960 field:none] -> "30122000.ticsi2rx":0 [ENABLED,IMMUTABLE] pad2: Source pad3: Source pad4: Source - entity 13: pegasustof 6-003c (1 pad, 1 link, 0 routes) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev2 pad0: Source [stream:0 fmt:SRGGB12_1X12/1280x960 field:none colorspace:raw xfer:none quantization:full-range crop.bounds:(64,44)/1280x960 crop:(64,44)/1280x960] -> "cdns_csi2rx.30121000.csi-bridge":0 [ENABLED,IMMUTABLE] - entity 19: 30122000.ticsi2rx context 0 (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video2 pad0: Sink <- "30122000.ticsi2rx":1 [ENABLED,IMMUTABLE] - entity 25: 30122000.ticsi2rx context 1 (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video3 pad0: Sink <- "30122000.ticsi2rx":2 [ENABLED,IMMUTABLE] - entity 31: 30122000.ticsi2rx context 2 (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video4 pad0: Sink <- "30122000.ticsi2rx":3 [ENABLED,IMMUTABLE] - entity 37: 30122000.ticsi2rx context 3 (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video5 pad0: Sink <- "30122000.ticsi2rx":4 [ENABLED,IMMUTABLE]
到目前为止的一切似乎都可以(就我所能说的而言)。
我的器件报告一个源板 SRGGB12_1x12/1280x960、介质流水线中的所有其他器件均使用此格式设置。
现在、当我调用: v4l2-ctl -d /dev/video-pegasustof-cam0 --get-fmt-video
我得到640x480 UYVY 4:2:2、而不是预期的1280x960 SRGGB12。
v4l2-ctl -d /dev/video-pegasustof-cam0 --get-fmt-video Format Video Capture: Width/Height : 640/480 Pixel Format : 'UYVY' (UYVY 4:2:2) Field : None Bytes per Line : 1280 Size Image : 614400 Colorspace : sRGB Transfer Function : sRGB YCbCr/HSV Encoding: ITU-R 601 Quantization : Limited Range Flags :
我的子设备格式不会传播到视频设备驱动程序。
如果我尝试运行打开 /dev/video-pegasustof-cam0的用户空间应用程序(如 app_tiovx_v4l2_capture_module_test.c)、我会看到在应用程序中启动流成功、但从未调用我驱动程序的 s_stream 例程。
int v4l2_capture_start(v4l2CaptureHandle *handle) { int status = 0; enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (-1 == xioctl(handle->fd, VIDIOC_STREAMON, &type)) { TIOVX_MODULE_ERROR("[V4L2_CAPTURE] VIDIOC_STREAMON failed\n"); status = -1; } sleep(V4L2_CAPTURE_STREAMON_DELAY); return status; }
当我使用 imx219传感器执行相同操作时、我可以看到 imx219.c 驱动程序的 s_stream routtime 被调用。
由于我的驱动程序基于 imx219.c、因此我预计会调用我的 s_stream 例程、但很遗憾、它不会被调用。
/dev/video-pegasustof-cam0和 /dev/v4l-pegasustof-subdev0之间的链接似乎并不完整、因为/dev/video-pegasustof-cam0格式不是/dev/v4l-pegasustof-subdev0的格式、并且从未调用过我的 s_stream 例程这一事实表明了这一点。
欢迎您在此处提供任何帮助。