add volume control

This commit is contained in:
Alfonso Gamboa 2022-06-04 04:11:59 -07:00
parent 429243ed69
commit 041e7d2663
2 changed files with 10 additions and 6 deletions

View File

@ -68,11 +68,11 @@ else
echo "first boot, initializing"
if [[ "$V2" == "true" ]]; then
insmod /opt/wz_mini/lib/modules/3.10.14_v2/kernel/audio.ko
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/wz_mini/usr/share/audio/init_v2.wav 70
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/wz_mini/usr/share/audio/init_v2.wav $AUDIO_PROMPT_VOLUME
rmmod audio
else
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/kernel/audio.ko spk_gpio=$GPIO alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/init.wav 50
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/init.wav $AUDIO_PROMPT_VOLUME
rmmod audio
fi
fi
@ -132,11 +132,11 @@ chmod 400 /etc/shadow
if [[ -e /opt/wz_mini/swap.gz ]]; then
if [[ "$V2" == "true" ]]; then
insmod /opt/wz_mini/lib/modules/3.10.14_v2/kernel/audio.ko
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/wz_mini/usr/share/audio/swap_v2.wav 70
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/wz_mini/usr/share/audio/swap_v2.wav $AUDIO_PROMPT_VOLUME
rmmod audio
else
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/kernel/audio.ko spk_gpio=$GPIO alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/swap.wav 50
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/swap.wav $AUDIO_PROMPT_VOLUME
rmmod audio
fi
echo "swap archive present, extracting"

View File

@ -51,6 +51,10 @@ reboot
upgrade_mode_start() {
export WZMINI_CFG=/opt/wz_mini/wz_mini.conf
[ -f $WZMINI_CFG ] && source $WZMINI_CFG
set -x
#WCV3 AUDIO GPIO
@ -79,11 +83,11 @@ fi
if [[ "$V2" == "true" ]]; then
insmod /opt/wz_mini/lib/modules/3.10.14_v2/kernel/audio.ko
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/wz_mini/usr/share/audio/upgrade_mode_v2.wav 70
LD_LIBRARY_PATH='/opt/wz_mini/lib' /opt/wz_mini/bin/audioplay_t20 /opt/wz_mini/usr/share/audio/upgrade_mode_v2.wav $AUDIO_PROMPT_VOLUME
rmmod audio
else
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/kernel/audio.ko spk_gpio=$GPIO alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/upgrade_mode.wav 50
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/upgrade_mode.wav $AUDIO_PROMPT_VOLUME
rmmod audio
fi