<div>Run oprofile to get detail breakup of the CPU consumption by each element.</div>
<div>Even I had similar high CPU load issues with gstreamer. Oprofile helped a lot. </div>
<div> </div>
<div>Regards,</div>
<div>Viraj<br><br><br><br></div>
<div class="gmail_quote">2009/12/17 Zhao, Halley <span dir="ltr"><<a href="mailto:halley.zhao@intel.com">halley.zhao@intel.com</a>></span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Finally, I found out pulseaudio play a lot in the audio pipeline, if I access alsasrc, hw:0 directly, it could make %cpu half.<br>
<br>Then I tried flac instead of vorbis, %CPU is decreased another half.<br><br><br>-----Original Message-----<br>From: Zhao, Halley [mailto:<a href="mailto:halley.zhao@intel.com">halley.zhao@intel.com</a>]<br>Sent: 2009年12月15日 9:36<br>
To: 'Stefan Kost'; 'Discussion of the development of GStreamer'<br>Subject: Re: [gst-devel] How to decrease CPU consumation for audio recording?<br><br>Thanks for your suggestion.<br>But further information shows vorbisenc doesn't matter much in the pipeline.<br>
Either fakesink or vorbisenc will consume 50+% CPU, but arecord only 4% CPU.<br>I will use C programming to identify it is not caused by gst-launch.<br>Maybe buffer size matter here.<br><br><br><br>=== audio only + fakesink<br>
gst-launch alsasrc ! audio/x-raw-int, rate=8000 ! queue ! fakesink<br>gst-launch 51%CPU, pulseaudio 13%CPU<br><br>=== save audio to ogg/vorbis<br>gst-launch alsasrc ! audio/x-raw-int, rate=8000, width=16, depth=16, channel=1 ! queue ! audioconvert ! vorbisenc ! oggmux ! filesink location=test-audio.ogg<br>
gst-launch 57%CPU, pulseaudio 13%CPU<br><br>=== arecord and drop data<br>arecord >/dev/null<br>Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono<br>arecord 4.3%, pulseaudio 2.2%<br><br>=== arecord save to file<br>
arecord >test.wav<br>Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono<br>arecord 4.4%, pulseaudio 2.3%<br><br>-----Original Message-----<br>From: Stefan Kost [mailto:<a href="mailto:ensonic@hora-obscura.de">ensonic@hora-obscura.de</a>]<br>
Sent: 2009年12月15日 6:05<br>To: Discussion of the development of GStreamer<br>Cc: Zhao, Halley<br>Subject: Re: [gst-devel] How to decrease CPU consumation for audio recording?<br><br>Am 14.12.2009 08:53, schrieb Zhao, Halley:<br>
> I have a simple audio recording pipeline as below. To my surprise it<br>> consumes CPU as high as a 640x480 video recording. Could it be optimized<br>> to use CPU less?<br>><br>> gst-launch alsasrc ! audio/x-raw-int, rate=8000, width=16, depth=16,<br>
> channel=1 ! queue ! audioconvert ! vorbisenc ! oggmux ! filesink<br>> location=test-audio.ogg<br><br>1.) optimize vorbis<br>2.) add orc opimizations to audioconvert (vorbis-enc wants float input)<br>3.) we need some optimizations for such pipleines so that audioencoder and<br>
audiosrc can negotiate a (max-)buffer size. the encoder would then provide<br>pad_alloc (resuable buffers). this needs same work on audioconvert too<br><br>Stefan<br><br>><br>><br>><br>> on a netbook with ATOM 1.6GHZ, ~90 %CPU.<br>
><br>><br>><br>> Thanks in advance.<br>><br>><br>><br>><br>><br>> *ZHAO, Halley (Aihua)*<br>><br>> Email: <a href="mailto:halley.zhao@intel.com">halley.zhao@intel.com</a> <BLOCKED::mailto:<a href="mailto:aihua.zhao@intel.com">aihua.zhao@intel.com</a>><br>
><br>> Tel: +86(21)61166476<br>><br>> iNet: 8821-6476<br>><br>> SSG/OTC/Moblin 3W038 Pole: F4<br>><br>><br>><br>><br>><br>> ------------------------------------------------------------------------------<br>
> Return on Information:<br>> Google Enterprise Search pays you back<br>> Get the facts.<br>> <a href="http://p.sf.net/sfu/google-dev2dev" target="_blank">http://p.sf.net/sfu/google-dev2dev</a><br>><br>><br>
><br>> _______________________________________________<br>> gstreamer-devel mailing list<br>> <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
<br>------------------------------------------------------------------------------<br>Return on Information:<br>Google Enterprise Search pays you back<br>Get the facts.<br><a href="http://p.sf.net/sfu/google-dev2dev" target="_blank">http://p.sf.net/sfu/google-dev2dev</a><br>
_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
------------------------------------------------------------------------------<br>This SF.Net email is sponsored by the Verizon Developer Community<br>Take advantage of Verizon's best-in-class app development support<br>
A streamlined, 14 day to market process makes app distribution fast and easy<br>Join now and get one step closer to millions of Verizon customers<br><a href="http://p.sf.net/sfu/verizon-dev2dev" target="_blank">http://p.sf.net/sfu/verizon-dev2dev</a><br>
_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</blockquote></div><br>