Tool/software:
Hi Ti experts,
I am working on interfacing a new OnSemi ToF sensor over MIPI/SCI2.
Using a sample driver from the TISDK (imx219.c) I was able to load my driver an probe successfully my device over i2c.
I modified /opt/edgeai-gst-apps/scripts/setup_cameras.sh script in order to setup the media pipeline for my device.
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
Output from media-ctl -d 1 -p below:
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]
Everything up to this point seems ok (as far as I can tell).
My device reports one source pad SRGGB12_1X12/1280X960 and all other devices in the media pipeline are setup using this format.
Now when I call: v4l2-ctl -d /dev/video-pegasustof-cam0 --get-fmt-video
I get 640x480 UYVY 4:2:2 instead of the expected 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 :
Somehow my sub-device format is not propagated to the video device driver.
If I try and run a user-space application (like app_tiovx_v4l2_capture_moddule_test.c) that opens /dev/video-pegasustof-cam0 I see that starting the stream succeeds in the application but my driver's s_stream routine is never called.
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;
}
When I do the same using a imx219 sensor I can see that the s_stream routime of the imx219.c driver is invoked.
Since my driver is based on imx219.c I expect my s_stream routine to be invoked but unfortunately it is not.
It seem the link between /dev/video-pegasustof-cam0 and /dev/v4l-pegasustof-subdev0 is not complete as indicated by the fact that /dev/video-pegasustof-cam0 format is not that of /dev/v4l-pegasustof-subdev0 and the fact that my s_stream routine is never called.
Any help would be appreciated at this point.