After sucessful pm-suspend / resume cycle pulseaudio sound streams are not resumed. Reproducible: Always Steps to Reproduce: 1. pulseaudio -D 2. mplayer 3. pm-suspend 4. resume PC Actual Results: mplayer is not playing. have to pulseaudio -k pulseaudio -D reload all streams to get sound working. Expected Results: Sound working after resume. This script fixes this really anoying thing as it suspends all sinks and sources before S3. I actually don't know where it belongs (pulseaudio or pm-utils). psyche sleep.d # pwd /usr/lib/pm-utils/sleep.d psyche sleep.d # cat 01PulseAudio #!/bin/sh . "${PM_FUNCTIONS}" get_pulse_users() { echo $(ps aux | awk '/pulseaudio -D/ {print $1}') } suspend_pulse() { for i in $(get_pulse_users); do echo 'suspend 1' | sudo -u $i pacmd &> /dev/null done } resume_pulse() { for i in $(get_pulse_users); do echo 'suspend 0' | sudo -u $i pacmd &> /dev/null done } case $1 in hibernate|suspend) suspend_pulse ;; thaw|resume) resume_pulse ;; *) exit $NA ;; esac exit 0 psyche sleep.d #
I'd say pulseaudio but you can propose it to pm-utils mailing list. Also could you please attach your script instead of pasting it as a comment. Makes it easier to pick and test. Which is your pm-utils version btw ?
Created attachment 188776 [details] pulseaudio suspend script
using sys-power/pm-utils-1.2.3-r1
Created attachment 188778 [details] better version changed get_pulse_users, not returning root now
This is REALLY best done through pulseaudio, and not pm-utils: http://cgit.freedesktop.org/pm-utils/tree/README.distributions A couple projects do this already (wicd comes to mind). This could probably be done in our pm-utils package, but probably best with pulseaudio itself.
reassigning to sound as this is also what I think is the best option.
I cannot reproduce it now - I have Amarok playing through pulseaudio in KDE and audio restarts playing upon suspending end resuming using pm-utils.
Arun, thoughts ?
I bet this has been solved in a way upower handles it on it's own now... This is only an educated guess.
Ubuntu has a more complex hook: http://bazaar.launchpad.net/~ubuntu-core-dev/pulseaudio/ubuntu.2a/view/head:/debian/01PulseAudio
I don't know where upower (or whatver) stores these hooks, but on GNOME, I don't face this problem.
I cannot reproduce this problems for a long time, please try with a newer release like 4.99.4
(In reply to Pacho Ramos from comment #12) > I cannot reproduce this problems for a long time, please try with a newer > release like 4.99.4 Let me guess. You have sys-power/upower built with USE="systemd"? Then it won't use pm-utils, and obviously you won't hit the problem. But since I don't use pulseaudio myself and I can't test this, I'm leaving this closed, since I can't be 100% sure this wasn't fixed in some other way in later pulseaudio releases that I don't off-hand understand.
But I remember it was still working ok when I was using consolekit/openRC (that months that I was using it with Gnome 3.8 when we were trying to make them play together)