Merge pull request #1362 from fewtarius/dev
Update the post hook to use /sys.
This commit is contained in:
commit
2f16d86a52
1 changed files with 5 additions and 8 deletions
|
@ -6,23 +6,20 @@
|
||||||
|
|
||||||
. /etc/profile
|
. /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
|
|
||||||
|
|
||||||
amixer -c 0 set "MUTE" "MUTE"
|
amixer -c 0 set "MUTE" "MUTE"
|
||||||
|
|
||||||
amixer -c 0 set "Capture MIC Path" "Main Mic"
|
amixer -c 0 set "Capture MIC Path" "Main Mic"
|
||||||
amixer -c 0 set "Capture MIC Path" "MIC OFF"
|
amixer -c 0 set "Capture MIC Path" "MIC OFF"
|
||||||
|
|
||||||
echo ${PBDEVICE}
|
case ${HEADPHONE_STATE} in
|
||||||
|
1)
|
||||||
case ${PBDEVICE} in
|
|
||||||
HP)
|
|
||||||
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}"
|
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}"
|
||||||
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_HP}"
|
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_HP}"
|
||||||
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}"
|
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}"
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue