Link Here
|
18 |
|
18 |
|
19 |
# Fail if needed files and directories are not available, |
19 |
# Fail if needed files and directories are not available, |
20 |
# so that the event can be retried later. |
20 |
# so that the event can be retried later. |
21 |
[ -d "$STATEPATH" ] && [ -x "$AMIXER" ] && [ -x "$ALSACTL" ] || exit 1 |
21 |
## NB: split the check into relevant parts, we don't really |
|
|
22 |
## need anything else than amixer and set_mixer_default() |
23 |
## in LTSP chroot -- mike@altlinux.org 20071214 |
24 |
#[ -d "$STATEPATH" ] && [ -x "$AMIXER" ] && [ -x "$ALSACTL" ] || exit 1 |
22 |
|
25 |
|
23 |
mixer() |
26 |
mixer() |
24 |
{ |
27 |
{ |
Link Here
|
28 |
|
31 |
|
29 |
set_mixer_default() |
32 |
set_mixer_default() |
30 |
{ |
33 |
{ |
|
|
34 |
[ -x "$AMIXER" ] || exit 1 |
31 |
mesg "Set default mixer values for $DEVPATH ($CARDN)" |
35 |
mesg "Set default mixer values for $DEVPATH ($CARDN)" |
32 |
mixer Master 75% |
36 |
mixer Master 75% |
33 |
mixer PCM 90% |
37 |
mixer PCM 90% |
Link Here
|
56 |
|
60 |
|
57 |
restore_mixer() |
61 |
restore_mixer() |
58 |
{ |
62 |
{ |
|
|
63 |
[ -d "$STATEPATH" ] && [ -x "$ALSACTL" ] || exit 1 |
59 |
mesg "Restore mixer values for $DEVPATH ($CARDN)" |
64 |
mesg "Restore mixer values for $DEVPATH ($CARDN)" |
60 |
ret=`$ALSACTL -F -f "$STATEPATH/asound$CARDN.state" restore $CARDN 2>&1` |
65 |
ret=`$ALSACTL -F -f "$STATEPATH/asound$CARDN.state" restore $CARDN 2>&1` |
61 |
[ "$ret" = "" ] || return 1 |
66 |
[ "$ret" = "" ] || return 1 |
Link Here
|
63 |
|
68 |
|
64 |
save_mixer() |
69 |
save_mixer() |
65 |
{ |
70 |
{ |
|
|
71 |
[ -d "$STATEPATH" ] && [ -x "$ALSACTL" ] || exit 1 |
66 |
rm -f "$STATEPATH/asound$CARDN.state" |
72 |
rm -f "$STATEPATH/asound$CARDN.state" |
67 |
$ALSACTL -f "$STATEPATH/asound$CARDN.state" store $CARDN |
73 |
$ALSACTL -f "$STATEPATH/asound$CARDN.state" store $CARDN |
68 |
ret=$? |
74 |
ret=$? |