Audio device selection does not work off Linux #53

Closed
opened 2026-08-29 09:59:51 -04:00 by Salastil · 1 comment
Owner

Voice itself is cross-platform — cpal::default_host() resolves to WASAPI on Windows and CoreAudio on macOS, and capture and playback were verified working on Windows 11.

What is Linux-only is enumeration. server_devices() shells out to pactl -f json (backend/audio.rs:144), and where there is no PulseAudio or PipeWire the fallback offers exactly two entries — "default input" and "default output". So a Windows user can talk and be heard but cannot choose which microphone or speaker.

Live device switching has the same cause: route_input moves a stream with pactl move-source-output, which does not exist off Linux.

The pactl choice is well-reasoned and should stay — ALSA presents its whole plugin chain as devices and cpal reports them all as "Unknown", so there is nothing there to pick a microphone out of. This is about adding a second path, not replacing that one.

Done looks like: enumerate via cpal's device list on Windows and macOS (where the host API does give real names), keep pactl on Linux, and rebuild the stream on device change where moving it is not possible.


Filed from a protocol coverage survey of the four deployed protocols, 2026-08-29 (moho 1a11250, nobilis 030707f).

Voice itself is cross-platform — `cpal::default_host()` resolves to WASAPI on Windows and CoreAudio on macOS, and capture and playback were verified working on Windows 11. What is Linux-only is **enumeration**. `server_devices()` shells out to `pactl -f json` (`backend/audio.rs:144`), and where there is no PulseAudio or PipeWire the fallback offers exactly two entries — "default input" and "default output". So a Windows user can talk and be heard but cannot choose which microphone or speaker. Live device switching has the same cause: `route_input` moves a stream with `pactl move-source-output`, which does not exist off Linux. The `pactl` choice is well-reasoned and should stay — ALSA presents its whole plugin chain as devices and cpal reports them all as "Unknown", so there is nothing there to pick a microphone out of. This is about adding a second path, not replacing that one. **Done looks like:** enumerate via cpal's device list on Windows and macOS (where the host API does give real names), keep `pactl` on Linux, and rebuild the stream on device change where moving it is not possible. --- _Filed from a protocol coverage survey of the four deployed protocols, 2026-08-29 (moho `1a11250`, nobilis `030707f`)._
Salastil added the feature label 2026-08-29 09:59:51 -04:00
Author
Owner

Finished — nobilis 1deaeaa

Finished — nobilis [`1deaeaa`](https://git.salastil.com/Salastil/nobilis/commit/1deaeaa)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#53