Hi, my audio system recently started muting itself a few seconds after I select the output (“sink”). This happens even while I do a speaker test in the audio dialog.
To get it back to work I have to select another audio sink (one of my HDMI1, headphones, or internal speaker) then back to the one I want to use, and unmute it.
Now I found a way to kind of fix it: I comment-out the line
load-module module-suspend-on-idle
in /etc/pulse/default.ps. The automatic mute does no longer happen, therefore I assume the suspend somehow includes a mute.
As I think it might help others with similar problems, I post it here - OR somebody can suggest a better fix.
Markus
2 Likes
PulseAudio module-suspend-on idle is a useful power-saving feature for laptop systems, but is not needed on a desktop system
The module suspends idle sink outputs and drops connection to ALSA audio devices if no audio is playing, but that can allow errant applications to take control of an ALSA device and prevent PulseAudio reconnecting.
This module can also cause another problem on some systems - a loud pop or crack sound when
sinks are de-suspended to resume playback.
mute and suspend work independently - to check suspend and mute states:
pacmd dump
or
pactl list sinks
audio streams can be muted and unmuted in audio mixer GUI controls
Editing system default configuration files is generally not a good idea. If the configuration file is change in a future update, system would create /etc/pulse/default.pa.pacnew file to be merged by user rather than over-writing the modified file
A better fix would be to copy default.pa file to home folder
cp /etc/pulse/default.pa ~/.config/pulse/default.pa
comment out the command to load the problematic module
sed -i '/load-module module-suspend-on-idle/s/^/#/' ~/.config/pulse/default.pa
and restart PulseAudio
systemctl --user restart pulseaudio
2 Likes
Thanks for this explanation. This seems to be the case on my laptop. After my procedure of de-selecting and re-selecting the sink, it appears with a new index in the output of “pacmd list-sinks”
Is there a chance to diagnose which application is grabbing the device?
It is obvious that a suspend conceptually should not imply a persisting mute; however observed via UI on my system it does. May be the suspend includes a mute, which is supposed to be reverted during reconnect (which fails)?
Re. the hint to copy default.pa to my home folder:
wouldn’t a full copy of this file also prevent future updates, as it replaces the system’s default?
If I understand the man pages correctly, there’s no merging of the various settings from public and private instances of this file.
sudo fuser -av /dev/snd/*p
Suspend and mute functions work independently and have different commands:
pulse-cli-syntax — Arch manual pages
VOLUME COMMANDS
set-sink-mute|set-source-mute index|name boolean
Mute or unmute the specified sink (resp. source). You may specify the sink (resp. source) either by its index or by its name. The mute value is either 0 (not muted) or 1 (muted).
set-sink-input-mute|set-source-output-mute index boolean
Mute or unmute a sink input (resp. source output) specified by its index. The same mute rules apply as with set-sink-mute.
CONFIGURATION COMMANDS
suspend-sink|suspend-source name|index true|false
Suspend or resume the specified sink or source (which may be specified either by its name or index), depending whether true (suspend) or false (resume) is passed as last argument. Suspending a sink will pause all playback and suspending a source will pause all capturing. Depending on the module implementing the sink or source this might have the effect that the underlying device is closed, making it available for other applications to use. The exact behaviour depends on the module.
suspend boolean
Suspend all sinks and sources.
Audio can also be muted in Applications, PulseAudio GUI controls and ALSA mixer controls
PulseAudio is not likely to be changing module configuration file /etc/default.pa, but if it does change, use the commands in previous post to copy the file, disable module and restart PulseAudio
There is another way to use system default.pa and unload the module in home folder
# ~/.config/pulse/default.pa
.include /etc/pulse/default.pa
.nofail
unload-module module-suspend-on-idle
.fail
but I prefer to have the modules configured in one place so I can change other modules
easily
1 Like