GNOME Bugzilla – Bug 601897
100% CPU usage when playing any audio file
Last modified: 2009-12-14 10:18:18 UTC
Rhythmbox consumes 100% of the CPU when playing any audio file (tested both MP3 and FLAC). The CPU usage is only high during playback. The CPU usage goes down to zero if paused. I have experienced the same issue with several other media players including Banshee. Totem however seems to be unaffected. This leads me to believe it's related to a problem in gstreamer..? Attaching output of rhythmbox -d Original bug report: https://bugs.launchpad.net/ubuntu/+source/rhythmbox/+bug/451171
Created attachment 147721 [details] Output of rhythmbox -d
If you run 'gst-launch-0.10 playbin uri=file:///path/to/file.mp3' in a terminal, does it also suffer from this problem?
er, make that 'playbin2 uri=...', actually.
(In reply to comment #2) > If you run 'gst-launch-0.10 playbin uri=file:///path/to/file.mp3' in a > terminal, does it also suffer from this problem? No, it does not seem to suffer from this problem. CPU usage is low when using gst-launch.
OK, how about this: $ gst-launch-0.10 playbin2 uri=file:///path/to/file.mp3 audio-sink='audioconvert ! tee ! queue ! gconfaudiosink profile=1' Do you have the rhythmbox visualization plugin enabled?
The last command does indeed cause my CPU usage to jump to 100%! I had the visualization plugin enabled, but the problem persists also when it's disabled.
*** Bug 601841 has been marked as a duplicate of this bug. ***
OK, try with just "audio-sink='gconfaudiosink profile=1'". What output do you get from gst-launch-0.10? What versions of gstreamer, gst-plugins-base, and gst-plugins-good are you using?
(In reply to comment #8) > OK, try with just "audio-sink='gconfaudiosink profile=1'". What output do you > get from gst-launch-0.10? Same behaviour - CPU usage jumps to 100%. $ gst-launch-0.10 playbin2 uri=file:///media/FarPort/Music/MP3/Rage\ Against\ the\ Machine/The\ Battle\ of\ Los\ Angeles/01\ -\ Testify.mp3 audio-sink='gconfaudiosink profile=1' Setting pipeline to PAUSED ... Pipeline is PREROLLING ... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstAudioSinkClock ^CCaught interrupt -- handling interrupt. Interrupt: Stopping pipeline ... Execution ended after 4210520367 ns. Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ... > What versions of gstreamer, gst-plugins-base, and gst-plugins-good are you > using? libgstreamer0.10-0 0.10.25-2 gstreamer0.10-plugins-base 0.10.25-2ubuntu1 gstreamer0.10-plugins-good 0.10.16-1ubuntu3 (Latest Ubuntu Karmic packages)
Upon running all your commands and checking the versions, they all come out the same as Johannes H. Jensen's results.
Further investigation revealed that my default audio sink is set to alsasink in gconf. Using audio-sink='alsasink' in the command above causes high CPU usage. Using audio-sink='pulsesink' however does not. This leads me to believe that the problem is with the ALSA -> pulseaudio audio setup which redirects sound from ALSA to pulseaudio.
For what it's worth, I can't reproduce this on my ubuntu karmic install. I guess the thing to do now is to report this bug against pulseaudio.
Are there any work-arounds? Could we force rhythmbox/banshee/etc to skip ALSA and use pulseaudio instead?
(In reply to comment #13) > Are there any work-arounds? Could we force rhythmbox/banshee/etc to skip ALSA > and use pulseaudio instead? Yes, fire up gconf-editor, navigate to /system/gstreamer/0.10/default and set audiosink, chataudiosink and musicaudiosink to their default 'autoaudiosink' (right click -> Unset key)
Works great, thanks.
(In reply to comment #12) > For what it's worth, I can't reproduce this on my ubuntu karmic install. > > I guess the thing to do now is to report this bug against pulseaudio. Are you sure it's a problem with pulseaudio and not with gstreamer? For example, running: aplay /usr/share/sounds/login.wav does not seem to use an excessive amount of CPU, while: gst-launch-0.10 playbin2 uri=file:///usr/share/sounds/login.wav audio-sink='alsasink' increases CPU to 100% until playback is complete. Both route traffic through pulsaudio - they show up under Applications in Sound Preferences as ALSA plug-in.
You can follow that up with the GStreamer developers if you like.
Is this also using all CPU? gst-launch audiotestsrc ! alsasink
Hmm, I'm no longer able to reproduce this on my karmic system. Maybe this was fixed in some upgrade to gstreamer/pulseaudio. The only change in versions I can detect is: gstreamer0.10-plugins-base 0.10.25-2ubuntu1.1 Feel free to close this bug.