Merge pull request #638 from fewtarius/dev
Move speaker/headphone paths to device variables to resolve #632.
This commit is contained in:
commit
cbaf92b431
10 changed files with 24 additions and 10 deletions
|
@ -14,20 +14,20 @@ HP_OFF='*headset status is out*'
|
|||
BOOT_SETTING=$(journalctl | grep "headset status is" | tail -n 1)
|
||||
case ${BOOT_SETTING} in
|
||||
(${HP_ON})
|
||||
amixer cset name='Playback Path' HP
|
||||
amixer cset name='Playback Path' ${DEVICE_PLAYBACK_PATH_HP}
|
||||
;;
|
||||
*)
|
||||
amixer cset name='Playback Path' SPK
|
||||
amixer cset name='Playback Path' ${DEVICE_PLAYBACK_PATH_SPK}
|
||||
;;
|
||||
esac
|
||||
|
||||
journalctl -f | while read line; do
|
||||
case $line in
|
||||
(${HP_ON})
|
||||
amixer cset name='Playback Path' HP
|
||||
amixer cset name='Playback Path' ${DEVICE_PLAYBACK_PATH_HP}
|
||||
;;
|
||||
(${HP_OFF})
|
||||
amixer cset name='Playback Path' SPK
|
||||
amixer cset name='Playback Path' ${DEVICE_PLAYBACK_PATH_SPK}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
|
|
@ -25,11 +25,11 @@ HP_OFF='*(SW_HEADPHONE_INSERT), value 1*'
|
|||
evtest "${DEVICE}" | while read line; do
|
||||
case $line in
|
||||
(${HP_ON})
|
||||
amixer cset name='Playback Path' HP
|
||||
amixer cset name='Playback Path' ${DEVICE_PLAYBACK_PATH_HP}
|
||||
set_setting "audio.device" "headphone"
|
||||
;;
|
||||
(${HP_OFF})
|
||||
amixer cset name='Playback Path' SPK
|
||||
amixer cset name='Playback Path' ${DEVICE_PLAYBACK_PATH_SPK}
|
||||
set_setting "audio.device" "speakers"
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -17,12 +17,12 @@ CURRENTAUDIO=$(get_setting "audio.device")
|
|||
case "${CURRENTAUDIO}" in
|
||||
"headphone")
|
||||
echo "setting speakers"
|
||||
amixer -M cset name='Playback Path' SPK
|
||||
amixer -M cset name='Playback Path' ${DEVICE_PLAYBACK_PATH_SPK}
|
||||
set_setting "audio.device" "speakers"
|
||||
;;
|
||||
"auto"|"speakers"|*)
|
||||
echo "setting headphones"
|
||||
amixer -M cset name='Playback Path' HP
|
||||
amixer -M cset name='Playback Path' ${DEVICE_PLAYBACK_PATH_HP}
|
||||
set_setting "audio.device" "headphone"
|
||||
;;
|
||||
esac
|
||||
|
@ -33,12 +33,12 @@ if [ "${1}" == "setaudio" ];then
|
|||
case "${2}" in
|
||||
"headphone")
|
||||
echo "setting headphones"
|
||||
amixer -M cset name='Playback Path' HP
|
||||
amixer -M cset name='Playback Path' ${DEVICE_PLAYBACK_PATH_HP}
|
||||
set_setting "audio.device" "headphone"
|
||||
;;
|
||||
"auto"|"speakers"|*)
|
||||
echo "setting speakers"
|
||||
amixer -M cset name='Playback Path' SPK
|
||||
amixer -M cset name='Playback Path' ${DEVICE_PLAYBACK_PATH_SPK}
|
||||
set_setting "audio.device" "speakers"
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_AUDIO_MIXER="PCM"
|
||||
DEVICE_PLAYBACK_PATH_SPK="SPK"
|
||||
DEVICE_PLAYBACK_PATH_HP="HP"
|
||||
DEVICE_VOL_MODIFIER="ABS_RZ"
|
||||
UI_SERVICE="weston.service"
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ DEVICE_FAKE_JACKSENSE=true
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_POWER_LED=true
|
||||
DEVICE_AUDIO_MIXER="Playback"
|
||||
DEVICE_PLAYBACK_PATH_SPK="SPK"
|
||||
DEVICE_PLAYBACK_PATH_HP="HP"
|
||||
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-rk817-sound-event"
|
||||
DEVICE_BRIGHTNESS="70"
|
||||
SPLASH_LOADER="imagemagick"
|
||||
|
|
|
@ -6,6 +6,8 @@ DEVICE_FAKE_JACKSENSE=true
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_POWER_LED=true
|
||||
DEVICE_AUDIO_MIXER="Playback"
|
||||
DEVICE_PLAYBACK_PATH_SPK="SPK_HP"
|
||||
DEVICE_PLAYBACK_PATH_HP="HP"
|
||||
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-rk817-sound-event"
|
||||
DEVICE_BRIGHTNESS="70"
|
||||
SPLASH_LOADER="imagemagick"
|
||||
|
|
|
@ -6,6 +6,8 @@ DEVICE_FAKE_JACKSENSE=true
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_POWER_LED=true
|
||||
DEVICE_AUDIO_MIXER="Playback"
|
||||
DEVICE_PLAYBACK_PATH_SPK="SPK"
|
||||
DEVICE_PLAYBACK_PATH_HP="HP"
|
||||
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-rk817-sound-event"
|
||||
DEVICE_BRIGHTNESS="70"
|
||||
SPLASH_LOADER="imagemagick"
|
||||
|
|
|
@ -6,6 +6,8 @@ DEVICE_FAKE_JACKSENSE=false
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_POWER_LED=false
|
||||
DEVICE_AUDIO_MIXER="Master"
|
||||
DEVICE_PLAYBACK_PATH_SPK="SPK"
|
||||
DEVICE_PLAYBACK_PATH_HP="HP"
|
||||
#DEVICE_HEADPHONE_DEV=""
|
||||
DEVICE_BRIGHTNESS="128"
|
||||
SPLASH_LOADER="imagemagick"
|
||||
|
|
|
@ -6,6 +6,8 @@ DEVICE_FAKE_JACKSENSE=false
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_POWER_LED=false
|
||||
DEVICE_AUDIO_MIXER="Master"
|
||||
DEVICE_PLAYBACK_PATH_SPK="SPK"
|
||||
DEVICE_PLAYBACK_PATH_HP="HP"
|
||||
#DEVICE_HEADPHONE_DEV=""
|
||||
DEVICE_BRIGHTNESS="153"
|
||||
SPLASH_LOADER="imagemagick"
|
||||
|
|
|
@ -5,6 +5,8 @@ DEVICE_HAS_FAN=true
|
|||
DEVICE_FAKE_JACKSENSE=false
|
||||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_AUDIO_MIXER="DAC"
|
||||
DEVICE_PLAYBACK_PATH_SPK="SPK"
|
||||
DEVICE_PLAYBACK_PATH_HP="HP"
|
||||
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-volume-keys-event"
|
||||
DEVICE_CONTROLLER_DEV="/dev/input/by-path/platform-singleadc-joypad-event-joystick"
|
||||
DEVICE_BRIGHTNESS="128"
|
||||
|
|
Loading…
Reference in a new issue