3 # aumix Sound mixer setup.
7 # description: Saves sound mixer's settings on system shutdown and restores
8 # them on system startup.
10 # Source function library
11 . /etc/rc.d/init.d/functions
13 . /etc/sysconfig/aumix
15 # See how we were called.
18 # Check if the service is already running?
19 if [ ! -f /var/lock/subsys/aumix ]; then
20 show "Setting up sound card mixer"
22 if [ "$AUMIX_AUTO_INIT" = "yes" ]; then
23 aumix -f /etc/aumixrc -L >/dev/null
25 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/aumix
27 touch /var/lock/subsys/aumix
31 nls "Sound card mixer is already set up"
36 if [ -f /var/lock/subsys/aumix ]; then
37 show "Saving sound card mixer's settings"
39 if [ "$AUMIX_AUTO_SAVE" = "yes" ]; then
40 aumix -f /etc/aumixrc -S
42 rm -f /var/lock/subsys/aumix >/dev/null 2>&1
45 nls "Sound card mixer hasn't been set up"
54 show "Saving sound card mixer's settings"
56 aumix -f /etc/aumixrc -S
60 show "Setting up sound card mixer"
62 aumix -f /etc/aumixrc -L >/dev/null
66 cat /proc/devices | grep -q "\(sparcaudio\|sound\)"
68 lsmod | grep -q "\(sound\|audio\)"
70 echo "Modular sound card detected."
72 echo "Monolithic sound card detected."
75 cat /dev/sndstat 2> /dev/null | grep -A 1 "Midi devices:" | grep -q [0-9]:
77 echo "MIDI device present."
79 cat /dev/sndstat >/dev/null 2>&1
81 echo "MIDI device not detected."
86 echo "Sound card not configured."
90 msg_usage "$0 {start|stop|status|restart|save|restore}"