A pure Zig PipeWire client library that speaks the native wire protocol to play audio and manage the graph, with no libpipewire and no libc.

Add a pure-Zig PipeWire playback client

Speaks PipeWire's native wire protocol directly over the daemon's Unix socket, linking neither libpipewire nor libc. The public API is Stream: open it, write interleaved f32 frames (or fill buffers from a callback), and the audio plays. The stream is a client-node in the daemon's graph with one mono DSP port per channel. The daemon owns the clock: once per cycle it writes an eventfd, and the data thread wakes, writes that cycle's frames into the shared buffers, marks each port's io area, and wakes the peers it feeds. A second thread reads the socket and applies whatever the daemon says. Ports are created in response to the PortConfig the session manager writes, as a real audio adapter node does. Doing it any other way leaves WirePlumber waiting forever for the node's port list to change, and it also means the channel layout is the sink's rather than one we assume; Stream maps the caller's channels onto it. Verified against a live daemon by recording the sink monitor: exact amplitude and channel separation, and no sample discontinuities over twenty seconds. Also checked for descriptor and allocation leaks across repeated open/close cycles. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0135fq2ZjgV7Eicd4XBdyvfp


Author
Co-author Claude Opus 5 (1M context) Date Commit