[gst-devel] How to decrease CPU consumation for audio recording?
Zhao, Halley
halley.zhao at intel.com
Thu Dec 17 01:51:10 CET 2009
Finally, I found out pulseaudio play a lot in the audio pipeline, if I access alsasrc, hw:0 directly, it could make %cpu half.
Then I tried flac instead of vorbis, %CPU is decreased another half.
-----Original Message-----
From: Zhao, Halley [mailto:halley.zhao at intel.com]
Sent: 2009年12月15日 9:36
To: 'Stefan Kost'; 'Discussion of the development of GStreamer'
Subject: Re: [gst-devel] How to decrease CPU consumation for audio recording?
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
------------------------------------------------------------------------------
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