GNOME Bugzilla – Bug 522336
Change Playbin state back to NULL on error and EOS : fix potential memory leak when using pulsaudio
Last modified: 2008-03-16 19:00:06 UTC
Please describe the problem: gnome-power-manager never change state of the playbin back to NULL when it play sound event. This as multiple problems : - lock indefinitely the mixer when using ALSA as gstreamer audio sink : No possibilty to start for ex. pulsaudio without killing gnome-power-manager. - Create an HUGE leak when using pulsaudio as gstreamer audio sink and for some reasons pulsaudio crash, or you terminate the stream in pavucontrol. Don't know what cause this leak but in 2min this leaded to a total freeze (65% of memory). Steps to reproduce: 1. Do an event that play a sound. Unplug/plug your ac power for ex. Actual results: If you use ALSA : lsof | grep /dev/snd show indefinitely gnome-power-manager. If you use pulsaudio : Look at pavucontrol, see the gnome-power-manager stream setting there. Terminate the stream (right click) and see gnome-power-manager taking more and more ressource. Expected results: Nothing like that Does this happen every time? yes Other information: I'll post a patch to stop the stream properly by watching message bus.
Created attachment 107255 [details] [review] Watch gst message bus for EOS or error message.
Well done for finding this! Thanks! 2008-03-16 Richard Hughes <richard@hughsie.com> * src/gpm-sound.c: (gpm_sound_gst_bus_cb), (gpm_sound_init): We never change state of the playbin back to NULL when playing a sound event. This as multiple problems : - lock indefinitely the mixer when using ALSA as gstreamer audio sink : - Create an HUGE leak when using pulsaudio as gstreamer audio sink and for some reasons pulsaudio crash, or you terminate the stream in pavucontrol. Patch by Florent Mertens <outpourav@yahoo.fr>, and slightly tweaked by me. Fixes #522336