MycroftOS: Force all ALSA sound request to be forwarded to pulseaudio

This commit is contained in:
Peter Steenbergen 2019-11-13 08:33:51 +01:00
parent 8498108492
commit 7a54a0d8cf
5 changed files with 11 additions and 58 deletions

View File

@ -3,12 +3,10 @@
set -x
exec 1>/var/log/$(basename $0).log 2>&1
rm /etc/asound.conf
rm /etc/pulse/default.pa
rm /etc/pulse/system.pa
rm /etc/pulse/daemon.conf
ln -s /etc/default-asound.conf /etc/asound.conf
ln -s /etc/pulse/pulseaudio-default.pa /etc/pulse/default.pa
ln -s /etc/pulse/pulseaudio-system.pa /etc/pulse/system.pa
ln -s /etc/pulse/pulseaudio-daemon.conf /etc/pulse/daemon.conf

View File

@ -21,11 +21,6 @@ define RESPEAKER_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0644 $(BR2_EXTERNAL_MYCROFTOS_PATH)/package/respeaker/respeaker.conf \
$(TARGET_DIR)/etc/modules-load.d/respeaker.conf
mkdir -p $(TARGET_DIR)/etc/voicecard
rm $(@D)/dkms.conf
$(INSTALL) -D -m 0644 $(@D)/*.conf $(TARGET_DIR)/etc/voicecard
$(INSTALL) -D -m 0644 $(@D)/*.state $(TARGET_DIR)/etc/voicecard
$(INSTALL) -D -m 0755 $(@D)/seeed-voicecard $(TARGET_DIR)/usr/bin
$(INSTALL) -D -m 0755 $(BR2_EXTERNAL_MYCROFTOS_PATH)/package/respeaker/seeed-voicecard \
$(TARGET_DIR)/usr/bin

View File

@ -93,15 +93,11 @@ overlay=""
if [ "x${is_1a}" != "x" ] && [ "x${is_35}" == "x" ] ; then
echo "install 2mic"
overlay=seeed-2mic-voicecard
asound_conf=/etc/voicecard/asound_2mic.conf
asound_state=/etc/voicecard/wm8960_asound.state
fi
if [ "x${is_3b}" != "x" ] && [ "x${is_35}" == "x" ] ; then
echo "install 4mic"
overlay=seeed-4mic-voicecard
asound_conf=/etc/voicecard/asound_4mic.conf
asound_state=/etc/voicecard/ac108_asound.state
pulse_default=/etc/pulse/seeed-voicecard-4mic-default.pa
pulse_daemon=/etc/pulse/seeed-voicecard-4mic-daemon.conf
fi
@ -109,8 +105,6 @@ fi
if [ "x${is_3b}" != "x" ] && [ "x${is_35}" != "x" ] ; then
echo "install 6mic"
overlay=seeed-8mic-voicecard
asound_conf=/etc/voicecard/asound_6mic.conf
asound_state=/etc/voicecard/ac108_6mic.state
pulse_default=/etc/pulse/seeed-voicecard-8mic-default.pa
pulse_daemon=/etc/pulse/seeed-voicecard-8mic-daemon.conf
fi
@ -119,8 +113,6 @@ if [ "$overlay" ]; then
echo Install $overlay ...
# Remove old configuration
rm /etc/asound.conf
rm /var/lib/alsa/asound.state
rm /etc/pulse/default.pa
rm /etc/pulse/system.pa
rm /etc/pulse/daemon.conf
@ -143,10 +135,7 @@ if [ "$overlay" ]; then
#make sure the driver loads correctly
dtoverlay $overlay || true
echo "create $overlay asound configure file"
ln -s $asound_conf /etc/asound.conf
echo "create $overlay asound status file"
ln -s $asound_state /var/lib/alsa/asound.state
#install pulseaudio files
echo "create $overlay pulse default file"
ln -s $pulse_default /etc/pulse/default.pa
echo "create $overlay pulse system file"
@ -155,9 +144,4 @@ if [ "$overlay" ]; then
ln -s $pulse_daemon /etc/pulse/daemon.conf
fi
alsactl restore
#Fore 3.5mm ('headphone') jack
amixer cset numid=3 1
touch /var/lock/seeed-voicecard

View File

@ -1,19 +1,14 @@
defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0
pcm.!default {
type plug
slave.pcm "master"
# Use PulseAudio by default
pcm.!default {
type pulse
fallback "sysdefault"
hint {
show on
description "Default ALSA Output (currently PulseAudio Sound Server)"
}
}
ctl.!default {
type hw card 0
}
pcm.master {
type softvol
slave.pcm "plughw:0"
control.name "Master"
control.card 0
type pulse
fallback "sysdefault"
}

View File

@ -1,19 +0,0 @@
defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0
pcm.!default {
type plug
slave.pcm "master"
}
ctl.!default {
type hw card 0
}
pcm.master {
type softvol
slave.pcm "plughw:0"
control.name "Master"
control.card 0
}