Need help in integrating ov13850 sensor support

Hi,

I am trying to add ov13850 sensor support in Debian build with kernel-4.14. Has anyone worked on this?
Any references for driver and media controller pipeline configuration commands will be helpful.

@Loic
@todortomov
Thanks,
Arun

Do you have the driver for this sensor, upstream Linux seems to have support for ov13858, not sure it’s entirely compatible. You can also use a downstream driver (e.g.https://github.com/rockchip-linux/kernel/blob/release-4.4/drivers/media/i2c/ov13850.c). the first thing you need to check is that the driver correctly initialize the sensor. You’ll have to create a node in the devicetree in the same way as for ov5640 or ov5645.

@Loic
@todortomov

Thanks Loic for the reply. I have added the driver support and added dts entry. sensor probed properly.

[ 477.233948] ov13850 5-0010: Detected OV00d850 sensor, REVISION 0xb2
[ 477.244468] ov13850 5-0010: probing successful

$media-ctl -d /dev/media0 -p

  • entity 226: ov13850 5-0010 (1 pad, 1 link)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev19
    pad0: Source
    [fmt:SBGGR10_1X10/2112x1568 field:none]
    -> “msm_csiphy0”:0 [ENABLED,IMMUTABLE]

configured media controller pipeline like below,
sudo media-ctl -d /dev/media0 -l ‘“msm_csiphy0”:1->“msm_csid0”:0[1],“msm_csid0”:1->“msm_ispif0”:0[1],“msm_ispif0”:1->“msm_vfe0_rdi0”:0[1]’

sudo media-ctl -d /dev/media0 ‘“ov13850 5-0010”:0[fmt:SBGGR10_1X10/2112x1568 field:none],“msm_csiphy0”:0[fmt:SBGGR10_1X10/2112x1568 field:none],“msm_csid0”:0[fmt:SBGGR10_1X10/2112x1568 field:none],“msm_ispif0”:0[fmt:SBGGR10_1X10/2112x1568 field:none],“msm_vfe0_rdi0”:0[fmt:SBGGR10_1X10/2112x1568 field:none]’

#video stream
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-bayer,format=rggb,width=2112,height=1568’ ! bayer2rgb ! glimagesink

getting errors,
Setting pipeline to PAUSED …
error: XDG_RUNTIME_DIR not set in the environment.
Pipeline is live and does not need PREROLL …
Got context from element ‘sink’: gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"(GstGLDisplayX11)\ gldisplayx11-0";
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
gstv4l2src.c(658): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.459702627
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Any idea to debug this?
Thanks,
Arun

Maybe try to increase verbosity (e.g. export GST_DEBUG=5) before running this command, to get more details.

Thanks @Loic
able to collect raw dumps with ov13850 using yavta tool
do you suggest any converters for 10 bit Bayer raw to RGB format.

Thanks,
Arum

Unfortunately, I don’t have a really good solution for this.

Well, ideally you should check with gstreamer community if there is upcoming or existing downstream support for raw10 packed support (especially to use gpu acceleration), AFAIK, only raw8 is currently supported.

Alternatively you can convert the raw10 frame to raw8 (discarding one byte every fifth byte), and use gstreamer to handle raw8.

I personally have a converter based on opencv, to convert a raw10 frame to RGB, then bmp:
https://people.linaro.org/~loic.poulain/scripts/raw10p2rgb.py
I don’t think it’s optimal, but you can give it a try.

Finally, another solution would be to implment convertion with the DSP, but this would be a different story.

Thank you :smiley: @Loic