Repository navigation
Mixer on Linux (PulseAudio / PipeWire-Pulse) - #14
Merged
Merged
Conversation
The mixer now runs on Linux too, driven through pactl, parec and pacat (pulseaudio-utils, already required), so the binary links no audio library. - Each channel is a null sink; its programs' streams are moved there and its monitor is recorded. With "Replace original" off a loopback plays the original as well. - The mix plays on the default output and follows it; a null sink plus a remapped source named "Slidr Mic" replace VB-CABLE. - Played streams run on the wall clock and hold ~40 ms of lead from their reported buffer latency. - Everything Slidr loads carries `slidr_mixer` in its arguments: switching off, quitting and cleaning up after a crash unload it, and the sound server moves the programs back to the default output. - Engine, effects and switch sounds are shared with Windows. The Mixer devices card and the VB-CABLE hint are Windows-only. The module builds on every platform (std::process only) so it is type-checked and unit-tested on any host; only Linux starts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
The software mixer from #13 now runs on Linux (PulseAudio and PipeWire-Pulse). It needs no virtual-cable driver.
It uses
pactl,parecandpacat, which come in the samepulseaudio-utilspackage Slidr already requires. This keeps the binary free of native audio libraries, in line with the existingaudio/pulse.rs.slidr_mixer_ch_<id>. Its programs are moved there withmove-sink-input, and its monitor is recorded withparec.module-loopbackalso plays the original.module-remap-sourcenamed Slidr Mic.pacatstream on the default output, which follows default changes.Clocking. The played streams run on the wall clock. Each
pactl list sink-inputsscan (once a second) reads their "Buffer Latency". When a stream drifts, Slidr drops or doubles a block to keep it about 40 ms ahead of the device.Restore and crash safety. Every module Slidr loads has
slidr_mixerin its arguments. Unloading a null sink moves its streams back to the default output, so all of these are "unload ours":Shared with Windows. The engine, effects, switch sounds and microphone channels are shared code. The Settings "Mixer devices" card and the VB-CABLE hint only show on Windows.
How it is built and tested
src/mixer/pulse_io.rsuses onlystd::process, so it compiles on every platform. It is type-checked and unit-tested on Windows too; only Linux starts it (mixer::spawn).media.nameand buffer latencycargo test: 101 pass, 1 ignored.kill -9, the next start removes the leftover devices🤖 Generated with Claude Code