Prevent pipewire from putting audio to sleep?

Whenever a notification pops up and plays a sound, there’s an audio pop at the start. From what I’ve read, this is likely due to pipewire putting the audio device to sleep when no sound has played in a while.

However, the only fix I’ve read is to “make a copy of /usr/share/wireplumber/main.lua.d/50-alsa-config.lua and edit session.suspend-timeout-seconds to a value of 0”. This file doesn’t exist on NixOS, so I’m curious if there is another place this can be done. I assume others here have run into this issue?

I use neither pipewire or wireplumber, but I may still be able to help. Reading the follwing:

Makes me think you can add to your NixOS configuration simply:

    environment.etc."wireplumber/main.lua.d/90-suspend-timeout.lua" = {
      text = ''
        session.suspend-timeout-seconds = 0
      '';
    };

Though perhaps you do need to enable the service with:

services.pipewire.wireplumber.enable = true;

I personally use Gnome and I use pulseaudio - I think I don’t use pipewire nor wireplumber. Following Arch Linux’ wiki this may work for you:

hardware.pulseaudio.extraConfig = ''
  .nofail
  unload-module module-suspend-on-idle
  .fail
'';
2 Likes

@nairou Did you try the solutions? Which config did work for you on pipewire?