Comment 17 for bug 312505

Cory Maccarrone (darkstar6262) wrote :

In /usr/lib/pm-utils/sleep.d/01PulseAudio, I noticed that the output of the function get_pulse_users() was returning my user ID as a number, not as the name of the user. Further down, that's used in the "sudh -H -u" commands, but sudo will only take a number UID if you enclose it in quotes and add a number sign:

    sudo -H -u $i pactl suspend-sink 1 &> /dev/null

becomes

    sudo -H -u "#$i" pactl suspend-sink 1 &> /dev/null

Making this change to all the instances of that made suspend start working for me every time.

Try running the command:

    ps aux | awk '/\/usr\/bin\/pulseaudio --start/ {print $1}'

It's the same as is used in that get_pulse_users() function. If it returns a number, the above fix is needed. At least, it worked for me.