summaryrefslogtreecommitdiff
blob: 6c588ff70abc9445a8955c3716ffa21a89a02ae1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/sbin/openrc-run

depend()
{
	need alsasound
}

start()
{
	if [ -e /proc/asound/cards ]
	then
		for i in $(grep -o '^\s\?[0-9]\+' /proc/asound/cards)
		do
			ebegin "Unmuting sound card $i"
			if [ -d /proc/asound/card$i ] && [ -x /usr/bin/amixer ]
			then
				amixer -c $i scontrols > /etc/amixer
				[ -n "$(grep Master /etc/amixer)" ] \
					&& amixer -c $i -q set Master 95% unmute \
					>/dev/null 2>&1
				[ -n "$(grep Front /etc/amixer)" ] \
					&& amixer -c $i -q set Front 95% unmute \
					>/dev/null 2>&1
				[ -n "$(grep HDMI /etc/amixer)" ] \
					&& amixer -c $i -q set HDMI 95% unmute \
					>/dev/null 2>&1
				[ -n "$(grep IEC958 /etc/amixer)" ] \
					&& amixer -c $i -q set IEC958 95% unmute \
					>/dev/null 2>&1
				[ -n "$(grep PCM /etc/amixer)" ] \
					&& amixer -c $i -q set PCM 95% unmute \
					>/dev/null 2>&1
				[ -n "$(grep Speaker /etc/amixer)" ] \
					&& amixer -c $i -q set Speaker 95% unmute \
					>/dev/null 2>&1
				[ -n "$(grep Mic /etc/amixer)" ] \
					&& amixer -c $i -q set Mic 95% mute cap \
					>/dev/null 2>&1
				[ -n "$(grep Wave /etc/amixer)" ] \
					&& amixer -c $i -q set Wave 95% unmute \
					>/dev/null 2>&1
				[ -n "$(grep Capture /etc/amixer)" ] \
					&& amixer -c $i -q set Capture 95% unmute cap \
					>/dev/null 2>&1
			fi
			eend 0
		done
	fi
	return 0
}