Mikro->Mix gegatet: Doppelweg-Hall der Gegenseite beseitigt

Cepstral-Beweis auf #71: stabiler 80ms-Peak nur auf Gegenseiten-Segmenten
= Muschel-Bleed durchs offene Mikro zusaetzlich zum digitalen Pfad.
cr_mic2mix-Loopback entfernt, stattdessen pw-link micgate.out -> callmix
(Fallback ohne Gate bleibt). Verschmierte Embeddings (verschmolzene
Remote-Sprecher) sollten damit ebenfalls weg sein - echter Call offen.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113vDKdSNtD3Dwcw4QMu9yV
This commit is contained in:
schakal00783
2026-07-17 00:11:58 +02:00
co-authored by Claude Fable 5
parent 1016eaa095
commit 7391b0ded7
3 changed files with 45 additions and 8 deletions
+18 -2
View File
@@ -75,16 +75,32 @@ pactl set-sink-volume callmix 100% >/dev/null 2>&1
# routes — each loopback tagged so we can set per-stream gain by name
pactl load-module module-loopback source="$PCAUD" sink="$HSSINK" latency_msec=60 sink_input_properties=media.name=cr_pc2hs >/dev/null 2>&1 # PC -> headset (monitor)
pactl load-module module-loopback source="$PCAUD" sink=callmix latency_msec=60 sink_input_properties=media.name=cr_pc2mix >/dev/null 2>&1 # PC -> mix
pactl load-module module-loopback source="$HSMIC" sink=callmix latency_msec=60 sink_input_properties=media.name=cr_mic2mix >/dev/null 2>&1 # mic -> mix
pactl load-module module-loopback source="$HSMIC" sink="$MIC_OUT" latency_msec=60 sink_input_properties=media.name=cr_mic2pc >/dev/null 2>&1 # mic -> (gate ->) PC
# mic -> mix: GATED. The old direct HSMIC->callmix loopback put the far end into
# the recording TWICE — digitally (cr_pc2mix) AND ~80 ms later as earcup bleed
# through the always-open mic (cepstral peak 79-80 ms on #71) -> far-end voices
# sounded like a reverberant room AND their smeared embeddings made diarization
# merge two remote speakers into one. Tapping the gate's OUTPUT instead keeps the
# mic out of the mix in the user's speech pauses (same trick as the Teams
# self-echo fix / iPhone uplink). Fallback: no gate -> old direct loopback.
if [ "$MIC_OUT" = micgate ]; then
for i in $(seq 1 10); do
pw-link micgate.out:output_FL callmix:playback_FL >/dev/null 2>&1 && \
pw-link micgate.out:output_FR callmix:playback_FR >/dev/null 2>&1 && break
sleep 1
done
else
pactl load-module module-loopback source="$HSMIC" sink=callmix latency_msec=60 sink_input_properties=media.name=cr_mic2mix >/dev/null 2>&1 # mic -> mix (UNgated fallback)
fi
# GAIN STAGING (clip-safe): PC media hits ~0 dBFS, so knock it down hard in the
# mix; the mic runs near unity. Their sum must never reach 0 dBFS or clipping
# corrupts whisper + diarization (over-segments to many speakers). PC monitoring
# to the headset (cr_pc2hs) stays at unity — full volume.
sleep 1
si_vol cr_pc2mix 60% # far side into the recording (~-12 dB)
si_vol cr_mic2mix 100% # near side (user), into the recording mix
si_vol cr_mic2mix 100% # near side (user) into the mix — only exists in the UNgated fallback
si_vol cr_mic2pc 65% # near side to the far end (through the gate)
# NOTE: fine mic/PC balance still wants tuning on a REAL call. If the far end
# finds the user too quiet, raise cr_mic2pc / Mic gain -- but watch the gate: