Skip to content

fix(linux): enable PulseAudio/PipeWire system audio capture#396

Closed
belisards wants to merge 3 commits intoZackriya-Solutions:devtestfrom
belisards:enhance/linux-system-audio-devtest
Closed

fix(linux): enable PulseAudio/PipeWire system audio capture#396
belisards wants to merge 3 commits intoZackriya-Solutions:devtestfrom
belisards:enhance/linux-system-audio-devtest

Conversation

@belisards
Copy link
Copy Markdown

Fixes #383

Type of Change

  • Bug fix

Description

System audio capture was not implemented on Linux — the code explicitly bailed
out for non-macOS platforms, so only microphone audio was transcribed. Browser
meeting tools (Teams, Zoom, Meet in Chrome) were never captured.

On Linux, PulseAudio and PipeWire expose monitor sources for each output sink —
input devices that capture whatever plays through the corresponding output.

Changes:

  • Query pactl list sources short to enumerate monitor sources and show them
    in the System Audio device selector
  • Follow pactl get-default-sink to auto-select the correct monitor regardless
    of output type (Bluetooth, built-in, HDMI, USB)
  • Set PULSE_SOURCE=<monitor> and capture via the "pulse" ALSA device so
    CPAL handles it as a normal input stream
  • Add default_system_audio_device() for the Linux recording path
  • Fix discovery.rs to stop CPAL from adding raw ALSA names (pulse,
    default, hw:*) as spurious system audio options in the UI
  • Update README to document Linux system audio requirements

Prerequisites

pulseaudio-alsa or pipewire-alsa (default on Ubuntu, Fedora, Debian desktop).

Testing

  • Manual testing performed
  • Unit tests added (no unit test infrastructure exists for audio device enumeration)

Tested on

  • Ubuntu 22.04.5 LTS · kernel 6.8.0-101-generic
  • PipeWire 15.99.1 (PulseAudio compatibility)
  • Meetily v0.3.0
  • Bluetooth A2DP headphones + built-in audio
  • Chrome/Teams system audio successfully transcribed

Documentation

  • README updated with Linux system audio prerequisites

Relation to PR #309

Implements the same core approach as #309 but as a focused, standalone fix
without the unrelated feature removals bundled in that PR.

Note

This fix was developed using Claude Code (claude-sonnet-4-6).

- Use pactl to enumerate monitor sources and expose them as system audio devices
- Follow default sink via pactl get-default-sink (works with Bluetooth, USB, HDMI)
- Set PULSE_SOURCE env var and capture via pulse ALSA device
- Add default_system_audio_device() for Linux recording path
- Stop CPAL from adding raw ALSA devices as spurious system audio options
@belisards belisards closed this Mar 10, 2026
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