Make laptop ALSA routing match Pi rover

This commit is contained in:
legop3
2026-07-07 00:01:26 -04:00
parent e6c4931210
commit 11340bf3f6
+71 -61
View File
@@ -1,88 +1,98 @@
# ALSA routing for the Debian laptop rover profile. # Dedicated ALSA routing for the Debian laptop rover profile.
# #
# This file intentionally mirrors the logical device names used by the Pi rover # This intentionally mirrors pi/asound.conf as closely as a normal PC can:
# audio setup. roverd can keep sending horn audio to "horn", forwarded browser # one fixed hardware card, one dmix playback engine, separate softvol controls
# audio to "forward", and TTS to ALSA's default playback path without caring # for TTS/horn/forwarded audio, and a raw capture alias for the rover mic.
# which physical sound card is underneath the profile. #
# This is NOT meant to preserve normal desktop audio behavior. The laptop rover
# installer disables PipeWire/PulseAudio so roverd owns the audio hardware like
# the Raspberry Pi rover does. If the laptop's real speaker/mic card is not ALSA
# card 0, change the hw:0,0/card 0 references below to the card shown by:
# aplay -l
# arecord -l
pcm.roverd_playback { # Mix multiple playback clients in software with a fixed low-cost format.
type plug pcm.dmixer {
type dmix
# Use the system's first normal ALSA playback device as the physical sink. ipc_key 1024
# This avoids referencing "default" here, because this file replaces ipc_perm 0666
# pcm.!default below and using it as a slave would recurse. slave {
slave.pcm "sysdefault" pcm "hw:0,0"
} format S16_LE
rate 16000
pcm.roverd_capture { channels 1
type plug period_time 0
period_size 1024
# The media publisher records from "default"; with pcm.!default below that buffer_size 4096
# capture side resolves here. Keeping capture separate from playback lets the }
# asym default expose ordinary microphone input while playback goes through
# the TTS softvol path.
slave.pcm "sysdefault"
} }
# TTS volume control (used by default playback path).
pcm.tts_softvol { pcm.tts_softvol {
type softvol type softvol
slave.pcm "roverd_playback" slave.pcm "dmixer"
control { control {
name "TTSMaster" name "TTSMaster"
card 0 card 0
} }
min_dB -60.0 min_dB -60.0
max_dB 12.0 max_dB 12.0
} }
# Horn volume control.
pcm.horn_softvol { pcm.horn_softvol {
type softvol type softvol
slave.pcm "roverd_playback" slave.pcm "dmixer"
control { control {
name "HornMaster" name "HornMaster"
card 0 card 0
} }
min_dB -60.0 min_dB -60.0
max_dB 12.0 max_dB 12.0
} }
# Forwarded audio volume control.
pcm.forward_softvol { pcm.forward_softvol {
type softvol type softvol
slave.pcm "roverd_playback" slave.pcm "dmixer"
control { control {
name "ForwardMaster" name "ForwardMaster"
card 0 card 0
} }
min_dB -60.0 min_dB -60.0
max_dB 12.0 max_dB 12.0
} }
# Per-source playback PCMs.
pcm.tts { pcm.tts {
type plug type plug
slave.pcm "tts_softvol" slave.pcm "tts_softvol"
} }
pcm.horn { pcm.horn {
type plug type plug
slave.pcm "horn_softvol" slave.pcm "horn_softvol"
} }
pcm.forward { pcm.forward {
type plug type plug
slave.pcm "forward_softvol" slave.pcm "forward_softvol"
} }
pcm.!default { # Capture alias used by laptop rover config defaults.
type asym pcm.rovermic {
type plug
slave.pcm "hw:0,0"
}
# Existing TTS engines play to their default ALSA output, so default playback # Defaults: TTS direct playback + raw capture on the dedicated laptop sound card.
# is intentionally the TTS path. This preserves the current TTS execution pcm.!default {
# model while still making the TTS volume control meaningful on laptops. type asym
playback.pcm "tts" playback.pcm "tts"
capture.pcm "roverd_capture" capture.pcm "rovermic"
} }
ctl.!default { ctl.!default {
type hw type hw
card 0 card 0
} }