Isolate the Scarlett microphone capture channel (V-487)

This commit is contained in:
2026-08-13 01:27:14 +04:00
parent 01c96abdd5
commit 56254a51fa
2 changed files with 47 additions and 11 deletions
+20 -11
View File
@@ -32,6 +32,7 @@
# means out of this unit's own journal, never by guessing.
#
# install: cp to ~/.config/systemd/user/ on workpc
# cp ../deploy/asoundrc to ~/.asoundrc on workpc
# systemctl --user enable --now mavwaked.service
[Unit]
@@ -46,22 +47,30 @@ After=maven-voice-tunnel.service
# it returns RMS 0.00004 with its capture switch on and its ALSA volume at the
# full 496 of 496. That silence is in the hardware, so no flag reaches it.
#
# Named CARD=Gen and not card 4, because a USB card number moves when
# something else is replugged and this daemon must not change ears quietly.
# mavmic and not plughw:CARD=Gen,DEV=0. deploy/asoundrc defines mavmic and
# carries the whole reason: the card's capture stream is 4 channels, and two of
# them are a unity-gain loopback of everything the workstation plays. plughw
# downmixes all four, so a TV show woke her with the gain knob at 0. Install
# that file as ~/.asoundrc on workpc or this device does not resolve.
#
# Named CARD=Gen inside mavmic and not card 4, because a USB card number moves
# when something else is replugged and this daemon must not change ears quietly.
# Not "default" either: that follows whatever pipewire last decided.
#
# plughw and not hw. mavwaked asks arecord for 16kHz mono, which is what the
# whole pipeline is canonical in. Neither microphone offers it, so bare hw
# dies on "Channels count non available" before a frame is read. plughw puts
# ALSA's downmix and resampler in front. Any replacement wants the same.
# mavmic is a plug device and not hw. mavwaked asks arecord for 16kHz mono,
# which is what the whole pipeline is canonical in. Neither microphone offers
# it, so bare hw dies on "Channels count non available" before a frame is read.
# Any replacement wants ALSA's resampler in front the same way.
#
# The Scarlett measured RMS 0.003 against 0.14 on the onboard input, so its
# front-panel gain is the thing to raise if she mishears. That is a knob, not
# a control ALSA exposes. The two loud devices, the onboard ALC897 and the
# camera, both clip at peak 1.0 and are worse candidates, not better ones.
# The mic is on the XLR, which is Analogue 2 on this card and not Analogue 1:
# Air and 48V are both named for Line In 2 and both belong to a mic preamp.
# Measured 2026-08-09 through mavmic at 16kHz mono, gain up: rms 0.01826 peak
# 0.09290 spoken, against a 0.00031 preamp floor, and 0.00002 for the whole
# stream with a show playing. Front-panel gain is still the thing to raise if
# she mishears, and it is a knob, not a control ALSA exposes.
Environment=LD_LIBRARY_PATH=%h/.local/lib
ExecStart=%h/.local/bin/mavwaked \
-device plughw:CARD=Gen,DEV=0 \
-device mavmic \
-addr 127.0.0.1:9100 \
-lang ru \
-vad-model %h/.local/share/maven/models/silero_vad.onnx \