From 507ea58da82c28c35390a56d8b969e51b70d9e04 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Fri, 7 Aug 2026 12:59:15 +0200 Subject: [PATCH] fix(host/audio): the silent-sink check recognizes the minted Speakers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Observed in the first real session on the substrate: the loopback ran on the minted 'Punktfunk Speakers' (silent on the host by construction), but have_silent name-matches only the Streaming Microphone — so the capture open logged 'desktop audio will also play on the host' (false) and re-attempted the Steam-pair install it doesn't need. The minted sink is recognized by id; its name honestly says Speakers, which the name rule must keep refusing for FOREIGN instances. --- .../punktfunk-host/src/audio/windows/wasapi_cap.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/punktfunk-host/src/audio/windows/wasapi_cap.rs b/crates/punktfunk-host/src/audio/windows/wasapi_cap.rs index bad81aff..3e29b0c9 100644 --- a/crates/punktfunk-host/src/audio/windows/wasapi_cap.rs +++ b/crates/punktfunk-host/src/audio/windows/wasapi_cap.rs @@ -372,10 +372,16 @@ fn capture_once( // driver INFs later appear (Steam installed mid-run) — files are invisible to the // endpoint-set fingerprint, so nothing else would ever retry. if assert_plan && !audio_control::host_audio_requested() { + // "Silent on the host" is true for the name-matched Streaming Microphone AND for the + // minted "Punktfunk Speakers" (identified by id — its NAME says Speakers, which the + // name rule rightly refuses). Without the id check, a session on the minted sink + // logged "desktop audio will also play on the host" (false) and re-attempted the + // Steam-pair install it doesn't need (observed live, first substrate session). let have_silent = |w: &wiring_plan::Wiring| { - w.loopback_render - .as_ref() - .is_some_and(|(n, _)| wiring_plan::silent_sink(&n.to_lowercase())) + w.loopback_render.as_ref().is_some_and(|(n, id)| { + wiring_plan::silent_sink(&n.to_lowercase()) + || super::minted::minted_ids().speakers_render.as_deref() == Some(id.as_str()) + }) }; static TRIED_WITH_INFS: Mutex> = Mutex::new(None); let should_try = !have_silent(&plan.wiring) && {