fix(linux): resolve system audio device by stripping ' (System Audio)' display suffix - #728
Open
90sRehem wants to merge 1 commit into
Open
fix(linux): resolve system audio device by stripping ' (System Audio)' display suffix#72890sRehem wants to merge 1 commit into
90sRehem wants to merge 1 commit into
Conversation
…tem audio device On Linux, configure_linux_audio() decorates PulseAudio/PipeWire monitor sources with a ' (System Audio)' suffix for display and persistence. get_device_and_config() compared that decorated name against raw cpal device names, so the match never succeeded and system audio silently failed at recording start (error swallowed in stream.rs). Strip the suffix before comparing, mirroring the existing '(input)'/'(output)' stripping in AudioDevice::from_name. Fixes Zackriya-Solutions#701
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.
Fixes #701
Problem
On Linux, selecting any "System Audio" device in Settings and starting a recording never actually captures system audio, and no error is surfaced in the UI. The recording proceeds microphone-only.
Root cause
configure_linux_audio()(frontend/src-tauri/src/audio/devices/platform/linux.rs) enumerates PulseAudio/PipeWire monitor sources and decorates their names with a" (System Audio)"suffix for display:This decorated string is what gets persisted to
recording_preferences.json.At recording start,
get_device_and_config()(frontend/src-tauri/src/audio/devices/configuration.rs) resolves the actual cpal device by exact string comparison against the raw cpal device name. The stored name still carries the" (System Audio)"suffix — only"(input)"/"(output)"suffixes are stripped inAudioDevice::from_name— soname == audio_device.namenever matches and the function returnsErr("Device not found: ...").That error is swallowed in
AudioStreamManager::start_streams()(frontend/src-tauri/src/audio/stream.rs), which only logs a warning and continues with mic-only audio.Net effect: no "System Audio" entry can ever be opened on Linux, regardless of which one is selected.
Fix
Strip the
" (System Audio)"display suffix before comparing against the raw cpal device name, mirroring the existing"(input)"/"(output)"stripping already done inAudioDevice::from_name. This is an 11-line change confined to the Linux branch ofget_device_and_config(); no other platforms are affected (the change is inside#[cfg(target_os = "linux")]).Testing
cargo check --libpasses on Linux with this change.