PipeWire

From Free Knowledge Base- The DUCK Project
Jump to navigation Jump to search

PipeWire - a low-level multimedia framework for audio and video under Linux.

PipeWire is expected to provide

  • 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. (not a good selling point)

Linux Mint 22 is one of the distributions switching from PulseAudio to PipeWire as the default sound server. Pipewire brings a custom "Pro Audio" profile in addition to the PulseAudio profiles, selectable through pavucontrol.

PipeWire can be used as an audio server, similar to PulseAudio and JACK. It aims to replace both PulseAudio and JACK, by providing a PulseAudio-compatible server implementation and ABI-compatible libraries for JACK clients.

Like JACK, PipeWire implements no connection logic internally. The burden of watching for new streams and connect them to the appropriate output device or application is left to an external component known as a session manager. WirePlumber is the recommended session manager. It is based on a modular design, with Lua plugins that implement the actual management functionality.

The PipeWire package provides an initial set of configuration files in /usr/share/pipewire. You should not edit these files directly, as package updates will overwrite your changes. To configure PipeWire, you can copy files from /usr/share/pipewire to the alternate system-wide location /etc/pipewire, or to the user location ~/.config/pipewire.

ALSA Compatibility

Install pipewire-alsa (and remove pulseaudio-alsa if it was installed) to route all applications using the ALSA API through PipeWire.

Simultaneous Audio Output aka Combined Sink

To enable simultaneous audio output to all sound cards in Linux Mint 22 using PipeWire, the simplest and most direct method is to use the pactl command to load the module-combine-sink. This creates a virtual sink that routes audio to all available sound devices.

 pactl load-module module-combine-sink

This command creates a virtual sink named "Simultaneous Output" that sends audio to all connected sound devices. It will appear in the volume control applet "Sound Settings" under the "Output" tab. Among the output devices look for one called "combined" or containing the word combined.

If the virtual sink doesn’t appear or work, check that PipeWire and related packages (pipewire, pipewire-pulse, wireplumber) are installed and running:

sudo apt install pipewire pipewire-pulse wireplumber

Some users report an issue, PipeWire spiking to 100% CPU usage after hours of inactivity, due to the combined audio sink. This behavior has been reported often linked to the module-combine-sink. It seems to be a bug or resource leak in PipeWire’s module-combine-sink. reloading pipewire might clean up the issue.

systemctl --user restart pipewire pipewire-pulse wireplumber

You can create a script to toggle on and off the use of combined sink