49 lines
1.3 KiB
Text
49 lines
1.3 KiB
Text
|
#!/bin/bash
|
||
|
# SPDX-License-Identifier: Apache-2.0
|
||
|
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
||
|
|
||
|
. /etc/profile
|
||
|
|
||
|
### Temporary device quirk for VCS
|
||
|
if [ -e "/usr/sbin/dmidecode" ] && \
|
||
|
[ ! -e "/storage/.config/modprobe.d/alsa-base.conf" ]
|
||
|
then
|
||
|
THIS_DEVICE="$(/usr/sbin/dmidecode -s system-product-name)"
|
||
|
if [[ "${THIS_DEVICE}" =~ ^VCS ]]
|
||
|
then
|
||
|
if [ ! -d "/storage/.config/modprobe.d/" ]
|
||
|
then
|
||
|
mkdir -p /storage/.config/modprobe.d
|
||
|
fi
|
||
|
touch /storage/.config/modprobe.d/alsa-base.conf
|
||
|
set-audio "DEFAULT HDMI"
|
||
|
reboot
|
||
|
fi
|
||
|
fi
|
||
|
|
||
|
if [ ! -e "/storage/.config/asound.conf" ]
|
||
|
then
|
||
|
set-audio "DEFAULT (SYSTEM PROVIDED)"
|
||
|
fi
|
||
|
|
||
|
if [ ! -e "/storage/.config/asound.state" ] && [ -e /usr/config/asound.state ]
|
||
|
then
|
||
|
cp /usr/config/asound.state /storage/.config
|
||
|
fi
|
||
|
|
||
|
# Temporary patch since ES doesn't find the DAC on the RG552.
|
||
|
DACTEST=$(grep DAC /storage/.config/emulationstation/es_settings.cfg 2>/dev/null)
|
||
|
if [ ! "$?" = 0 ]
|
||
|
then
|
||
|
sed -i '/^.*AudioCard.*$/a \\t<string name="AudioDevice" value="DAC" \/>' /storage/.config/emulationstation/es_settings.cfg
|
||
|
fi
|
||
|
|
||
|
# Initialize sound using the state if available.
|
||
|
if [ -e "/storage/.config/asound.state" ]
|
||
|
then
|
||
|
alsactl restore -f /storage/.config/asound.state
|
||
|
fi
|
||
|
|
||
|
VOL=$(get_setting "audio.volume" 2>/dev/null)
|
||
|
amixer -M set "${DEVICE_AUDIO_MIXER}" ${VOL}%
|