Skip to content

fix: improve Linux audio device handling and waveform visualizer#1001

Open
biosed wants to merge 1 commit intothewh1teagle:mainfrom
biosed:fix/linux-audio-devices-and-visualizer
Open

fix: improve Linux audio device handling and waveform visualizer#1001
biosed wants to merge 1 commit intothewh1teagle:mainfrom
biosed:fix/linux-audio-devices-and-visualizer

Conversation

@biosed
Copy link

@biosed biosed commented Mar 8, 2026

Summary

  • Human-friendly device names: Uses cpal device.description() instead of raw ALSA pcm_ids (e.g. "MacBook Pro J314, Primary" instead of plughw:CARD=AppleJ314,DEV=0)
  • Filter ALSA device clutter: Only shows default and plughw: devices on Linux — skips raw hw:, dmix, dsnoop, surround, etc.
  • Fix crash on missing default device: Handles None from default_input_device()/default_output_device() gracefully
  • Fix ALSA recording failures: Falls back to supported_input_configs() when default_input_config() returns params that snd_pcm_hw_params rejects
  • Fix waveform visualizer on Linux: Replaces browser getUserMedia (unsupported in WebKitGTK) with backend-driven audio_amplitude events emitted from the cpal recording stream

Test plan

  • Verify audio device list shows readable names on Linux
  • Verify device list is not cluttered with raw ALSA devices
  • Verify recording from microphone works
  • Verify waveform visualizer animates during recording
  • Verify no regression on macOS/Windows audio device listing and recording

🤖 Generated with Claude Code

- Use cpal device descriptions for human-friendly names instead of raw ALSA pcm_ids
- Filter ALSA devices to only show "default" and "plughw:" (skip raw hw:, dmix, etc.)
- Handle missing default input/output devices gracefully (no crash)
- Fall back to supported_input_configs when default_input_config fails on ALSA/PipeWire
- Mark ALSA "default" device as both input and output (direction is Unknown)
- Replace browser getUserMedia-based waveform with backend-driven audio amplitude events
  (getUserMedia is unsupported in WebKitGTK on Linux)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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