3 # This script creates the proper /dev/ entries for ALSA devices.
4 # See ../Documentation/sound/alsa/ALSA-Configuration.txt for more
13 if [ "`grep -w -E "^audio" /etc/group`x" != x ]; then
18 function create_odevice () {
20 echo -n "Creating $1..."
21 mknod -m $PERM $1 c $OSSMAJOR $2
26 function create_odevices () {
30 echo -n "Creating $1?..."
31 while [ $tmp1 -lt $MAX_CARDS ]; do
33 mknod -m $PERM $1$tmp1 c $OSSMAJOR $minor
41 function create_device1 () {
44 echo -n "Creating $1..."
45 mknod -m $PERM $1 c $MAJOR $minor
50 function create_devices () {
53 echo -n "Creating $1?..."
54 while [ $tmp -lt $MAX_CARDS ]; do
56 minor=$[ $2 + $minor ]
57 mknod -m $PERM "${1}C${tmp}" c $MAJOR $minor
58 chown $OWNER "${1}C${tmp}"
64 function create_devices2 () {
67 echo -n "Creating $1??..."
68 while [ $tmp -lt $MAX_CARDS ]; do
70 while [ $tmp1 -lt $3 ]; do
72 minor=$[ $2 + $minor + $tmp1 ]
73 mknod -m $PERM "${1}C${tmp}D${tmp1}" c $MAJOR $minor
74 chown $OWNER "${1}C${tmp}D${tmp1}"
82 function create_devices3 () {
85 echo -n "Creating $1??$4..."
86 while [ $tmp -lt $MAX_CARDS ]; do
88 while [ $tmp1 -lt $3 ]; do
90 minor=$[ $2 + $minor + $tmp1 ]
91 mknod -m $PERM "${1}C${tmp}D${tmp1}${4}" c $MAJOR $minor
92 chown $OWNER "${1}C${tmp}D${tmp1}${4}"
100 if test "$1" = "-?" || test "$1" = "-h" || test "$1" = "--help"; then
101 echo "Usage: snddevices [max]"
105 if test "$1" = "max"; then
109 # OSS (Lite) compatible devices...
111 if test $OSSMAJOR -eq 14; then
112 create_odevices /dev/mixer 0
113 create_odevice /dev/sequencer 1
114 create_odevices /dev/midi 2
115 create_odevices /dev/dsp 3
116 create_odevices /dev/audio 4
117 create_odevice /dev/sndstat 6
118 create_odevice /dev/music 8
119 create_odevices /dev/dmmidi 9
120 create_odevices /dev/dmfm 10
121 create_odevices /dev/amixer 11 # alternate mixer
122 create_odevices /dev/adsp 12 # alternate dsp
123 create_odevices /dev/amidi 13 # alternate midi
124 create_odevices /dev/admmidi 14 # alternate direct midi
126 ln -svf /dev/mixer0 /dev/mixer
127 ln -svf /dev/midi0 /dev/midi
128 ln -svf /dev/dsp0 /dev/dsp
129 ln -svf /dev/audio0 /dev/audio
130 ln -svf /dev/music /dev/sequencer2
131 ln -svf /dev/adsp0 /dev/adsp
132 ln -svf /dev/amidi0 /dev/amidi
137 mv -f /dev/sndstat /dev/1sndstat
139 mv -f /dev/1sndstat /dev/sndstat
140 if [ -d /dev/snd ]; then
148 create_devices /dev/snd/control 0
149 create_device1 /dev/snd/seq 1
150 create_device1 /dev/snd/timer 33
151 create_devices2 /dev/snd/hw 4 4
152 create_devices2 /dev/snd/midi 8 8
153 create_devices3 /dev/snd/pcm 16 8 p
154 create_devices3 /dev/snd/pcm 24 8 c
158 echo "ALSA loader devices"
160 create_devices /dev/aload 0
161 create_device1 /dev/aloadSEQ 1