After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608864 - compare to alsasrc, pulsesrc consume much CPU in recording
compare to alsasrc, pulsesrc consume much CPU in recording
Status: RESOLVED DUPLICATE of bug 564957
Product: cheese
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: 2.28
Assigned To: Cheese Maintainer(s)
Cheese Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-02-03 07:18 UTC by Zhao, Halley
Modified: 2010-08-09 00:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Vtune data for gst audio only recording through pulsesrc. (51.86 KB, image/png)
2010-02-03 07:18 UTC, Zhao, Halley
Details

Description Zhao, Halley 2010-02-03 07:18:04 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.
Comment 1 Filippo Argiolas 2010-02-03 08:42:46 UTC
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).
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2010-02-15 14:31:22 UTC
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.
Comment 3 Zhao, Halley 2010-02-20 07:33:40 UTC
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.
Comment 4 daniel g. siegel 2010-08-09 00:56:47 UTC

*** This bug has been marked as a duplicate of bug 564957 ***