Fix asound.conf swap issue.

This commit is contained in:
fewtarius 2022-10-21 19:59:00 -04:00
parent 4a17c8f966
commit e59f906c0f
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A

View file

@ -19,27 +19,22 @@ ctl.!default {
card 0
}
EOF
exit 0
fi
# Copy in the configuration
if [ ! -e "/storage/.config/asound.conf" ]
then
else
cp /usr/config/asound.conf /storage/.config
fi
if [ ! -e "/storage/.config/asound.state" ] && [ -e /usr/config/asound.state ]
then
cp /usr/config/asound.state /storage/.config
fi
if [ ! -e "/storage/.config/asound.state" ] && [ -e /usr/config/asound.state ]
then
cp /usr/config/asound.state /storage/.config
fi
# Set the mixer in ES
sed -i 's#<string name="AudioDevice" value="'.*'" />#<string name="AudioDevice" value="'${DEVICE_AUDIO_MIXER}'" />#' /storage/.emulationstation/es_settings.cfg
# Set the mixer in ES
sed -i 's#<string name="AudioDevice" value="'.*'" />#<string name="AudioDevice" value="'${DEVICE_AUDIO_MIXER}'" />#' /storage/.emulationstation/es_settings.cfg
# Initialize sound using the state if available.
if [ -e "/storage/.config/asound.state" ]
then
alsactl restore -f /storage/.config/asound.state
# Initialize sound using the state if available.
if [ -e "/storage/.config/asound.state" ]
then
alsactl restore -f /storage/.config/asound.state
fi
fi
VOL=$(get_setting "audio.volume" 2>/dev/null)