No sound on wake, Dummy Output always takes over. 'pulseaudio -k' the fix

Solution 1:

It be caused by a new kernel introduced in 19.10 like this case:

  • Lagging after update to 19.10 from 19.04

If not then you can use this script /etc/systemd/system-sleep/reloadpulse:

#!/bin/sh

# NAME: reloadpulse
# PATH: /lib/systemd/system-sleep
# CALL: Called from SystemD automatically

# DESC: PulseAudo 8 sets sound to dummy ouput when going to sleep.
#       This script kills and reloads pulse audio.

# DATE: November 25, 2019.

# NOTE: Written for ask ubuntu question:
#       https://askubuntu.com/questions/1191649/why-no-sound-on-wake-dummy-output-takes-over-pulseaudio-k-the-fix

case $1/$2 in
  pre/*)
    echo "$0: Going to $2..."
    ;;
  post/*)
    echo "$0: Waking up from $2..."
    pulseaudio -k
    ;;
esac

Mark the script executable with chmod a+x /etc/systemd/system-sleep/reloadpulse

After updates deactivate it with chmod a-x /etc/systemd/system-sleep/reloadpulse

Then if the update didn't fix the problem make it executable again.

You need to reboot for changes to take effect.

Solution 2:

I have a similar problem with Ubuntu 20.04.

This command solved the problem: pulseaudio --start

Solution 3:

I tried the solution by @WinEunuuchs2Unix but it didn't work with my Ubuntu 20.04.2 on a Lenovo Ideapad Y910. This is what I had to do to make it work with my setup:

Add a file (let's call it "pulseaudio-fix") to the directory /usr/lib/systemd/system-sleep and give it execution permission:

chmod a+x pulseaudio-fix

Include the following content in the file:

#!/bin/sh

case $1 in
  post)
    su user-name -c "
    killall pulseeffects;
    killall pulseaudio;
    sleep 1;
    DISPLAY=:0 /usr/bin/pulseeffects --gapplication-service &"
    ;;
esac

Where "user-name" is the name of your user account. In my case commands wouldn't run under the system account. Additionally, killing pulseaudio would mess with pulseeffects, so it needed to be killed before pulseaudio and restarted after it autostarts. If you don't need pulseeffects, just delete the two lines from the code above.

This made the random "dummy output" after sleep problem go away for good in my case.