Skip to content

Add per-output PipeWire audio routing - #3

Open
marksverdhei wants to merge 13 commits into
mainfrom
per-output-audio-routing
Open

Add per-output PipeWire audio routing#3
marksverdhei wants to merge 13 commits into
mainfrom
per-output-audio-routing

Conversation

@marksverdhei

Copy link
Copy Markdown
Collaborator

Summary

  • Adds audio_target field to OutputConfig for specifying a PipeWire node name per output
  • Sets PIPEWIRE_NODE env var before CPAL opens the audio stream, then restores it afterward
  • Enables different monitors to visualize different audio sources (e.g., TTS on one display, music on another)
  • Includes AUDIO_ROUTING.md docs and list_inputs.rs example utility

Test plan

  • Configure audio_target = "tts_sink" in an output config and verify it captures from that source
  • Verify outputs without audio_target continue to use the default source
  • Run list_inputs example to confirm available PipeWire sources are listed

🤖 Generated with Claude Code

marksverdhei and others added 13 commits January 26, 2026 19:18
- Add BpmDetector in vibe-audio that uses spectral flux and autocorrelation
- Detect tempo from bass frequencies (20-200 Hz)
- BPM updates every 15 seconds with 5 BPM hysteresis for stability
- Expose iBPM as uniform at binding 4 in FragmentCanvas
- Update WGSL and GLSL preambles with iBPM declaration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- BPM detector now collects estimates over 15 minutes and uses median
- Writes current BPM to /tmp/vibe-bpm for external tools
- More stable BPM that ignores transient percussion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merges 42 upstream commits including ResourceManager removal,
Component trait refactoring, texture/sampler support, frequency
presets, and type alias improvements.

Drops fork-only BPM detection and color palette features that
are incompatible with the refactored upstream architecture.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Re-implements both features on top of upstream's refactored codebase
(no more ResourceManager, new Component trait, texture support):

- BPM detector: spectral flux + autocorrelation with median smoothing,
  exposed as iBPM uniform (binding 4), writes /tmp/vibe-bpm for waybar
- Color palette: 4 configurable colors from ~/.config/vibe/colors.toml,
  exposed as iColors uniform (binding 5), live-reloads via mtime check

Texture bindings bumped to 6/7 to accommodate new uniforms.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Some AMD GPUs expose Rgba16Unorm first which isn't renderable.
Prefer known-good 8-bit formats with fallback chain.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…capture

On PipeWire/ALSA, build_input_stream on an output device doesn't do
loopback capture. Switch to using the default input device with
supported_input_configs so PipeWire can route a monitor source for
capturing system audio output.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Start normalize_factor at 0.1 instead of 1.0 so newly loaded shaders
fade in from dim rather than flashing bright and slowly settling. Use a
faster ramp-up rate (3% vs 0.2% per frame) while below 0.5 to reach
equilibrium in ~1-2 seconds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Documents the full shader interface (uniforms, audio data, color palette),
visual techniques (raymarching, fractals, volumetrics, 4D geometry,
gravitational lensing, soft bodies), performance optimization, and color
palette integration. Derived from patterns across 12 production shaders.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New section on keeping colors saturated — the averaging trap, asymmetric
blends, additive vs mix, saturation recovery, contrast over blending.
Updated design principles to emphasize color zone separation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Each output config can now specify an `audio_target` PipeWire node name.
When set, PIPEWIRE_NODE is configured before CPAL opens the input stream,
allowing different monitors to visualize different audio sources
(e.g., TTS audio on one display, music on another).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant