Differences between revisions 1 and 2
Revision 1 as of 2021-01-31 07:25:02
Size: 6469
Comment: Create page, documenting PipeWire as it pertains to both Debian 10 and 11. Improvements welcome!
Revision 2 as of 2021-03-07 20:52:22
Size: 6436
Comment: Reformat steps
Deletions are marked like this. Additions are marked like this.
Line 92: Line 92:
If you have no audio, or if !PulseAudio is running instead of PipeWire,
you may need to stop !PulseAudio with "{{{systemctl --user stop pulseaudio.service}}}", disable its service with "{{{systemctl --user disable pulseaudio.service}}}"
and then restart PipeWire with "{{{systemctl --user restart pipewire pipewire-pulse}}}". Make sure you run these commands as your regular user,
and not as root.
If you have no audio, or if !PulseAudio is running instead of PipeWire, run these commands as your regular user (not as root):

{{{
# disable PulseAudio service with:
systemctl --user disable pulseaudio.service
# then stop it with:
systemctl --user stop pulseaudio.service
# and then restart PipeWire with
systemctl --user restart pipewire pipewire-pulse
}}}

Translation(s): none


PipeWire is a server and API for handling multimedia on Linux. Its most common use is for Wayland and Flatpak applications to implement screensharing, remote desktop, and other forms of audio and video routing between different pieces of software. Per the official FAQ, "you can think of it as a multimedia routing layer on top of the drivers that applications and libraries can use."

As opposed to PulseAudio's focus on consumer audio and JACK's focus on professional audio, PipeWire aims to work for all users at all levels. Among other techniques, PipeWire achieves this with its ability to dynamically switch between different buffer sizes, for adapting to the different latency requirements of different audio applications.

In Debian 10, PipeWire 0.2.5 is available, and should not need to manually be installed, as it's usually brought in as a dependency by applications that make use of it.

In Debian 11, PipeWire 0.3.19 is available, and can be experimentally used as a substitute for the ALSA userspace library, PulseAudio, and JACK. This is a documented but unsupported usecase.


Installation

In its most basic form, PipeWire can be installed simply by installing the pipewire package.

In Debian 10, some plugins are split into separate packages. These can be found in the libspa-bluetooth and libspa-ffmpeg packages. These are no longer necessary or present in Debian 11.

In Debian 11, the pipewire-audio-client-libraries package is available. As per the package description, "this package contains client libraries allowing programs designed for the ALSA, JACK and PulseAudio APIs to use a PipeWire server for audio playback and recording. They are not used by default, and are currently considered to be experimental."


Configuration

Using as a substitute for PulseAudio/JACK/ALSA

Debian 11 (Bullseye) is currently unreleased and in development. These instructions apply for anyone using it as the current testing branch or anyone using Debian Sid/Unstable.

These instructions may not always be up-to-date or even functional at all. They also may change at any time.

As per Simon McVittie, the PipeWire package maintainer, "This is not a supported scenario for Debian 11, and is considered experimental."

It may break certain applications, lack certain functionality, or not work at all.

Users may also be interested in PipeWire's capacity to be a drop-in substitute for existing Linux audio solutions, including PulseAudio and JACK. Potential benefits include lower CPU usage, better support for Bluetooth devices, and better integration between applications using JACK and PulseAudio. This is the default behavior in some other distros, notably Fedora 34 and newer.

This behavior can be experimentally enabled in Debian 11. PulseAudio and PipeWire may fight over Bluetooth devices.

Install the pipewire-audio-client-libraries package and, as desired, follow the instructions below.

For PulseAudio

In this scenario, PipeWire runs as a per-user audio service, replacing PulseAudio completely.

Create this empty file:

# touch /etc/pipewire/media-session.d/with-pulseaudio

Create a pipewire-pulse service by copying the example files:

# cp /usr/share/doc/pipewire/examples/systemd/user/pipewire-pulse.* /etc/systemd/user/

Reboot the system. You can check which server is in use by running:

$ pactl info

If it's using PipeWire, the server name will be "PulseAudio (On PipeWire 0.3.19)"

If you have no audio, or if PulseAudio is running instead of PipeWire, run these commands as your regular user (not as root):

# disable PulseAudio service with:
systemctl --user disable pulseaudio.service
# then stop it with:
systemctl --user stop pulseaudio.service
# and then restart PipeWire with
systemctl --user restart pipewire pipewire-pulse

For ALSA

ALSA clients can be configured to output via PipeWire.

Some may describe this as "replacing ALSA", but as the PipeWire FAQ clarifies: "No, ALSA is an essential part of the Linux audio stack, it provides the interface to the kernel audio drivers. That said, the ALSA user space library has a lot of stuff in it that is probably not desirable anymore these days, like effects plugins, mixing, routing, slaving, etc. PipeWire uses a small subset of the core ALSA functionality to access the hardware. All of the other features should be handled by PipeWire."

Create this empty file:

# touch /etc/pipewire/media-session.d/with-alsa

Copy a configuration file from the PipeWire examples into your ALSA configuration directory:

# cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/

For JACK

JACK clients can be configured to output via PipeWire instead of JACK.

Create this empty file:

# touch /etc/pipewire/media-session.d/with-jack

Either run JACK clients using the pw-jack wrapper, or copy:

# cp /usr/share/doc/pipewire/examples/ld.so.conf.d/pipewire-jack-*.conf /etc/ld.so.conf.d/

And run:

# ldconfig

This will replace the JACK server libraries with PipeWire's replacements at application runtime, by pointing the dynamic linker at the /usr/lib/x86_64-linux-gnu/pipewire-0.3/jack/ folder.


See also

PipeWire homepage

PipeWire FAQ

PipeWire Wiki

Debian PipeWire bugs

Debian security tracker for the PipeWire package

The state of PipeWire in Summer 2020 (On GNOME Blogs)

Read the official Debian package documentation for using PipeWire as a replacement for other audio servers by viewing the /usr/share/doc/pipewire-audio-client-libraries/README.Debian file.


CategoryHardware | CategorySound | CategorySoftware