Tool/software:
Hello,
We are using monochrome sensor and it will give Y8/Y10 data. Currently we are at sensor bring-up stage. and trying to test with EVM AM62A-LP.
In image sensor driver our v4l2 set_pad_format is implemented as below:
static int set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { struct i2c_client *client = v4l2_get_subdevdata(sd); struct sensor *priv = to_sensor(client); const struct sensor_mode *mode; if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) return 0; mode = sensor_find_best_fit(fmt); if(mode->sensor_depth==8) fmt->format.code = MEDIA_BUS_FMT_Y8_1X8; if(mode->sensor_depth==10) { fmt->format.code = MEDIA_BUS_FMT_Y10_1X10; } fmt->format.width = mode->width; fmt->format.height = mode->height; fmt->format.field = V4L2_FIELD_NONE; priv->mode = mode; return 0; }
With above we are receiving error as below when trying to capture image using yavta tool.
root@am62axx-evm:/opt# ./yavta -F /dev/video-rpi-cam0 --capture=2 --list-controls Device /dev/video-rpi-cam0 opened. Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes. unable to query control 0xc0000000: Inappropriate ioctl for device (25). Video format: UYVY (59565955) 1920x1080 (stride 3840) field none buffer size 4147200 8 buffers requested. length: 4147200 offset: 0 timestamp type/source: mono/EoF Buffer 0/0 mapped at address 0xffff8503b000. length: 4147200 offset: 4149248 timestamp type/source: mono/EoF Buffer 1/0 mapped at address 0xffff84c46000. length: 4147200 offset: 8298496 timestamp type/source: mono/EoF Buffer 2/0 mapped at address 0xffff84851000. length: 4147200 offset: 12447744 timestamp type/source: mono/EoF Buffer 3/0 mapped at address 0xffff8445c000. length: 4147200 offset: 16596992 timestamp type/source: mono/EoF Buffer 4/0 mapped at address 0xffff84067000. length: 4147200 offset: 20746240 timestamp type/source: mono/EoF Buffer 5/0 mapped at address 0xffff83c72000. length: 4147200 offset: 24895488 timestamp type/source: mono/EoF Buffer 6/0 mapped at address 0xffff8387d000. length: 4147200 offset: 29044736 timestamp type/source: mono/EoF Buffer 7/0 mapped at address 0xffff83488000. Unable to start streaming: Broken pipe (32). 8 buffers released. root@am62axx-evm:/opt#
Then in further investigation we tried to set image format using below command:
root@am62axx-evm:~# media-ctl -V '"ar0235 4-0036":0 [fmt:Y10_1X10/1920x1200 field:none]' --verbose Opening media device /dev/media0 Enumerating entities looking up device: 81:9 looking up device: 81:10 looking up device: 81:11 looking up device: 81:3 looking up device: 81:4 looking up device: 81:5 looking up device: 81:6 looking up device: 81:7 looking up device: 81:8 Found 9 entities Enumerating pads and links Setting up format Y10_1X10 1920x1200 on pad ar0235 4-0036/0/0 Format set: Y10_1X10 1920x1200 Setting up format Y10_1X10 1920x1200 on pad cdns_csi2rx.30101000.csi-bridge/0/0 Format set: YUYV8_1X16 1920x1200
In above output we comes to know that the cdns_csi2rx driver is not supporting this format so it is keeping as YUYV8_1X16 1920x1200 instead of Y10. Is there any patch available to support this format in cdns_csi2rx driver?
Just to check impact with other supported format changes below line in set pad format function of driver
Removed => fmt->format.code = MEDIA_BUS_FMT_Y10_1X10;
Replaced With => fmt->format.code = MEDIA_BUS_FMT_SRGGB10_1X10;
With this we are able to set SRGGB10 format at both as below:
root@am62axx-evm:~# media-ctl -V '"ar0235 4-0036":0 [fmt:SRGGB10_1X10/1920x1200 field:none]' --verbose Opening media device /dev/media0 Enumerating entities looking up device: 81:9 looking up device: 81:10 looking up device: 81:11 looking up device: 81:3 looking up device: 81:4 looking up device: 81:5 looking up device: 81:6 looking up device: 81:7 looking up device: 81:8 Found 9 entities Enumerating pads and links Setting up format SRGGB10_1X10 1920x1200 on pad ar0235 4-0036/0/0 Format set: SRGGB10_1X10 1920x1200 Setting up format SRGGB10_1X10 1920x1200 on pad cdns_csi2rx.30101000.csi-bridge/0/0 Format set: SRGGB10_1X10 1920x1200 root@am62axx-evm:~#
Questions:
1. Does CSI Driver supports Y10_1X10 and Y8_1X8 formats?
2. If Y10_1X10 formats are not supported then how we can get monochrome 8 and 10 bit data from image sensor?
Thanks,
Jaimin