PipeWire

PipeWire is a modern processing framework that focuses on handling multimedia data such as audio, video and MIDI. An example graph could look like this:

                       +-------------+
                       |  microphone |
                       +-------------+
                              *
                              |
                              | 
                              V
                              *
                        +----------+
                        | autotune |
                        +----------+
                              *
                              |
                              ^
                             / \
                            /   \
                           /     \
                          /       \
                         V         V
                         *         *
              +------------+    +---------+
              | headphones |    | speaker |
              +------------+    +---------+

In this graph, there are four nodes (microphone, autotune, headphones and speaker), each of them has one or more ports. These are either the input or output points to the device or the software and in the graph indicated by a *. Lastly there are multiple links between the ports. These are the connecting lines in the graph. For example, I also could route the microphone node directly to the headphones and speaker nodes by just moving the link from microphone to the two input ports of the outputs:

                       +-------------+
                       |  microphone |
                       +-------------+
                              *
                              |
                              ^
                             / \
                            /   \
                           /     \
                          /       \
                         V         V
                         *         *
              +------------+    +---------+
              | headphones |    | speaker |
              +------------+    +---------+

A node that only has an output port (for example the microphone) also can be called source. A node that only has an input port (for example headphones or speaker) can also be called sink. This termology most likely originates from water taps: The tap is the source and while falling, the water can be “captured” by another system that then eventually should dispose the water in the sink.

Components

PipeWire is a complex system and a full working installation of this media server consists of multiple seperate programs, which will be described in detail in the child-sections here.

Daemon

This is the central process that manages the data exchange between the different nodes. In the example above is it responsible for sending data between the microphone and the autotune as well as all other links. This is done via a UNIX socket that is (by default) located at $XDG_RUNTIME_DIR/pipewire-0. The daemon can be configured using a pipewire.conf file, which should located in:

The config file’s format is JSON with a bit a more compact representation. For example, the " can be ommited around strings, no trailing commas are required and # can be used for comments.

Session Manager

The session manager is responsible to create links between the different nodes. PipeWire by default will not create a link between any nodes, which means that if an audio source, like firefox, plays audio, it will not automatically output this audio to any output device like a speaker. First there needs to be a link.

This job is done via the session manager, the most common one being WirePlumber.

Management Tools

PipeWire provides a suite of software tools that can help to analyze, adjust and configure the PipeWire graph. These tools are in the form of CLI’s and are namely:

There are many more, however most have special use-cases and you’ll only should get to know them once you need them.

Library

That applications actually can use PipeWire, the official PipeWire library is needed for programs to link against. This library is object oriented and asynchronous. All requests and replies are method calls on some object. These objects are identified with an unique ID.

SPA

SPA is short for Simple Plugin API and is an extensible API that can be used to implement all kinds of plugins. It is inspired by LV2 and GStreamer.