Hi Gibro,<br><br>Thanks for the kind reply. Even I remove the memcpy in v4l2src, the overhead is still there. I guess the overhead is just shifted to another stage that consumes the data. I found the problem was with the coherent buffer used in the driver, since the v4l2 driver I am investigating uses the buffer queue defined in videobuf-dma-contig.c. After I replace the coherent buffers with streaming buffers, the problem goes away. <br>
<br>One correction to my previous email. The memory should &quot;contiguous&quot; instead of &quot;contingent&quot;<br><br>Best regards,<br>Yiliang<br><br><div class="gmail_quote">On Fri, Jan 22, 2010 at 11:48 PM, Gibro Vacco <span dir="ltr">&lt;<a href="mailto:gibrovacco@gmail.com">gibrovacco@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">Hi,<br>
<br>
would it ber possible to mmap the memory are from the driver so that<br>
v4l2src passes that very buffer to the remaining of the pipeline?<br>
<br>
The only problem would be that, in case of a circular buffer in the<br>
driver, each memory area will remain locked until the pipeline has<br>
ended processing it.<br>
<br>
</div><div class="im">On Thu, Jan 21, 2010 at 12:57 AM, yiliang &lt;<a href="mailto:yiliangb@gmail.com">yiliangb@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I am optimizing a V4L2 driver for video capture device. In the v4l2 driver,<br>
&gt; the DMA is performed based on frames using contingent memory buffers. After<br>
&gt; a frame is captured, the frame data is copied to a application buffer in<br>
&gt; v4l2src.<br>
&gt;<br>
&gt; gst_v4l2src_grab_frame()<br>
&gt;  -&gt;     *buf = gst_buffer_copy (pool_buffer);<br>
&gt;<br>
&gt; However, the time spent on copying the buffer is very costly, about 0.01<br>
&gt; seconds, which is very large considering frame time is only 0.033 seconds.<br>
&gt;<br>
&gt; I do not know whether this is the right forum. Any suggestions will be<br>
&gt; appreciated.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Yiliang<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context: <a href="http://n4.nabble.com/Help-needed-to-reduce-unusually-high-CPU-utilization-in-v4l2src-caused-by-memory-copy-tp1019508p1019508.html" target="_blank">http://n4.nabble.com/Help-needed-to-reduce-unusually-high-CPU-utilization-in-v4l2src-caused-by-memory-copy-tp1019508p1019508.html</a><br>

&gt; Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
&gt;<br>
&gt; ------------------------------------------------------------------------------<br>
&gt; Throughout its 18-year history, RSA Conference consistently attracts the<br>
&gt; world&#39;s best and brightest in the field, creating opportunities for Conference<br>
&gt; attendees to learn about information security&#39;s most important issues through<br>
&gt; interactions with peers, luminaries and emerging and established companies.<br>
&gt; <a href="http://p.sf.net/sfu/rsaconf-dev2dev" target="_blank">http://p.sf.net/sfu/rsaconf-dev2dev</a><br>
&gt; _______________________________________________<br>
&gt; gstreamer-devel mailing list<br>
</div>&gt; <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<div class="im">&gt; <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
&gt;<br>
<br>
------------------------------------------------------------------------------<br>
Throughout its 18-year history, RSA Conference consistently attracts the<br>
world&#39;s best and brightest in the field, creating opportunities for Conference<br>
attendees to learn about information security&#39;s most important issues through<br>
interactions with peers, luminaries and emerging and established companies.<br>
<a href="http://p.sf.net/sfu/rsaconf-dev2dev" target="_blank">http://p.sf.net/sfu/rsaconf-dev2dev</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
</div><a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<div><div></div><div class="h5"><a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br>