distribution/packages/hardware/quirks/devices/Powkiddy x55/sleep.d/post/001-audio

29 lines
810 B
Text
Raw Normal View History

2023-04-27 11:06:51 +00:00
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
2023-04-27 11:06:51 +00:00
# Workaround for no audio on wake from sleep.
. /etc/profile
DEVICE_HEADPHONE_DEV="/sys/devices/platform/rk-headset/extcon/extcon3/state"
HEADPHONE_STATE=$(awk 'BEGIN {FS="="} /HEADPHONE/ {print $2}' ${DEVICE_HEADPHONE_DEV})
2023-04-27 11:06:51 +00:00
amixer -c 0 set "MUTE" "MUTE"
amixer -c 0 set "Capture MIC Path" "Main Mic"
amixer -c 0 set "Capture MIC Path" "MIC OFF"
case ${HEADPHONE_STATE} in
1)
2023-04-27 11:06:51 +00:00
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}"
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_HP}"
;;
2023-04-27 11:14:30 +00:00
0)
2023-04-27 11:06:51 +00:00
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_HP}"
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}"
;;
esac
amixer -c 0 set "MUTE" "UNMUTE"