<?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>i.MX ProcessorsのトピックIOCTL VIDIOC_* Error</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1565855#M198442</link>
    <description>&lt;P&gt;I am trying to control MINISASTOCSI camera by IOCTL and VIDIOC_* on&amp;nbsp;MCIMX8M-EVK.&lt;/P&gt;&lt;P&gt;(Reference : i.MX Linux Reference Manual Rev.LF.5.15.52_2.1.0 - 6.5.2.1 V4L2 Capture IOCTLs)&lt;/P&gt;&lt;P&gt;Finally, I need to control camera exposure, gain, white balance and so on.&lt;/P&gt;&lt;P&gt;I tried ioctl and VIDIOC_* on imx-image-multimedia, but only VIDIOC_QUERYCAP is succeed and others (e.q. VIDIOC_G_FMT) is failed. (Invalid argument error)&lt;/P&gt;&lt;P&gt;I have already verified image stream from MINISASTOCSI by "gst-launch-1.0 v4l2src ! autovideosink".&lt;/P&gt;&lt;P&gt;Could you tell me where the below VIDIOC_G_FMT code is wrong ?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;VIDIOC_QUERYCAP&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include &amp;lt;linux/videodev2.h&amp;gt;
#include &amp;lt;sys/ioctl.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;fcntl.h&amp;gt;

int main(){
    /* Open /dev/video0 */
    int fd = open("/dev/video0", O_RDWR, 0);
    if (fd &amp;lt; 0) {
        printf("Failed to open /dev/video0.\n");
        return -1;
    }

    /* IOCTL + VIDIOC_QUERYCAP */
    struct v4l2_capability cap;
    int ret = ioctl(fd, VIDIOC_QUERYCAP, &amp;amp;cap);
    if (ret &amp;lt; 0) {
        perror("ioctl(VIDIOC_QUERYCAP)");
        printf("Failed : ioctl VIDIOC_QUERYCAP.\n");
        return -1;
    }

    close(fd);
    return 1;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;VIDIOC_G_FMT&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include &amp;lt;linux/videodev2.h&amp;gt;
#include &amp;lt;sys/ioctl.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;fcntl.h&amp;gt;

int main(){
    /* Open /dev/video0 */
    int fd = open("/dev/video0", O_RDWR, 0);
    if (fd &amp;lt; 0) {
        printf("Failed to open /dev/video0.\n");
        return -1;
    }

    /* IOCTL + VIDIOC_G_FMT */
    struct v4l2_format fmt = {0};
    int ret = ioctl(fd, VIDIOC_G_FMT, &amp;amp;fmt);
    if (ret &amp;lt; 0) {
        perror("ioctl(VIDIOC_G_FMT)");
        printf("Failed : ioctl VIDIOC_G_FMT.\n");
        return -1;
    }

    close(fd);
    return 1;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Dec 2022 10:12:59 GMT</pubDate>
    <dc:creator>ttoymst</dc:creator>
    <dc:date>2022-12-07T10:12:59Z</dc:date>
    <item>
      <title>IOCTL VIDIOC_* Error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1565855#M198442</link>
      <description>&lt;P&gt;I am trying to control MINISASTOCSI camera by IOCTL and VIDIOC_* on&amp;nbsp;MCIMX8M-EVK.&lt;/P&gt;&lt;P&gt;(Reference : i.MX Linux Reference Manual Rev.LF.5.15.52_2.1.0 - 6.5.2.1 V4L2 Capture IOCTLs)&lt;/P&gt;&lt;P&gt;Finally, I need to control camera exposure, gain, white balance and so on.&lt;/P&gt;&lt;P&gt;I tried ioctl and VIDIOC_* on imx-image-multimedia, but only VIDIOC_QUERYCAP is succeed and others (e.q. VIDIOC_G_FMT) is failed. (Invalid argument error)&lt;/P&gt;&lt;P&gt;I have already verified image stream from MINISASTOCSI by "gst-launch-1.0 v4l2src ! autovideosink".&lt;/P&gt;&lt;P&gt;Could you tell me where the below VIDIOC_G_FMT code is wrong ?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;VIDIOC_QUERYCAP&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include &amp;lt;linux/videodev2.h&amp;gt;
#include &amp;lt;sys/ioctl.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;fcntl.h&amp;gt;

int main(){
    /* Open /dev/video0 */
    int fd = open("/dev/video0", O_RDWR, 0);
    if (fd &amp;lt; 0) {
        printf("Failed to open /dev/video0.\n");
        return -1;
    }

    /* IOCTL + VIDIOC_QUERYCAP */
    struct v4l2_capability cap;
    int ret = ioctl(fd, VIDIOC_QUERYCAP, &amp;amp;cap);
    if (ret &amp;lt; 0) {
        perror("ioctl(VIDIOC_QUERYCAP)");
        printf("Failed : ioctl VIDIOC_QUERYCAP.\n");
        return -1;
    }

    close(fd);
    return 1;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;VIDIOC_G_FMT&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include &amp;lt;linux/videodev2.h&amp;gt;
#include &amp;lt;sys/ioctl.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;fcntl.h&amp;gt;

int main(){
    /* Open /dev/video0 */
    int fd = open("/dev/video0", O_RDWR, 0);
    if (fd &amp;lt; 0) {
        printf("Failed to open /dev/video0.\n");
        return -1;
    }

    /* IOCTL + VIDIOC_G_FMT */
    struct v4l2_format fmt = {0};
    int ret = ioctl(fd, VIDIOC_G_FMT, &amp;amp;fmt);
    if (ret &amp;lt; 0) {
        perror("ioctl(VIDIOC_G_FMT)");
        printf("Failed : ioctl VIDIOC_G_FMT.\n");
        return -1;
    }

    close(fd);
    return 1;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 10:12:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1565855#M198442</guid>
      <dc:creator>ttoymst</dc:creator>
      <dc:date>2022-12-07T10:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: IOCTL VIDIOC_* Error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1571104#M198860</link>
      <description>&lt;P&gt;what imx8m board do you use? imx8mq or imx8mm, imx8mp? let me remind, v4l2-ctl isn't fully compatible OV5640 driver, and development team wouldn't support this, they suggest customer to use gstreamer instead&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 08:54:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1571104#M198860</guid>
      <dc:creator>joanxie</dc:creator>
      <dc:date>2022-12-16T08:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: IOCTL VIDIOC_* Error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1571267#M198877</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;Could you please read my question post again?&lt;/P&gt;&lt;P&gt;(I wrote about the imx board I use, and I am not using v4l-ctrl.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What will I do to control exposure and gain of MINISASTOCSI?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 15:04:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1571267#M198877</guid>
      <dc:creator>ttoymst</dc:creator>
      <dc:date>2022-12-16T15:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: IOCTL VIDIOC_* Error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1571956#M198949</link>
      <description>&lt;P&gt;firstly, many customers treated imx8m series board as imx8m-evk, that's why I double confirmed this from you, secondly, nxp bsp support v4l-ctrl commands, if you need debug your own code, this isn't our support scope, anyway, for v4l2 ioctrl simple code, maybe you can refer to this&lt;/P&gt;
&lt;P&gt;//set format&lt;/P&gt;
&lt;P&gt;struct v4l2_format fmt;&lt;BR /&gt;memset(&amp;amp;fmt, 0, sizeof(fmt));&lt;BR /&gt;fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;&lt;BR /&gt;fmt.fmt.pix.width = VIDEO_WIDTH;&lt;BR /&gt;fmt.fmt.pix.height = VIDEO_HEIGHT;&lt;BR /&gt;fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;&lt;BR /&gt;fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;&lt;BR /&gt;ret = ioctl(fd, VIDIOC_S_FMT, &amp;amp;fmt);&lt;BR /&gt;if (ret &amp;lt; 0) {&lt;BR /&gt;printf("VIDIOC_S_FMT failed (%d)\n", ret);&lt;BR /&gt;return ret;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;//get format&lt;BR /&gt;ret = ioctl(fd, VIDIOC_G_FMT, &amp;amp;fmt);&lt;BR /&gt;if (ret &amp;lt; 0) {&lt;BR /&gt;printf("VIDIOC_G_FMT failed (%d)\n", ret);&lt;BR /&gt;return ret;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 14:24:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1571956#M198949</guid>
      <dc:creator>joanxie</dc:creator>
      <dc:date>2022-12-19T14:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: IOCTL VIDIOC_* Error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1572147#M198969</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I understand the intent of your confirmation about board and chip.&lt;/P&gt;&lt;P&gt;Regarding support scope, am I correct in my understanding that v4l2-ctl does not support to control camera exposure, gain and so on in the default BSP and therefore NXP cannot support to control them?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 00:23:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1572147#M198969</guid>
      <dc:creator>ttoymst</dc:creator>
      <dc:date>2022-12-20T00:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: IOCTL VIDIOC_* Error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1575795#M199340</link>
      <description>&lt;P&gt;as I known, current bsp couldn't support this as default, only support v4l2 ctrl to capture data from mipi csi&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2022 08:19:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IOCTL-VIDIOC-Error/m-p/1575795#M199340</guid>
      <dc:creator>joanxie</dc:creator>
      <dc:date>2022-12-30T08:19:20Z</dc:date>
    </item>
  </channel>
</rss>

