diff --git a/packages/hardware/quirks/devices/Powkiddy x55/sleep/post/001-audio b/packages/hardware/quirks/devices/Powkiddy x55/sleep/post/001-audio index 2df83ae3f..046a8962d 100644 --- a/packages/hardware/quirks/devices/Powkiddy x55/sleep/post/001-audio +++ b/packages/hardware/quirks/devices/Powkiddy x55/sleep/post/001-audio @@ -6,23 +6,20 @@ . /etc/profile -PBDEVICE=$(amixer get "Playback Path" | awk 'BEGIN {FS="'\''"} /Item0/ {print $2}') - -alsactl init +DEVICE_HEADPHONE_DEV="/sys/devices/platform/rk-headset/extcon/extcon3/state" +HEADPHONE_STATE=$(awk 'BEGIN {FS="="} /HEADPHONE/ {print $2}' ${DEVICE_HEADPHONE_DEV}) 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) + 0) amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_HP}" amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}" ;;