New audio server Pipewire coming to next version of Ubuntu
What does that mean? Better latency and a replacement for PulseAudio
The next release of Ubuntu, version 22.10 and codenamed Kinetic Kudu, will switch audio servers to the relatively new PipeWire.
Don't panic. As J M Barrie said: "All of this has happened before, and it will all happen again." Fedora switched to PipeWire in version 34, over a year ago now. Users who aren't pro-level creators or editors of sound and music on Ubuntu may not notice the planned change.
Currently, most editions of Ubuntu use the PulseAudio server, which it adopted in version 8.04 Hardy Heron, the company's second LTS release. (The Ubuntu Studio edition uses JACK instead.) Fedora 8 also switched to PulseAudio. Before PulseAudio became the standard, many distros used ESD, the Enlightened Sound Daemon, which came out of the Enlightenment project, best known for its desktop.
PulseAudio hit version 1.0 in 2004 and is currently on version 15. One of PulseAudio's lead developers was Lennart Poettering, who is now best known as the project lead of the famed and controversial systemd, so perhaps it's reasonable to think he's busy with other things these days.
PipeWire also handles video streams so it does a little more than the outgoing PulseAudio, which as its name suggests only handles audio. To explain what this change means, let's clarify what an audio server is and does.
The sound playback software system in Linux is a stack, and like the network stack, it has multiple layers that do different things. At the bottom are sound drivers, which are intimately connected with the Linux kernel. Above them sits a sound server, and above that, your apps playing sounds.
PulseAudio (and part of the functionality of PipeWire) are sound servers. They manage access from different apps to the underlying sound hardware, mixing their audio streams before playback. You can play, or record, sound without a sound server, but if you don't have one, the current program that is playing sound owns the audio device: it has complete and exclusive control over it, meaning that the operating system can't mix sources.
So, for example, it's a good thing to have a sound server managing your sound devices if you want to be able to hear a new-message notification while you're listening to music. The sound server manages the inputs, and can mute – or better still, fade out – the music player, fade in the source of the notification, and then fade the music player back in again.
If you plug headphones in to an ordinary headphone socket, that's driven by your onboard sound card, or maybe by a better one in an expansion slot. But if you use a USB headset, that is in effect a separate sound card, attached over USB instead of PCI, and the sound subsystem therefore has to manage sound devices coming and going as they are attached or removed – or if you don't remove it, manage switching between the preferred current device. It's a complicated job.
The sound server sits on top of the layer that drives the sound cards or chips in your computer.
The original Linux sound system (as in, the low-level hardware drivers) was the Open Sound System, also known as OpenSound or OSS for short. OpenSound is a cross-platform tool that also runs on other operating systems such as FreeBSD and OpenSolaris. OpenSound was widely adopted and prospered so much that its programmer got hired by a commercial company, 4Front, which was later acquired by NCR.
- The Return of Gopher: Pre-web hypertext service is still around
- FreeBSD 13.1 is out for everything from PowerPC to x86-64
- The new generation of CentOS replacements – plus the daddy of them all: RHEL 8.6
- GNU Compiler Collection adds support for China's LoongArch CPU family
Subsequently, many distros, including Ubuntu, removed and switched to ALSA instead. ALSA also supports the OpenSound APIs, so things still worked. ALSA itself was mainlined into the Linux kernel in version 2.5.5, and from kernel 2.6 it replaced OpenSound.
PulseAudio, which is also cross-platform, is a FreeDesktop.org project. On Linux, it sits on top of ALSA.
PulseAudio too was controversial in its time, but it was fair to say that Linux audio was a mess. PulseAudio does work, and it resolved many issues, but it can be high latency, and can use a lot of CPU. Some audio professionals favored a rival audio server called JACK, which provides lower-latency sound handling. Indeed, the development of JACK drove work to reduce audio latency in kernel 2.6.
The plan is that PipeWire will further simplify media handling on Linux. It's not just a sound server, it also handles video. The project lead, Wim Taymans, was one of the co-founders of the GStreamer framework back in 1999. Although it's quite new, currently only on version 0.3, PipeWire aims to replace PulseAudio and JACK. Similarly to how ALSA supported OSS interfaces so you could keep existing code working, now PipeWire supports JACK interfaces so, at least in theory, people who were using JACK can keep the same software and it should still work with PipeWire.
PipeWire also aims to work with GNOME, the Wayland display server, and Flatpak apps, while using less CPU and offering better latency than PulseAudio so that it can also replace JACK.