fix(audio): system audio never opens the mic, configured mics fail visibly #48

Merged
xavierk merged 3 commits from fix/capture-privacy into main 2026-11-06 18:35:20 +00:00
3 Commits
Author SHA1 Message Date
xavierk 5201383638 fix(audio): apply host_env outermost to the pw-record spawn
CI / security (pull_request) Successful in 1m11s
CI / lint (pull_request) Successful in 22s
CI / ai-review (pull_request) Successful in 8s
host_env() now wraps the whole child environment, and the
stream.capture.sink property is merged inside it, which is the form the
host_process convention expects. The two capture tests patch os.environ
instead of host_env.

Fixes #41
2026-11-07 00:02:41 +05:30
xavierk 71b97fe633 fix(audio): never record from another microphone when one is configured
CI / security (pull_request) Successful in 1m10s
CI / lint (pull_request) Successful in 23s
CI / ai-review (pull_request) Successful in 25s
A configured device that was virtual, output-only, renamed or unplugged
was replaced by the hardware default input, with only a log warning. The
capture source now refuses an explicit selection that cannot be used as
configured: it raises AudioDeviceUnavailableError, skips reconnection
(retrying cannot help), and reports it through the desktop notification
path. System Default (unset, or -1) keeps its implicit default.

Behaviour change: an unplugged or renamed configured microphone now fails
visibly instead of recording from the default input. Pulse source
selection is unchanged.

Fixes #42
2026-11-06 23:58:15 +05:30
xavierk 378a4f2da3 fix(audio): pin system-audio capture to the sink monitor
pw-record --target <sink> also linked the default microphone to the
stream unless stream.capture.sink was set, so system-audio capture could
open an input device. Set the property in PIPEWIRE_PROPS for the spawned
pw-record only, keeping any value the user already has.

Verified on PipeWire 1.6.10 with a null sink: the stream linked the sink
monitor and no Audio/Source node.

Fixes #41
2026-11-06 23:52:48 +05:30