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?
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
: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.
I have a similar problem with Ubuntu 20.04.
This command solved the problem:
pulseaudio --start
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:
Include the following content in the file:
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.
Disable the pulseaudio module
module-rescue-streams
by sudo editing the file/etc/pulse/default.pa
and commenting it out.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.
This method works for me. You can try:
I adapted this answer from this youtube video.