<?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のトピックImx7 ov5640 request buffer problem</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Imx7-ov5640-request-buffer-problem/m-p/694823#M107707</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using imx7 saber board ov5640_mipi.c driver.&lt;/P&gt;&lt;P&gt;I have a problem in using the camera driver available at drivers/media/platform/mxc/subdev/ in linux-4.1.15 kernel.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On 1st time, i was able to get buffer from mxc_v4l2_capture.c (available in imx-test-5.7). But when i looped the following code in mxc_v4l2_capture application, i end up in REQ_BUF Failure from the driver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;fd_v4l = v4l_capture_setup();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;v4l_capture_test(fd_v4l, argv[argc-1]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;On debugging found that VIDIOC_REQBUFS ioctl &amp;nbsp;__buffers_in_use(q) more than 1 (2 active users).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On commenting drivers/media/v4l2-core/videobuf2-core.c __reqbufs function, i was able to run mxc_v4l2_capture.out multiple times with out error&lt;/P&gt;&lt;P&gt;#if 0&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (q-&amp;gt;memory == V4L2_MEMORY_MMAP &amp;amp;&amp;amp; __buffers_in_use(q)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mutex_unlock(&amp;amp;q-&amp;gt;mmap_lock);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;dprintk(1, "memory in use, cannot free\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printk("%s %s %d\n", __FILE__, __func__, __LINE__);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return -EBUSY;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;#endif&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Queries&lt;/P&gt;&lt;P&gt;1. buf-&amp;gt;refcount is 2, when the buffers are trying to free at drivers/media/v4l2-core/videobuf2-dma-contig.c vb2_dc_put function and the complete freeing only done at vb2_queue_release drivers/media/v4l2-core/videobuf2-core.c called at the end of application execution. How come refcount becomes 2 (Please refer patch and logs) ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Is there any other stable branch for imx7 saber board camera driver ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Ananth.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336173"&gt;Modification_debug.patch.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336173"&gt;default_working_log.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Sep 2017 13:48:14 GMT</pubDate>
    <dc:creator>Ananth</dc:creator>
    <dc:date>2017-09-28T13:48:14Z</dc:date>
    <item>
      <title>Imx7 ov5640 request buffer problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Imx7-ov5640-request-buffer-problem/m-p/694823#M107707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using imx7 saber board ov5640_mipi.c driver.&lt;/P&gt;&lt;P&gt;I have a problem in using the camera driver available at drivers/media/platform/mxc/subdev/ in linux-4.1.15 kernel.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On 1st time, i was able to get buffer from mxc_v4l2_capture.c (available in imx-test-5.7). But when i looped the following code in mxc_v4l2_capture application, i end up in REQ_BUF Failure from the driver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;fd_v4l = v4l_capture_setup();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;v4l_capture_test(fd_v4l, argv[argc-1]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;On debugging found that VIDIOC_REQBUFS ioctl &amp;nbsp;__buffers_in_use(q) more than 1 (2 active users).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On commenting drivers/media/v4l2-core/videobuf2-core.c __reqbufs function, i was able to run mxc_v4l2_capture.out multiple times with out error&lt;/P&gt;&lt;P&gt;#if 0&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (q-&amp;gt;memory == V4L2_MEMORY_MMAP &amp;amp;&amp;amp; __buffers_in_use(q)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mutex_unlock(&amp;amp;q-&amp;gt;mmap_lock);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;dprintk(1, "memory in use, cannot free\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printk("%s %s %d\n", __FILE__, __func__, __LINE__);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return -EBUSY;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;#endif&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Queries&lt;/P&gt;&lt;P&gt;1. buf-&amp;gt;refcount is 2, when the buffers are trying to free at drivers/media/v4l2-core/videobuf2-dma-contig.c vb2_dc_put function and the complete freeing only done at vb2_queue_release drivers/media/v4l2-core/videobuf2-core.c called at the end of application execution. How come refcount becomes 2 (Please refer patch and logs) ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Is there any other stable branch for imx7 saber board camera driver ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Ananth.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336173"&gt;Modification_debug.patch.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336173"&gt;default_working_log.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2017 13:48:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Imx7-ov5640-request-buffer-problem/m-p/694823#M107707</guid>
      <dc:creator>Ananth</dc:creator>
      <dc:date>2017-09-28T13:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Imx7 ov5640 request buffer problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Imx7-ov5640-request-buffer-problem/m-p/694824#M107708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems that you have to clearly release the buffer after executing v4l_capture_test. Please try it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Artur&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 09:17:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Imx7-ov5640-request-buffer-problem/m-p/694824#M107708</guid>
      <dc:creator>art</dc:creator>
      <dc:date>2017-09-29T09:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Imx7 ov5640 request buffer problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Imx7-ov5640-request-buffer-problem/m-p/694825#M107709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Artur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Do we have any sample application which runs on imx7 with repeatedly doing Streamoff and streamon for camera driver ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Ananth.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Sep 2017 04:41:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Imx7-ov5640-request-buffer-problem/m-p/694825#M107709</guid>
      <dc:creator>Ananth</dc:creator>
      <dc:date>2017-09-30T04:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Imx7 ov5640 request buffer problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Imx7-ov5640-request-buffer-problem/m-p/694826#M107710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is the buffers are not freed property from driver.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After stream off is performed the buffers should be freed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. With reqbuf ioctl send count =0.&lt;/P&gt;&lt;P&gt;2. mmaped buffers should be freed using munmap API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ananth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2017 04:53:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Imx7-ov5640-request-buffer-problem/m-p/694826#M107710</guid>
      <dc:creator>Ananth</dc:creator>
      <dc:date>2017-10-04T04:53:22Z</dc:date>
    </item>
  </channel>
</rss>

