Tweak the post sleep quirk to use /sys.

This commit is contained in:
fewtarius 2023-04-27 11:10:03 +00:00
parent 0e1462afb3
commit 8374632236
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A

View file

@ -6,7 +6,8 @@
. /etc/profile
PBDEVICE=$(amixer get "Playback Path" | awk 'BEGIN {FS="'\''"} /Item0/ {print $2}')
DEVICE_HEADPHONE_DEV="/sys/devices/platform/rk-headset/extcon/extcon3/state"
HEADPHONE_STATE=$(awk 'BEGIN {FS="="} /HEADPHONE/ {print $2}' ${DEVICE_HEADPHONE_DEV})
alsactl init
@ -15,14 +16,12 @@ amixer -c 0 set "MUTE" "MUTE"
amixer -c 0 set "Capture MIC Path" "Main Mic"
amixer -c 0 set "Capture MIC Path" "MIC OFF"
echo ${PBDEVICE}
case ${PBDEVICE} in
HP)
case ${HEADPHONE_STATE} in
1)
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}"
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_HP}"
;;
SPK)
2)
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_HP}"
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}"
;;