<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic No V4L2 controls implemented on OV5640 mipi driver in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/No-V4L2-controls-implemented-on-OV5640-mipi-driver/m-p/972256#M144772</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the OV5640 mipi camera driver as reference to create a custom driver for a customer on the i.mx6 dartboard evaluation kit. Some V4L2 controls were requested on the driver but the OV5640 does not support any control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sending outputs when testing controls with OV5640 camera:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No controls listed&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;root@var-som-mx6:~# v4l2-ctl -d /dev/video0 -l&lt;BR /&gt;root@var-som-mx6:~# &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Controls always marked as uknown&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;root@var-som-mx6:~# v4l2-ctl -d /dev/video0 --get-ctrl=gain &lt;BR /&gt;unknown control 'gain'&lt;BR /&gt;root@var-som-mx6:~# v4l2-ctl -d /dev/video0 --set-ctrl=gain=100 &lt;BR /&gt;unknown control 'gain'&lt;BR /&gt;root@var-som-mx6:~# &lt;BR /&gt;root@var-som-mx6:~# v4l2-ctl -d /dev/video0 --get-ctrl=exposure &lt;BR /&gt;unknown control 'exposure'&lt;BR /&gt;root@var-som-mx6:~# &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I implement controls on the driver?&lt;BR /&gt;Any example/help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Oct 2019 20:09:22 GMT</pubDate>
    <dc:creator>greivin_fallas</dc:creator>
    <dc:date>2019-10-10T20:09:22Z</dc:date>
    <item>
      <title>No V4L2 controls implemented on OV5640 mipi driver</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/No-V4L2-controls-implemented-on-OV5640-mipi-driver/m-p/972256#M144772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the OV5640 mipi camera driver as reference to create a custom driver for a customer on the i.mx6 dartboard evaluation kit. Some V4L2 controls were requested on the driver but the OV5640 does not support any control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sending outputs when testing controls with OV5640 camera:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No controls listed&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;root@var-som-mx6:~# v4l2-ctl -d /dev/video0 -l&lt;BR /&gt;root@var-som-mx6:~# &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Controls always marked as uknown&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;root@var-som-mx6:~# v4l2-ctl -d /dev/video0 --get-ctrl=gain &lt;BR /&gt;unknown control 'gain'&lt;BR /&gt;root@var-som-mx6:~# v4l2-ctl -d /dev/video0 --set-ctrl=gain=100 &lt;BR /&gt;unknown control 'gain'&lt;BR /&gt;root@var-som-mx6:~# &lt;BR /&gt;root@var-som-mx6:~# v4l2-ctl -d /dev/video0 --get-ctrl=exposure &lt;BR /&gt;unknown control 'exposure'&lt;BR /&gt;root@var-som-mx6:~# &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I implement controls on the driver?&lt;BR /&gt;Any example/help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2019 20:09:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/No-V4L2-controls-implemented-on-OV5640-mipi-driver/m-p/972256#M144772</guid>
      <dc:creator>greivin_fallas</dc:creator>
      <dc:date>2019-10-10T20:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: No V4L2 controls implemented on OV5640 mipi driver</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/No-V4L2-controls-implemented-on-OV5640-mipi-driver/m-p/972257#M144773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check the Chapter 6.1 in i.MX_Reference_Manual.pdf for the camera and V4L2 in details.&lt;/P&gt;&lt;P&gt;Document can be downloaded from here:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/design/i.mx-developer-resources/i.mx-software-and-development-tool:IMX-SW" title="https://www.nxp.com/design/i.mx-developer-resources/i.mx-software-and-development-tool:IMX-SW"&gt;i.MX Software | NXP&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2019 10:28:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/No-V4L2-controls-implemented-on-OV5640-mipi-driver/m-p/972257#M144773</guid>
      <dc:creator>jimmychan</dc:creator>
      <dc:date>2019-10-15T10:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: No V4L2 controls implemented on OV5640 mipi driver</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/No-V4L2-controls-implemented-on-OV5640-mipi-driver/m-p/972258#M144774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not find a correct way to enable camera controls using V4L2 utils (V4L2-ctl) or YAVTA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only way that I found to use controls on the driver was using v4l2 set/get calls from imxv4l2videosrc.&lt;BR /&gt;I had to create extra properties on the imxv4l2videosrc plugins to accept gain/exposure as properties, after processing the received value, it was send to V4L2 core through V4L2 IOCTL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;static int v4l2_s_ctrl(GstImxV4l2VideoSrc *v4l2src, int id, int value)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;struct v4l2_control control;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;int ret;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;GST_LOG_OBJECT(v4l2src, "VIDIOC_S_CTRL(%s, %d)", ctrl_name(id), value);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;control.id = id;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;control.value = value;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;ret = ioctl(GST_IMX_FD_OBJECT_GET_FD(v4l2src-&amp;gt;fd_obj_v4l), VIDIOC_S_CTRL, &amp;amp;control);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (ret &amp;lt; 0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;GST_LOG_OBJECT(v4l2src, "VIDIOC_S_CTRL(%s, %d) failed", ctrl_name(id), value);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;GST_LOG_OBJECT(v4l2src, "VIDIOC_S_CTRL(%s, %d) succeed", ctrl_name(id), value);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return ret;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The V4L2 core processes the control ID and calls the custom callback from driver according to V4L2 control ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;v4l2_s_ctrl(v4l2src, V4L2_CID_EXPOSURE, v4l2src-&amp;gt;custom_exposure);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Switch-case from V4L2 core that processes the V4L2 ID (mxc_v4l2_capture.c):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;case V4L2_CID_EXPOSURE:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;pr_debug("mxc_v4l2_s_ctrl: V4L2_CID_EXPOSURE\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (cam-&amp;gt;sensor) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ret = vidioc_int_s_ctrl(cam-&amp;gt;sensor, c); //calls driver's set controls function&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;} else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;pr_err("ERROR: v4l2 capture: slave not found!\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ret = -ENODEV;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;break;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps other developers to implement V4L2 controls.&lt;BR /&gt;Regards,&lt;BR /&gt;Greivin F.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2019 01:04:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/No-V4L2-controls-implemented-on-OV5640-mipi-driver/m-p/972258#M144774</guid>
      <dc:creator>greivin_fallas</dc:creator>
      <dc:date>2019-10-24T01:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: No V4L2 controls implemented on OV5640 mipi driver</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/No-V4L2-controls-implemented-on-OV5640-mipi-driver/m-p/972259#M144775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same problem reported by&amp;nbsp;Greivin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't list the controls of the driver using&amp;nbsp;&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;v4l2-ctl -d /dev/video0 -l&amp;nbsp;&lt;/SPAN&gt;therefore&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;v4l2-ctl&lt;/SPAN&gt;&amp;nbsp;can't read or write a control neither. I have seen that mxc_v4l2_capture.c does implement&amp;nbsp;VIDIOC_QUERYCTRL&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you confirm if NXP kernel doesn't support the standard procedure to read and write a v4l2 control?&lt;/P&gt;&lt;P&gt;Is there some patch to add this support?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-Manuel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2019 15:13:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/No-V4L2-controls-implemented-on-OV5640-mipi-driver/m-p/972259#M144775</guid>
      <dc:creator>manuelleiva</dc:creator>
      <dc:date>2019-10-25T15:13:12Z</dc:date>
    </item>
  </channel>
</rss>

