[meta-freescale] OV5640 autofocus kernel+gstreamer+Qt implementation

Dmitriy B. rzk333 at gmail.com
Tue Sep 29 15:03:15 PDT 2015


2015-09-29 23:10 GMT+03:00 Nikita Yushchenko <nyushchenko at dev.rtsoft.ru>:

> Hi list.
>
> I've recently been working on integrating autofocus functionality of
> OV5640 camera into software stack on imx6-based board.
>
> This mail contains patches to kernel, gstreamer-imx and Qt5 that make
> things somehow working. In particular, declarative-camera example
> focuses ok, custom Qt-based project also does.
>
>
Nice. Thanks for sharing.


>
> Kernel patches are against imx_3.14.28_1.0.0_ga branch.
>
> First patch is generic mxc_v4l2_capture cleanup. Unfortunately driver
> was quite racy and did not survive even streaming stop+start from within
> Qt. Had to do some cleanup to mitigate that.
>
> Second patch contains actual implementation of focus-related v4l ioctls.
>
> Autofocus firmware embedded into patch was taken from
>   http://crewrktablets.arctablet.com:8080/opendev/kernel_rockchip.git,
>   branch rockchip-3.10-rk3288
>   file drivers/media/video/ov5640_af_firmware.c
> and converted to format that existing driver uses. I've tried different
> firmwares found over the net, this one shows the best behaviour.
>

Interesting, you seem to have better implementation of AF than
https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.10.53_1.1.1_ga/drivers/media/platform/mxc/capture/ov5640_mipi.c#L120


> *) Legal status of AF firmware is unclear.
>

Boundarydevices and Arrow (Wandcam) distribute the above mentioned source
of AF firmware for long time now.
Should not be a problem, since they already licensed it. Another question
is if you changed it or distribute unknown Chinese unlicensed manufacturer
firmware.


> *) Setting camera parameters is not implemented. Camera always captures
> at 640x480 with all default settings.
>

boundarydevices implemented that
https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.10.53_1.1.1_ga/drivers/media/platform/mxc/capture/ov5640_mipi.c#L56


>
> *) Middleware (QT plugin + gstreamer) is incomplete and quite unfriendly
> to debug and use. It basically works for trivial scenarios (streaming
> video from camera to viewfinder, starting/stopping, capturing images)
> but tends to fail on anything else. On failure, it just displays
> "CameraBin error" message and stops working. This happens in different
> cases, which includes inaccurate Qt application behavior (such as too
> long frame processing, failing to release buffer in time, etc).
> Extracting details on what happened is possible via GST_DEBUG but is
> quite cumbersome and requires understanding of gstreamer internals.
>
> *) 'imx-ipuv3 2400000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00000001'
> message sometimes appears
>

Carlos might know? I remember seeing something like this when using gst-imx.


> Any comments on all this are welcome.
>
> Nikita Yushchenko,
> System Software Engineer at Software Development Center, RTsoft


BR,
Dmitriy Beykun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-freescale/attachments/20150930/4a44bfb6/attachment.html>


More information about the meta-freescale mailing list