Skip to content

PipeWire system mode

マギルゥーベルベット edited this page Jun 29, 2023 · 5 revisions

System Mode Instructions

To use PipeWire in system mode, rather than user mode, it is required to use custom systemd units and change some default settings in WirePlumber.

  1. Give the pipewire user on your system a home directory!! THIS IS REQUIRED TO STORE DATA! usermod -d /var/lib/pipewire pipewire
  2. Install the relevant PipeWire and WirePlumber systemd units found in the backups/systemd-units directory of this repository.
  3. Copy pipewire.conf, pipewire-pulse.conf and client.conf from /usr/share/pipewire/ to /etc/pipewire/ and adjust the options to your preferences.
  4. Disable the modules libpipewire-module-x11-bell and libpipewire-module-portal. They are not relevant for system mode and don't work anyway. Also set support.dbus to false, as PipeWire doesn't support the global D-Bus system bus, it always tries to connect to the session bus by default.
  5. Make the following changes to these files:
    • /etc/wireplumber/main.lua.d/50-default-access-config.lua => ["enable-flatpak-portal"] = false
    • /etc/wireplumber/main.lua.d/50-alsa-config.lua => ["alsa.reserve"] = false
    • /etc/wireplumber/bluetooth.lua.d/50-bluez-config.lua => ["with-logind"] = false

These settings don't work in system mode, and WirePlumber will complain with cryptic error messages during startup.

  1. Enable and start the pipewire.service, pipewire-pulse.service and wireplumber.service systemd units (as root). Permissions are automatically dropped to the pipewire user and group. If everything worked correctly, you should see 3 processes running as pipewire user on your system.
$ ps -u pipewire
    PID TTY          TIME CMD
1313473 ?        00:01:21 pipewire-pulse
1313492 ?        00:00:03 pipewire
1313493 ?        00:04:48 wireplumber

PulseAudio compatibility

Change the default-server option in /etc/pulse/client.conf to /var/run/pipewire/native and disable autospawn. If you previously used PulseAudio in system mode, you should already have autospawn disabled. A PulseAudio system mode systemd unit file can be found in the backups/systemd-units directory for reference.

ALSA compatibility

Copy /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf to /etc/asound.conf to make ALSA clients use PipeWire for audio.

PipeWire socket permission

Add all users which should be able to use audio to the pipewire group to give them read/write access to the pipewire-0 socket.

usermod -a -G pipewire your_user

Test if you have access to PipeWire by running pw-dump, wpctl status and pactl list (for PulseAudio compatibility). If you did everything correctly, applications with PipeWire audio output should be able to play audio.

Advantages

Advantages of running PipeWire (or previously PulseAudio) in system mode are:

  • the audio stack is completely decoupled from the user session and works standalone,
  • only trusted users can play back or record audio and change sinks, volumes, etc.,
  • multiple users on the system can use the same audio hardware at the same time,
  • random applications can't restart or kill the audio stack on your system.

Only run PipeWire in system mode when you know what you are doing, since this mode is not officially supported.