[gst-devel] How to decrease CPU consumation for audio recording?

Zhao, Halley halley.zhao at intel.com
Tue Dec 15 02:35:51 CET 2009


Thanks for your suggestion.
But further information shows vorbisenc doesn't matter much in the pipeline.
Either fakesink or vorbisenc will consume 50+% CPU, but arecord only 4% CPU.
I will use C programming to identify it is not caused by gst-launch.
Maybe buffer size matter here.



=== audio only + fakesink
gst-launch alsasrc ! audio/x-raw-int, rate=8000 ! queue ! fakesink
gst-launch 51%CPU, pulseaudio 13%CPU

=== save audio to ogg/vorbis
gst-launch alsasrc ! audio/x-raw-int, rate=8000, width=16, depth=16, channel=1 ! queue ! audioconvert ! vorbisenc ! oggmux ! filesink location=test-audio.ogg
gst-launch 57%CPU, pulseaudio 13%CPU

=== arecord and drop data 
arecord >/dev/null
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
arecord 4.3%, pulseaudio 2.2%

=== arecord save to file
arecord >test.wav
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
arecord 4.4%, pulseaudio 2.3%

-----Original Message-----
From: Stefan Kost [mailto:ensonic at hora-obscura.de] 
Sent: 2009年12月15日 6:05
To: Discussion of the development of GStreamer
Cc: Zhao, Halley
Subject: Re: [gst-devel] How to decrease CPU consumation for audio recording?

Am 14.12.2009 08:53, schrieb Zhao, Halley:
> I have a simple audio recording pipeline as below. To my surprise it
> consumes CPU as high as a 640x480 video recording. Could it be optimized
> to use CPU less?
> 
> gst-launch alsasrc ! audio/x-raw-int, rate=8000, width=16, depth=16,
> channel=1 ! queue ! audioconvert ! vorbisenc ! oggmux ! filesink
> location=test-audio.ogg

1.) optimize vorbis
2.) add orc opimizations to audioconvert (vorbis-enc wants float input)
3.) we need some optimizations for such pipleines so that audioencoder and
audiosrc can negotiate a (max-)buffer size. the encoder would then provide
pad_alloc (resuable buffers). this needs same work on audioconvert too

Stefan

> 
>  
> 
> on a netbook with ATOM 1.6GHZ, ~90 %CPU.
> 
>  
> 
> Thanks in advance.
> 
>  
> 
>  
> 
> *ZHAO, Halley (Aihua)*
> 
> Email: halley.zhao at intel.com <BLOCKED::mailto:aihua.zhao at intel.com>
> 
> Tel: +86(21)61166476
> 
> iNet: 8821-6476
> 
> SSG/OTC/Moblin 3W038 Pole: F4
> 
>  
> 
> 
> 
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> 
> 
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list