Hello everyone.
I'm facing difficulties trying to make the ov5640 working in a preexisting system which should go with Imx8M ultra lite.
I've managed to configure the dts file and the driver ov5640_mipi_v2.c in order to get the camera working with gst-launch with the following command:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=2592,height=1944, framerate=15/1 ! avimux ! filesink location=./output.avi
And I've correctly managed the driver to support the resolutions framerates i'm interested in.
However problems starts trying to integrate the camera in a software we need to use which rely on various xioctl which seems to not be supported by the driver. Thoose xioctl are VIDIOC_REQBUF, VIDIOC_QUERYBUF, VIDIOC_QUERYCTRL, VIDIOC_G_FMT and for shure some other.
Am I missing some part of the v4l2 infrastructure?
I've tried to face up the VIDIOC_QUERYCTRL missing response to the queryctrl.
According to https://www.kernel.org/doc/html/v4.9/media/kapi/v4l2-controls.html#c.v4l2_query_ext_ctrl I have my ctrl_handler defined inside the ov5640_ctrls of the ov5640 struct (sensor)
const struct v4l2_ctrl_ops *ops = &ov5640_ctrl_ops;
struct ov5640_ctrls *ctrls = &sensor->ctrls;
struct v4l2_ctrl_handler *hdl = &ctrls->handler;
v4l2_ctrl_handler_init(hdl, 32);
after adding some sort of controls like:
ctrls->brightness = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_BRIGHTNESS, -0xff, 0xff, 1, 0);
sensor->subdev.ctrl_handler = hdl;
inside my ov5640_ctrl_ops the s_ctrl function is mapped to my ov5640_s_ctrl function in which I control all the controls request.
Despite all of the implementation seems done to me I think some parts are missing because after a xioctl with VIDIOC_QUERYCTRL nothing of my controls are reported, the call is handled by v4l2_queryctrl in v4l2-ctrls.c
Despite all my ctrls inserted in ov5640_mipi_v2, v4l2-ctl --device=/dev/video0 -l only output this:
User Controls
horizontal_flip 0x00980914 (bool) : default=0 value=0
vertical_flip 0x00980915 (bool) : default=0 value=0
alpha_component 0x00980929 (int) : min=0 max=255 step=1 default=0 value=0
Can I have some guidelines in order to integrate my v4l2 subdev ov5640 driver to the whole system in order to support all the xioctl my application is requesting?