<?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のトピックRe: v4l2 subdev format and interval</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/v4l2-subdev-format-and-interval/m-p/1303557#M176498</link>
    <description>&lt;P&gt;Hi joanxie,&lt;/P&gt;&lt;P&gt;I use a phyBOARD pollux i.MX 8M Plus with a Linux kernel 5.4.70.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jul 2021 03:56:11 GMT</pubDate>
    <dc:creator>MicMoba</dc:creator>
    <dc:date>2021-07-07T03:56:11Z</dc:date>
    <item>
      <title>v4l2 subdev format and interval</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/v4l2-subdev-format-and-interval/m-p/1290466#M175317</link>
      <description>&lt;P&gt;Hi I have a question to the v4l2 experts.&lt;/P&gt;&lt;P&gt;I have a chip that converts analog video to BT601/BT656. This chip has two modes&lt;/P&gt;&lt;P&gt;1) PAL with &lt;A href="mailto:768x576@25fps" target="_blank" rel="noopener"&gt;768x576@25fps&lt;/A&gt; (progressive)&lt;BR /&gt;2) NTSC with &lt;A href="mailto:640x480@30fps" target="_blank" rel="noopener"&gt;640x480@30fps&lt;/A&gt; (progressive)&lt;/P&gt;&lt;P&gt;The chip is configurable by I2C. So I create a v4l2 subdevice driver based on the ov5640 driver. Now I am a bit confused because of the formats and intervals.&lt;/P&gt;&lt;P&gt;In my understanding the 4vl2_subdev_pad_ops are for getting information and setting formats of the subdevice. I implemented the enum_frame_size and enum_frame_interval functions and I can list the formats with:&lt;BR /&gt;v4l2-ctl -d /dev/video0 --list-formats-ext&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;ioctl: VIDIOC_ENUM_FMT &lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Type: Video Capture Multiplanar&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[0]: 'GREY' (8-bit Greyscale)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Size: Discrete 768x576&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Interval: Discrete 0.040s (25.000 fps)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Size: Discrete 640x480&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Interval: Discrete 0.033s (30.000 fps)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I am not sure if this is correct. The format (with, height and fps) depends on the video standard I set up (PAL/NTSC). Because of that I think maybe it is better to list only the format that is choosen by the video standard, isn't it?&lt;BR /&gt;And how is the right way to set the video standard? By VIDIOC_S_STD or VIDIOC_SUBDEV_S_FMT?&lt;/P&gt;&lt;P&gt;Another miracle is the line &lt;SPAN&gt;&amp;nbsp;[0]: 'GREY' (8-bit Greyscale)&lt;/SPAN&gt;? I set the colorspace to&amp;nbsp; V4L2_COLORSPACE_SRGB and the media bus format to MEDIA_BUS_FMT_UYVY8_2X8. I don't know where the 'GREY' is comming from.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Edit 2021-06-14]&lt;/P&gt;&lt;P&gt;I found out why the formats-list always show 'GREY'. The Media-Bus color code have to match with a color code of imx-isi-cap module. Now I take MEDIA_BUS_FMT_YUYV8_1X16 and the format-list-ext show: &lt;SPAN&gt;&lt;SPAN&gt;[0]: 'YUYV' (YUYV 4:2:2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 08:48:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/v4l2-subdev-format-and-interval/m-p/1290466#M175317</guid>
      <dc:creator>MicMoba</dc:creator>
      <dc:date>2021-06-14T08:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: v4l2 subdev format and interval</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/v4l2-subdev-format-and-interval/m-p/1303496#M176490</link>
      <description>&lt;P&gt;pls add your board and bsp information here, otherwise I don't know how to give you any suggestion&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 02:40:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/v4l2-subdev-format-and-interval/m-p/1303496#M176490</guid>
      <dc:creator>joanxie</dc:creator>
      <dc:date>2021-07-07T02:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: v4l2 subdev format and interval</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/v4l2-subdev-format-and-interval/m-p/1303557#M176498</link>
      <description>&lt;P&gt;Hi joanxie,&lt;/P&gt;&lt;P&gt;I use a phyBOARD pollux i.MX 8M Plus with a Linux kernel 5.4.70.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 03:56:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/v4l2-subdev-format-and-interval/m-p/1303557#M176498</guid>
      <dc:creator>MicMoba</dc:creator>
      <dc:date>2021-07-07T03:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: v4l2 subdev format and interval</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/v4l2-subdev-format-and-interval/m-p/1306521#M176792</link>
      <description>&lt;P&gt;I solved my issue with setting the format over a v4l2-control.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 03:59:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/v4l2-subdev-format-and-interval/m-p/1306521#M176792</guid>
      <dc:creator>MicMoba</dc:creator>
      <dc:date>2021-07-13T03:59:58Z</dc:date>
    </item>
  </channel>
</rss>

