PipeWire as a Replacement of PulseAudio

PipeWire is a server that handles audio and video streams. It is a useful replacement of PulseAudio and Jack. PipeWire provides a low-latency engine on top of audio and video devices and improves handling of such streams with usage of the standard Linux-libre kernel, so there will be no need for a real-time kernel for most users anymore. PipeWire is available in the Trisquel Package archive and can be installed optionally.

Main Features

  • Capture and playback of audio and video with minimal latency
  • Real-time multimedia processing on audio and video
  • Multiprocess architecture to let applications share multimedia content
  • Seamless support for PulseAudio, JACK, ALSA, and GStreamer applications
  • Sandboxed applications support, See Flatpak for more info

To see the status of PipeWire service, open a Terminal and run:

 systemctl --user status pipewire pipewire-session-manager

Installing PipeWire

First, install the client libraries by running:

 sudo apt install pipewire-audio-client-libraries libspa-0.2-bluetooth libspa-0.2-jack
It is recommended to install WirePlumber when to use Pipewire as system sound server. WirePlumber is a more advanced modular session / policy manager for PipeWire. The 'wireplumber' package contains the WirePlumber daemon and command-line utilities.
 sudo apt install wireplumber pipewire-media-session-
Note, that there is a '-' at the end of the line, which tells apt to remove the package 'pipewire-media-session'.

Configuring ALSA and JACK clients

If you just want to replace PulseAudio with Pipewire, enable the WirePlumb service and restart, like described below!

In case you want to configure the ALSA client using PipeWire, run:

 sudo cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/
And to configure the JACK client using PipeWire, run:
 sudo cp /usr/share/doc/pipewire/examples/ld.so.conf.d/pipewire-jack-*.conf /etc/ld.so.conf.d/
Update the shared library cache with the following command:
 sudo ldconfig
And remove 'pulseaudio-module-bluetooth' to enable Bluetooth support for Pipewire
 sudo apt remove pulseaudio-module-bluetooth

Enable WirePlumb Media Session

Finally, enable WirePlumber, by running:

 systemctl --user --now enable wireplumber.service
and reboot!

After reboot, check the output of

 pactl info
It should contains a line with 'PulseAudio (on PipeWire x.x.x)'

Known Issues

The package pulseaudio-module-bluetooth is part of trisquel-recommended, which will be removed if you use Pipewire like described in this Wiki. If you re-install trisquel-recommended, pulseaudio-module-bluetooth will be installed again. This is causing playback problems. Remove pulseaudio-module-bluetooth again by running:

sudo apt remove pulseaudio-module-bluetooth
and reboot!

Undo Changes

To restore your changes and use PulseAudio, like you did before, firstly remove the client libraries by running:

 sudo apt remove pipewire-audio-client-libraries libspa-0.2-bluetooth libspa-0.2-jack
Remove wireplumber and re-install the previous media session package.
 sudo apt install pipewire-media-session wireplumber-
Note the '-', like described before.

Finally, re-enable pipewire-media-session service by running these commands:
 rm -f ~/.config/systemd/user/pipewire-session-manager.service
 systemctl --user --now enable pipewire-media-session
And disable pipewire-pulse services by running:
 systemctl --user --now disable pipewire-pulse.service pipewire-pulse.socket
Re-install 'pulseaudio-module-bluetooth' by running:
 sudo apt install pulseaudio-module-bluetooth
And re-enable the original pulseaudio service by running:
 systemctl --user --now enable pulseaudio.service pulseaudio.socket
You can check the result by running:
 pactl info

Revisions

10/18/2023 - 08:43
knife