summaryrefslogtreecommitdiff
path: root/pm/sleep.d/65alsa
blob: 37ba3febfc3eac9e7b1ee020457be611c0a53e75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# Ensure that ALSA state is saved and restored correctly.
# TODO: Modern ALSA does not need this hack.  Is it worth trying to detect
#       that and disable this hook if we do not need it?

. "${PM_FUNCTIONS}"

command_exists alsactl || exit $NA

case "$1" in
	hibernate|suspend)
		alsactl store 0 >/dev/null 2>&1
		;;
	thaw|resume) 
		alsactl restore 0 >/dev/null 2>&1
		;;
	*) exit $NA
		;;
esac