doc/client/pipewire_player.md
This implementation adds native PipeWire support to Snapcast client, allowing direct audio playback through PipeWire without going through ALSA or JACK compatibility layers.
The PipeWire player provides the same functionality as the PulseAudio player, including automatic silence detection and device resource management.
Ensure PipeWire development packages are installed:
# Fedora/RHEL
sudo dnf install pipewire-devel
# Ubuntu/Debian
sudo apt install libpipewire-0.3-dev
Build Snapcast with PipeWire support:
cmake .. -DBUILD_WITH_PIPEWIRE=ON
make
Use PipeWire as the audio player:
snapclient --player pipewire
buffer_time: Audio buffer time in milliseconds (default: 100ms, minimum: 10ms)Use default PipeWire sink:
snapclient --player pipewire
Specify custom buffer time:
snapclient --player pipewire:buffer_time=50
Target specific output device:
snapclient --player pipewire --soundcard alsa_output.pci-0000_00_1b.0.analog-stereo
Combined parameters:
snapclient --player pipewire:buffer_time=200 --soundcard my_audio_device
The PipeWire player automatically lists available audio devices at startup:
[Debug] (PipeWirePlayer) Found audio sink: alsa_output.pci-0000_00_1b.0.analog-stereo (Built-in Audio Analog Stereo)
[Debug] (PipeWirePlayer) Found audio sink: alsa_output.usb-Generic_USB_Audio-00.analog-stereo (USB Audio Device)
If no soundcard is specified, PipeWire automatically selects the default sink.
You can manage audio routing using PipeWire tools:
# List all nodes
pw-cli list-objects Node
# View the PipeWire graph
pw-dot
qpwgraph # GUI tool
# List active connections
pw-link -l
PulseAudio clients like pavucontrol can also be used to manage PipeWire audio routing.
The PipeWire player includes intelligent resource management:
This behavior matches the PulseAudio player exactly and helps prevent audio device conflicts.
No audio output:
snapclient -lsystemctl --user status pipewirePermission issues:
pw-cli info 0Device not found:
pw-cli list-objects Node | grep -A5 -B5 "audio.sink"High latency:
--player pipewire:buffer_time=50If you're currently using the PulseAudio player:
# Old PulseAudio usage
snapclient --player pulse
# New PipeWire equivalent
snapclient --player pipewire
The PipeWire player provides identical functionality with potentially lower latency and better integration with modern Linux audio systems.
This implementation was developed and tested as part of adding comprehensive PipeWire support to Snapcast. The implementation closely follows PipeWire best practices and official examples for robust audio playback.
Research for this implementation was done with perplexity AI. Most of the inital code was written by Claude Code AI, including this documentation.
However, all tests, prompt directions, and the initial PR were done by aanno.