mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
ugh
This commit is contained in:
+3
-37
@@ -1,45 +1,11 @@
|
|||||||
# Use the Google Voice HAT soundcard as index 0 (primary card)
|
# Use the Google Voice HAT soundcard as index 0 (primary card)
|
||||||
options snd_rpi_googlevoicehat_soundcard index=0
|
options snd_rpi_googlevoicehat_soundcard index=0
|
||||||
|
|
||||||
# Define a soft volume control for the speaker (Playback)
|
# Simple defaults: direct playback/capture on card 0
|
||||||
pcm.softvol {
|
|
||||||
type softvol
|
|
||||||
slave.pcm "dmix" # route through dmix for mixing
|
|
||||||
control {
|
|
||||||
name "Master" # name of volume control
|
|
||||||
card 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Shareable mic capture on the Google Voice HAT (card 0)
|
|
||||||
pcm.micdup {
|
|
||||||
type dsnoop
|
|
||||||
ipc_key 2048
|
|
||||||
slave {
|
|
||||||
pcm "hw:0,0"
|
|
||||||
channels 1
|
|
||||||
rate 16000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Define a software volume (gain) for the microphone (Capture)
|
|
||||||
pcm.micboost {
|
|
||||||
type softvol
|
|
||||||
slave.pcm "micdup" # route through dsnoop wrapper
|
|
||||||
control {
|
|
||||||
name "Micro" # name of mic gain control
|
|
||||||
card 0
|
|
||||||
}
|
|
||||||
min_dB -10.0
|
|
||||||
max_dB 50.0
|
|
||||||
resolution 256
|
|
||||||
}
|
|
||||||
|
|
||||||
# Set default devices to use the above for asymmetrical playback/capture
|
|
||||||
pcm.!default {
|
pcm.!default {
|
||||||
type asym
|
type asym
|
||||||
playback.pcm "plug:softvol"
|
playback.pcm "plughw:0,0"
|
||||||
capture.pcm "plug:micboost"
|
capture.pcm "plughw:0,0"
|
||||||
}
|
}
|
||||||
|
|
||||||
ctl.!default {
|
ctl.!default {
|
||||||
|
|||||||
@@ -152,6 +152,15 @@ install_audio_support() {
|
|||||||
if ! boot_config="$(find_boot_config)"; then
|
if ! boot_config="$(find_boot_config)"; then
|
||||||
log "WARNING: unable to locate /boot config.txt; please enable googlevoicehat-soundcard overlay manually"
|
log "WARNING: unable to locate /boot config.txt; please enable googlevoicehat-soundcard overlay manually"
|
||||||
else
|
else
|
||||||
|
# Ensure onboard audio is disabled (prevents card index flapping)
|
||||||
|
if grep -Eq '^\s*dtparam=audio=on\b' "$boot_config"; then
|
||||||
|
log "Disabling onboard audio (dtparam=audio=on -> off) in $boot_config"
|
||||||
|
sed -i 's/^\s*dtparam=audio=on\b/# roverd disabled onboard audio\ndtparam=audio=off/' "$boot_config"
|
||||||
|
fi
|
||||||
|
if ! grep -Eq '^\s*dtparam=audio=off\b' "$boot_config"; then
|
||||||
|
log "Adding dtparam=audio=off to $boot_config"
|
||||||
|
echo "dtparam=audio=off" >> "$boot_config"
|
||||||
|
fi
|
||||||
if ! grep -Eq '^\s*dtoverlay=googlevoicehat-soundcard\b' "$boot_config"; then
|
if ! grep -Eq '^\s*dtoverlay=googlevoicehat-soundcard\b' "$boot_config"; then
|
||||||
local backup="${boot_config}.roverd.$(date +%Y%m%d%H%M%S).bak"
|
local backup="${boot_config}.roverd.$(date +%Y%m%d%H%M%S).bak"
|
||||||
cp "$boot_config" "$backup"
|
cp "$boot_config" "$backup"
|
||||||
@@ -159,7 +168,6 @@ install_audio_support() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo "# Added by roverd installer to enable Google AIY v1 sound card"
|
echo "# Added by roverd installer to enable Google AIY v1 sound card"
|
||||||
echo "dtoverlay=googlevoicehat-soundcard"
|
echo "dtoverlay=googlevoicehat-soundcard"
|
||||||
echo "dtparam=audio=off"
|
|
||||||
} >> "$boot_config"
|
} >> "$boot_config"
|
||||||
log "Enabled googlevoicehat-soundcard overlay in $boot_config (backup at $backup). Reboot required."
|
log "Enabled googlevoicehat-soundcard overlay in $boot_config (backup at $backup). Reboot required."
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user