[Discussion] Replace Pulseaudio with Pipewire
I think most of you already know what PipeWire is, but for the few people who never heard about it before, the ArchWiki gives the following description:
PipeWire is a new low-level multimedia framework. It aims to offer capture and playback for both audio and video with minimal latency and support for PulseAudio-, JACK-, ALSA- and GStreamer-based applications. The daemon based on the framework can be configured to be both an audio server (with PulseAudio and JACK features) and a video capture server. PipeWire also supports containers like Flatpak and does not rely on audio and video user groups but rather it uses a Polkit-like security model asking Flatpak or Wayland for permission to record screen or audio.
Some of the (best) features of PipeWire are:
- 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.
For more in-depth information on history and PipeWires technical background I would refer to (for those who are interested in it): https://lwn.net/Articles/847412/
To summarize the pros in using PipeWire over PulseAudio:
- Like said earlier, seamless support for PulseAudio, JACK ALSA and GStreamer apps. It's as easy as installing pipewire-pulse and pipewire-alsa to have PulseAudio on PinePhone replaced by PipeWire. No need to configure anything afterwards, just reboot the system and start using it. (Btw. compatible with Quectel modem firmware, and also Biktorgj open firmware for telephony)
- Better in Bluetooth-audio handling than PulseAudio. The Bluetooth audio stack in PulseAudio is quite outdated and the implementation is quite buggy. In my opinion on a Phone replacement this is quite an issue, because this kind of devices should have proper BT Audio support. When installing pipewire-pulse (replacement for the PulseAudio stack), it will also remove pulseaudio-bluetooth, so to start using PipeWire is not difficult at all.
- Sandboxed applications support: Since more and more applications nowadays get developed as multi-distro package (using flatpak or snap), containerized support of audio handling is getting more important. Back in the days PulseAudio was developed, containerization was not yet such a big thing as it is nowadays. Handling of security for the low-level audio/video hardware is patched to some level, but as PulseAudio was not really designed with this kind of use case in mind there's still a lot of improvement to be made. (Which PipeWire due to the nature of it's design already includes/implements)
Now the big question, what about stability of PipeWire: Through my own experiences I can tell you that I'm very much surprised by the stability of PipeWire. In my testing on the PinePhone it handles, at least all my everyday use cases properly.
I'm using PinePhone as a daily driver actually using the Manjaro ARM Phosh Beta 8 image -> Only things replaced are Modem firmware, to Biktorgj's open modem firmware, and PulseAudio exchanged with PipeWire.
Also my desktop (driving Fedora 34 Beta), is using PipeWire fully and have not had any problems with it so far. In this latest Fedora build they have swapped out PulseAudio completely with PipeWire. I know that Fedora is a distro which is usually more on cutting edge software, but I know they wouldn't have implemented it in their released stable image if it wasn't properly stable yet. And also the PinePhone Fedora image is using PipeWire out of the box with much success.
Please test it an let me know your experience: To test PipeWire for yourself, all you really have to do is a: sudo pacman -S pipewire pipewire-pulse pipewire-alsa It will ask you for permission to remove the PulseAudio stack packages. After rebooting the PinePhone you'll be actually using PipeWire