How to use pipewire instead of pulseaudio?

I am considering to migrate from pulseaudio to pipewire. The same thing is actually being done by most major distros. I would also like to contribute a little section to the community wiki documenting this, but I don’t fully understand what is the minimal set of options required?

ALSA can be activated with sound.enable. Currently, I have hardware.pulseaudio.enable set to true, and that is sufficient for Firefox or any other application to start the pulseaudio daemon, which also initiates the rtkit daemon. Everything works fine.

I haven’t found a minimal set of options to setup pipewire using services.pipewire.audio.enable. All setups I read online or that worked for me were a bit convoluted. Perhaps there is not a simple way to do this.

Setting services.pipewire.enable worked for me. (but I use a DE which might have enabled it) To enable PulseAudio emulation, set services.pipewire.pulse.enable.

Maybe try these options:

{
  services = {
    pipewire = {
      enable = true;
      audio.enable = true;
      pulse.enable = true;
      alsa = {
        enable = true;
        support32Bit = true;
      };
      jack.enable = true;
    };
  };
}
1 Like

Upon some investigation, this is sufficient without a DE:

  services.pipewire = {
    enable = true;
    pulse.enable = true;
  };

Also recommended to do security.rtkit.enable = true; if running a minimal setup to ensure pipewire processes get realtime priority.

1 Like
alsa = {
  enable = true;
  support32Bit = true;
};

can also be necessary if you run slightly more legacy things. Usually video games IME. Jack is normally superfluous unless you know you need it.

1 Like

Home manager provides a service for EasyEffects btw.
For me EasyEffects was the main reason to use Pipewire to begin with.