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 601897 - 100% CPU usage when playing any audio file
100% CPU usage when playing any audio file
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.25
Other Linux
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 601841 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-11-14 13:07 UTC by Johannes H. Jensen
Modified: 2009-12-14 10:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Output of rhythmbox -d (85.58 KB, application/x-bzip2)
2009-11-14 13:09 UTC, Johannes H. Jensen
Details

Description Johannes H. Jensen 2009-11-14 13:07:21 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
Comment 1 Johannes H. Jensen 2009-11-14 13:09:41 UTC
Created attachment 147721 [details]
Output of rhythmbox -d
Comment 2 Jonathan Matthew 2009-11-14 21:19:26 UTC
If you run 'gst-launch-0.10 playbin uri=file:///path/to/file.mp3' in a terminal, does it also suffer from this problem?
Comment 3 Jonathan Matthew 2009-11-14 21:19:46 UTC
er, make that 'playbin2 uri=...', actually.
Comment 4 Johannes H. Jensen 2009-11-14 21:24:15 UTC
(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.
Comment 5 Jonathan Matthew 2009-11-14 21:37:33 UTC
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?
Comment 6 Johannes H. Jensen 2009-11-14 21:44:13 UTC
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.
Comment 7 Jonathan Matthew 2009-11-14 21:45:37 UTC
*** Bug 601841 has been marked as a duplicate of this bug. ***
Comment 8 Jonathan Matthew 2009-11-14 21:47:27 UTC
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?
Comment 9 Johannes H. Jensen 2009-11-14 21:55:44 UTC
(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)
Comment 10 swordphsh 2009-11-14 22:00:54 UTC
Upon running all your commands and checking the versions, they all come out the same as Johannes H. Jensen's results.
Comment 11 Johannes H. Jensen 2009-11-14 22:02:35 UTC
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.
Comment 12 Jonathan Matthew 2009-11-14 22:16:28 UTC
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.
Comment 13 swordphsh 2009-11-14 22:24:52 UTC
Are there any work-arounds? Could we force rhythmbox/banshee/etc to skip ALSA and use pulseaudio instead?
Comment 14 Johannes H. Jensen 2009-11-14 22:32:00 UTC
(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)
Comment 15 swordphsh 2009-11-14 22:35:58 UTC
Works great, thanks.
Comment 16 Johannes H. Jensen 2009-11-14 22:53:47 UTC
(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.
Comment 17 Jonathan Matthew 2009-11-14 23:41:23 UTC
You can follow that up with the GStreamer developers if you like.
Comment 18 Wim Taymans 2009-12-10 16:17:08 UTC
Is this also using all CPU?

gst-launch audiotestsrc ! alsasink
Comment 19 Johannes H. Jensen 2009-12-13 19:19:59 UTC
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.