Pulseaudio inconsitently resets volume after suspend
Summary
When volume is muted before system suspend, then unmuted too early after startup, pulseaudio will reset it to muted. Also there appears to be some internal inconsistency in the internal state, because querying the volume will incorrectly report the volume as unmuted, although it is in fact muted. After muting and unmuting, the state will be consistent again.
My workaround currently is to prepend a sleep 3
in the script that tries to unmute.
Steps to reproduce
Create e.g. a systemd user service which starts on early resume and runs pactl set-sink-mute 0 false
.
I didn't try, but it should be possible to trigger this by any other method which can run code early after resume.
My precise setup is as follows:
There is a system timer which wakes up the system and launches a system wide service which then calls out to systemctl to start a user service. The user service then attempts unmute the volume.
I appended the service files. I am using nixos, that's why there are store paths in there (/nix/store*).
The actual script then calls pactl set-sink-mute 0 false
.
What is the current bug behavior?
Volume is shown as unmuted, but is in fact muted.
What is the expected correct behavior?
Volume is in fact unmuted.