<?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 Re: iMX8MP - ISP Using V4L2 Interface in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1484577#M192186</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/109210"&gt;@malik_cisse&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Thanks for your reply.I know quite well about &lt;STRONG&gt;&lt;A href="https://forums.developer.nvidia.com/t/usb-ptp-gadget-function-on-jetson-boards/219686" target="_blank"&gt;vvext&lt;/A&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The requirement of my client is that they would only use &lt;EM&gt;gst-launch&lt;/EM&gt; for streaming and maybe &lt;EM&gt;v4l2-ctl&lt;/EM&gt; for controlling the ISP parameters (which is WDR3 in my case).&lt;/P&gt;&lt;P&gt;Anyway, I found a work-around to do that in low level layer.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Khang&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2022 09:51:31 GMT</pubDate>
    <dc:creator>khang_letruong</dc:creator>
    <dc:date>2022-07-05T09:51:31Z</dc:date>
    <item>
      <title>iMX8MP - ISP Using V4L2 Interface</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1483617#M192121</link>
      <description>&lt;P&gt;Dear NXP Teams,&lt;/P&gt;&lt;P&gt;In order to use the ISP V4L2&amp;nbsp;API of iMX8MP that is described in &lt;STRONG&gt;Chapter 3 - ISP Using V4L2 Interface&lt;/STRONG&gt; of &lt;EM&gt;i.MX_8M_Plus_Camera_and_Display_Guide.pdf&lt;/EM&gt; document, I was looking for its source code / implementation of which location indicated as following&amp;nbsp; :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="V4L2_Components-LF_5.10.52.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/185363i304180A5E3ECAF43/image-size/large?v=v2&amp;amp;px=999" role="button" title="V4L2_Components-LF_5.10.52.png" alt="V4L2_Components-LF_5.10.52.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I looked in &lt;A href="https://source.codeaurora.org/external/imx/isp-vvcam/" target="_blank"&gt;https://source.codeaurora.org/external/imx/isp-vvcam/&lt;/A&gt; with associated branch (lf-5.10.52-2.1.0) but unable to find the location/folder mentioned in above document.&lt;/P&gt;&lt;P&gt;Could you help to clarify? Knowing that I am using LF-5.10.52.&lt;/P&gt;&lt;P&gt;Thanks in advance and best regards,&lt;BR /&gt;Khang&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 06:12:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1483617#M192121</guid>
      <dc:creator>khang_letruong</dc:creator>
      <dc:date>2022-07-02T06:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MP - ISP Using V4L2 Interface</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1483632#M192124</link>
      <description>&lt;P&gt;This is part of the isp-imx-4.2.2.16.0 package. You can find it in the Yocto build.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 15:29:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1483632#M192124</guid>
      <dc:creator>artsiomstaliaro</dc:creator>
      <dc:date>2022-07-02T15:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MP - ISP Using V4L2 Interface</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1484485#M192183</link>
      <description>&lt;P&gt;Hi Khang,&lt;/P&gt;&lt;P&gt;What do you actually want to do?&lt;/P&gt;&lt;P&gt;as artsiomstaliaro said the v4L2 API examples are in isp-imx rather than isp-vvcam.&lt;/P&gt;&lt;P&gt;You will find a rather good example that does open V4L2 device, ISP process video, Downscale, configure ISP and render video on display using DRM. I tested it and it works great. Here is the full path:&lt;BR /&gt;&lt;STRONG&gt;isp-imx-4.***\appshell\v4l_drm_test\video_test.cpp&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I did not find the folder mentioned in the doc either. I think NXP reused some docs from verisilicon without updating the path. It is hard to find the resources when following the pointers in the doc.&lt;/P&gt;&lt;P&gt;In order to configure the ISP dynamically (e.g set CCM Matrix, AWB, Gamma, etc.) you can use vvext example:&lt;BR /&gt;&lt;STRONG&gt;isp-imx-4.2.2.11.0\appshell\vvext\vvext.cpp&lt;/STRONG&gt;&lt;BR /&gt;I used this successfully also. The only problem I had, is trying to compile this in a minimal self-contained environment.&lt;BR /&gt;I had to compile it within its original folder hierarchy.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 08:13:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1484485#M192183</guid>
      <dc:creator>malik_cisse</dc:creator>
      <dc:date>2022-07-05T08:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MP - ISP Using V4L2 Interface</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1484577#M192186</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/109210"&gt;@malik_cisse&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Thanks for your reply.I know quite well about &lt;STRONG&gt;&lt;A href="https://forums.developer.nvidia.com/t/usb-ptp-gadget-function-on-jetson-boards/219686" target="_blank"&gt;vvext&lt;/A&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The requirement of my client is that they would only use &lt;EM&gt;gst-launch&lt;/EM&gt; for streaming and maybe &lt;EM&gt;v4l2-ctl&lt;/EM&gt; for controlling the ISP parameters (which is WDR3 in my case).&lt;/P&gt;&lt;P&gt;Anyway, I found a work-around to do that in low level layer.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Khang&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 09:51:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1484577#M192186</guid>
      <dc:creator>khang_letruong</dc:creator>
      <dc:date>2022-07-05T09:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MP - ISP Using V4L2 Interface</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1543696#M196838</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;SPAN&gt;khang_letruong:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I'm also porting a camera IMX415 need to use ISP, could you show me how to use V4L2 to control it ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thank you very much.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 02:26:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1543696#M196838</guid>
      <dc:creator>jiangyaqiang</dc:creator>
      <dc:date>2022-10-26T02:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MP - ISP Using V4L2 Interface</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1543949#M196861</link>
      <description>&lt;P&gt;Hi jiangyaqiang&lt;/P&gt;&lt;P&gt;I would also like to know how Khang Letruong solve the issue.&lt;BR /&gt;Here is how I solved it.&lt;BR /&gt;The core processing is actually quite simple. For example enabling gamma correction is done as follows:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;int viv_private_ioctl(const char *cmd, Json::Value&amp;amp; jsonRequest, Json::Value&amp;amp; jsonResponse) {
    if (!cmd) {
        ALOGE("cmd should not be null!");
        return -1;
    }
    jsonRequest["id"] = cmd;
    jsonRequest["streamid"] = streamid;

    struct v4l2_ext_controls ecs;
    struct v4l2_ext_control ec;
    memset(&amp;amp;ecs, 0, sizeof(ecs));
    memset(&amp;amp;ec, 0, sizeof(ec));
    ec.string = new char[VIV_JSON_BUFFER_SIZE];
    ec.id = V4L2_CID_VIV_EXTCTRL;
    ec.size = 0;
    ecs.controls = &amp;amp;ec;
    ecs.count = 1;

    ::ioctl(fd, VIDIOC_G_EXT_CTRLS, &amp;amp;ecs);

    strcpy(ec.string, jsonRequest.toStyledString().c_str());

    int ret = ::ioctl(fd, VIDIOC_S_EXT_CTRLS, &amp;amp;ecs);
    if (ret != 0) {
        ALOGE("failed to set ext ctrl\n");
        goto end;
    } else {
        ::ioctl(fd, VIDIOC_G_EXT_CTRLS, &amp;amp;ecs);
        Json::Reader reader;
        reader.parse(ec.string, jsonResponse, true);
        delete ec.string;
        ec.string = NULL;
        return jsonResponse["MC_RET"].asInt();
    }

end:
     delete ec.string;
     ec.string = NULL;
    return S_EXT_FLAG;
}

/*************************GAMMA**************************/
void enableGamma(bool enable)
{
    strError = enable ? "GAMMA enabled": "GAMMA disabled";
    Json::Value jRequest, jResponse;
    jRequest[GC_ENABLE_PARAMS] = enable;
    viv_private_ioctl(IF_GC_S_EN, jRequest, jResponse);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is all based on&amp;nbsp; &lt;STRONG&gt;VIDIOC_S_EXT_CTRLS&lt;/STRONG&gt; as described in&amp;nbsp;" &lt;STRONG&gt;i.MX 8M Plus ISP Using V4L2 Interface User Guide&lt;/STRONG&gt;" chap 2.5 Feature control API.&lt;/P&gt;&lt;P&gt;I could implement this using&amp;nbsp;isp-imx-4.2.2.11.0\appshell\vvext\&lt;STRONG&gt;vvext.cpp&lt;/STRONG&gt; as template. So far I was not able to compile this in a minimalistic environment only using v4l2 API and JSON library.&lt;/P&gt;&lt;P&gt;I am eager to see if Khang Letruong or someone else managed to do that before.&lt;BR /&gt;Full source code is in attachment.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 09:01:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1543949#M196861</guid>
      <dc:creator>malik_cisse</dc:creator>
      <dc:date>2022-10-26T09:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MP - ISP Using V4L2 Interface</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1543969#M196863</link>
      <description>&lt;P&gt;HI malik_cisse:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I have impplemented my camera driver by reference to vvcam/v4l2/sensor/ov2775/ov2775_mipi_v3.c,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;and I want to test it by command&amp;nbsp; /opt/imx8-isp/bin/video_test&amp;nbsp; or gst-launch, but both of them fail.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;gst-launch fail in&amp;nbsp;vidioc_reqbufs( Failed to allocate required memory.).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;video_test fail in&amp;nbsp;:Get Caps Supports Failed.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; maybe there is something wrong in my driver.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 09:37:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1543969#M196863</guid>
      <dc:creator>jiangyaqiang</dc:creator>
      <dc:date>2022-10-26T09:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MP - ISP Using V4L2 Interface</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1583105#M200166</link>
      <description>&lt;P&gt;Hi Khang,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;When you say:&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;The requirement of my client is that they would only use&amp;nbsp;gst-launch&amp;nbsp;for streaming and maybe&amp;nbsp;v4l2-ctl&amp;nbsp;for controlling the ISP parameters (which is WDR3 in my case).&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;Anyway, I found a work-around to do that in low level layer.&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How do you control WDR3 in this case not using vvext?&lt;BR /&gt;I am still struggling making the ISP API work outside of vvext.&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 10:09:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1583105#M200166</guid>
      <dc:creator>malik_cisse</dc:creator>
      <dc:date>2023-01-16T10:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MP - ISP Using V4L2 Interface</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1583113#M200169</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/109210"&gt;@malik_cisse&lt;/a&gt; ,&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;How do you control WDR3 in this case not using vvext?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I did not need to have WDR3 on so I hard-coded it to off in the driver.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;I am still struggling making the ISP API work outside of vvext.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;vvext is an example of using JSON request for controlling ISP parameters.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Khang.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 10:17:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MP-ISP-Using-V4L2-Interface/m-p/1583113#M200169</guid>
      <dc:creator>khang_letruong</dc:creator>
      <dc:date>2023-01-16T10:17:38Z</dc:date>
    </item>
  </channel>
</rss>

