GNOME Bugzilla – Bug 608864
compare to alsasrc, pulsesrc consume much CPU in recording
Last modified: 2010-08-09 00:56:47 UTC
Created attachment 152907 [details] Vtune data for gst audio only recording through pulsesrc. cheese consume too much CPU on netbook. my test is on Aspire One D150 and when I turn off audio but left video only for recording, %CPU decrease a lot (not remember it clearly, maybe ~30%). then I create a simple gst pipeline for audio only recording, %CPU is ~50%. and VTune shows pulse related function plays a lot. so I changed the above pipeline to use alsasrc directly, it could reduce %CPU to ~30%. so, I suggest cheese could add an option to select audio src.
Hi Halley, Would you mind sharing the pipelines you used for your tests? I did a quick test here with the following ones gst-launch-0.10 alsasrc ! queue ! audioconvert ! vorbisenc ! oggmux ! filesink location=prova.ogg gst-launch-0.10 pulsesrc ! queue ! audioconvert ! vorbisenc ! oggmux ! filesink location=prova.ogg Looking at the CPU usage with "top" the first pipeline, the alsa one, consumes 98% of the CPU time while the second, the pulse one stays under 40% (20% in gst-launch and 20% in pulseaudio).
Halley, when you are back from vacation, can Vtune give some breakdown of where in pulseaudio the cpu is spend? I wonder if we see some platform specific bottle-neck here.
pulse+vorbis ~27% (20% gst-launch + 6.5% pulseaudio) gst-launch pulsesrc ! queue ! audioconvert ! vorbisenc ! oggmux ! filesink location=test.ogg alsa+flac ~8.5% gst-launch alsasrc device=hw:0 ! queue ! audioconvert ! flacenc ! oggmux ! filesink location=test.ogg pulse+flac ~16%(13% gst-launch +3% pulseaudio) gst-launch pulsesrc ! queue ! audioconvert ! flacenc ! oggmux ! filesink location=test.ogg we can see that alsa+flac has the better performance data than cheese default, I was told pulseaudio always treat audio data as float consume some CPU here.
*** This bug has been marked as a duplicate of bug 564957 ***