8

When it goes to sleep, sound working, when it wakes from sleep the sound doesn't work. So I go into gnome settings > sound and the output device has been reset to 'dummy output'. Instead of HDMI output [nvidia card driver 430.50].

Simply changing the output device in settings, back to HDMI, does not fix things.

Issuing the command pulseaudio -k does fix things. The dummy output option disappears and the HDMI option is restored. This is played out, entirely reproducible, every time the machine wakes.

Perhaps related... For a week, I had to use some external speakers via the line-out, immediately before this all started. Although all I did was plug them in, and everything worked automagically. They've since been returned.

Alternatively, one is tempted to blame it on something in the ubuntu 19.10 update? Although that might be unfair, the timing does fit.

Anyways, the question is, what is the permanent fix so that I do not have to issue a kill order on pulseaudio on every wake?

9
  • It's not unfair to blame the 19.10 update. Errors are expected and many have already been reported. Nov 25, 2019 at 22:47
  • I've been experiencing the same issue and made a post a few weeks ago: askubuntu.com/questions/1187835/…
    – Dzinic
    Nov 26, 2019 at 17:01
  • @Dzinic Did you implement the solution offered there? I'm confident the one @WinEunuuchs2Unix has offered below will do the trick, but I'm just tinkering with features in /etc/pulse/default.pa before resorting to that-prevention before cure. Turning off module-rescue-streams is my current best hope. Will post what works, or tick that, when I've confirmed my fix.
    – John Mee
    Nov 26, 2019 at 21:57
  • @JohnMee I haven't tried that yet because it doesn't seem to make much of a difference from what I currently do by simply running pulseaudio -k if I notice the Dummy Output. Problem with both of these solutions is I then have to restart several programs that break once you run the pulseaudio restart.
    – Dzinic
    Nov 26, 2019 at 23:18
  • 1
    @geekQ Sorry to hear that. I moved to 20.10 and this issue has now gone. Although first I had to undo the fix I posted below. Perhaps it needs backporting; or was too painful for anyone to invest the time to do that.
    – John Mee
    Feb 23, 2021 at 0:52

5 Answers 5

4

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

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.

2

I have a similar problem with Ubuntu 20.04.

This command solved the problem: pulseaudio --start

2
  • Does the command solve the problem temporarily or permanently?
    – Flimm
    Jul 3, 2020 at 11:36
  • 1
    It was a temporary fix, meaning the problem will appear again later and you have to run the command again. What solved the problem permanently for me was a manual kernel upgrade. You can take a look here for the steps: c2bio.com/2020/06/05/update-kernel-in-ubuntu
    – bhu
    Jul 4, 2020 at 17:51
1

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.

0

Disable the pulseaudio module module-rescue-streams by sudo editing the file /etc/pulse/default.pa and commenting it out.

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
# I commented this out to stop it defaulting to a 'dummy output' after sleep/suspend [JM:november 2019]
# load-module module-rescue-streams

I'm guessing that there has been a change in the wake sequence such that, now, this runs before all the sound sinks are restored. Consequently, it decides all the 'dead' sinks need to be "rescued" to a new default/dummy sink. They all subsequently wake up, but they've already been rerouted to the dummy.

I'm also guessing that this could break some ability to unplug and replug speakers/headphones as and whenever you like, but I haven't discovered that for myself yet.

2
  • 1
    Didn't fix the issue for me but glad it worked out for you.
    – Dzinic
    Nov 27, 2019 at 23:50
  • I don't even have module-rescue-streams in here to begin with...
    – Coder Guy
    Mar 9, 2021 at 23:35
0

This method works for me. You can try:

pulseaudio -k && sudo alsa force-reload

I adapted this answer from this youtube video.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.