Audio “popping” when using Wireplumber on Linux

As applications started and stopped playing sound my speakers were making an annoying “pop” after I updated my Lenovo P50 laptop to Fedora 35. This would happen scrolling through a twitter feed with embedded videos (even though the sound is disabled by default until you click, the browser must open the audio ready causing a pop).

Based on combining the advice in the following web pages:

I made a copy of the config file (as per the second link):

mkdir -p ~/.config/wireplumber/main.lua.d

cp /usr/share/wireplumber/main.lua.d/50-alsa-config.lua ~/.config/wireplumber/main.lua.d/

Then I edited ~/.config/wireplumber/main.lua.d/50-alsa-config.lua to add :

["session.suspend-timeout-seconds"] = 0,

Into the final apply_properties stanza in the file. It seems to work but I don’t know much about alsa so there may be a better workaround – if you know of one, let me know.