File: insert

package info (click to toggle)
alsa-driver 1.0.8-7sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 15,840 kB
  • ctags: 43,253
  • sloc: ansic: 257,429; sh: 18,021; makefile: 1,741; perl: 1,316; python: 1,280; xml: 448; awk: 66
file content (478 lines) | stat: -rwxr-xr-x 11,410 bytes parent folder | download
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
#!/bin/bash

INSMOD="/sbin/insmod"
MODPROBE="/sbin/modprobe"
MODDIR="../modules"
MAP="../snd.map"
OLDMAP="../snd.map.old"
CARDS_LIMIT=2

function banner() {
   echo > /dev/null
#  echo "Inserting $1.."
#  sleep 1
}

function isapnp() {
  if [ -r $MODDIR/isapnp.o ]; then
    banner "isapnp"
    if ! $INSMOD -m $MODDIR/isapnp.o >> $MAP; then exit 1; fi
  fi
}

function basic() {
  $MODPROBE -q soundcore 2> /dev/null
  banner "snd-page-alloc"
  if ! $INSMOD -m $MODDIR/snd-page-alloc.o >> $MAP; then exit 1; fi
  banner "snd"
  if ! $INSMOD -m $MODDIR/snd.o cards_limit=$CARDS_LIMIT >> $MAP; then exit 1; fi
  if [ -r $MODDIR/snd-mixer-oss.o ]; then
    banner "snd-mixer-oss"
    if ! $INSMOD -m $MODDIR/snd-mixer-oss.o >> $MAP; then exit 1; fi  
  fi
  banner "snd-timer"
  if ! $INSMOD -m $MODDIR/snd-timer.o >> $MAP; then exit 1; fi
  banner "snd-pcm"
  if ! $INSMOD -m $MODDIR/snd-pcm.o preallocate_dma=1 >> $MAP; then exit 1; fi
  if [ -r $MODDIR/snd-pcm-oss.o ]; then
    banner "snd-pcm-oss"
    if ! $INSMOD -m $MODDIR/snd-pcm-oss.o >> $MAP; then exit 1; fi  
  fi
  if [ -r $MODDIR/snd-seq-device.o ]; then
    banner "snd-seq-device"
    if ! $INSMOD -m $MODDIR/snd-seq-device.o >> $MAP; then exit 1; fi
  fi
  if [ -r $MODDIR/snd-rawmidi.o ]; then
    banner "snd-rawmidi"
    if ! $INSMOD -m $MODDIR/snd-rawmidi.o >> $MAP; then exit 1; fi
  fi
  if [ -r $MODDIR/snd-hwdep.o ]; then
    banner "snd-hwdep"
    if ! $INSMOD -m $MODDIR/snd-hwdep.o >> $MAP; then exit 1; fi
  fi
  if [ -r $MODDIR/snd-seq.o ]; then
    banner "snd-seq"
    if ! $INSMOD -m $MODDIR/snd-seq.o seq_default_timer_class=2 seq_default_timer_card=0 seq_default_timer_device=0 seq_default_timer_subdevice=0 >> $MAP; then exit 1; fi
    if [ -r $MODDIR/snd-seq-midi-event.o ]; then
      banner "snd-seq-midi-event"
      if ! $INSMOD -m $MODDIR/snd-seq-midi-event.o >> $MAP; then exit 1; fi
    fi
    if [ -r $MODDIR/snd-seq-midi.o ]; then
      banner "snd-seq-midi"
      if ! $INSMOD -m $MODDIR/snd-seq-midi.o >> $MAP; then exit 1; fi
    fi
    if [ -r $MODDIR/snd-seq-midi-emul.o ]; then
      banner "snd-seq-midi-emul"
      if ! $INSMOD -m $MODDIR/snd-seq-midi-emul.o >> $MAP; then exit 1; fi
    fi
    if [ -r $MODDIR/snd-seq-instr.o ]; then
      banner "snd-seq-instr"
      if ! $INSMOD -m $MODDIR/snd-seq-instr.o >> $MAP; then exit 1; fi
    fi
    if [ -r $MODDIR/snd-ainstr-simple.o ]; then
      banner "snd-ainstr-simple"
      if ! $INSMOD -m $MODDIR/snd-ainstr-simple.o >> $MAP; then exit 1; fi
    fi
    if [ -r $MODDIR/snd-ainstr-gf1.o ]; then
      banner "snd-ainstr-gf1"
      if ! $INSMOD -m $MODDIR/snd-ainstr-gf1.o >> $MAP; then exit 1; fi
    fi
    if [ -r $MODDIR/snd-ainstr-iw.o ]; then
      banner "snd-ainstr-iw"
      if ! $INSMOD -m $MODDIR/snd-ainstr-iw.o >> $MAP; then exit 1; fi
    fi
    if [ -r $MODDIR/snd-ainstr-fm.o ]; then
      banner "snd-ainstr-fm"
      if ! $INSMOD -m $MODDIR/snd-ainstr-fm.o >> $MAP; then exit 1; fi
    fi
    if [ -r $MODDIR/snd-seq-oss.o ]; then
      banner "snd-seq-oss"
      if ! $INSMOD -m $MODDIR/snd-seq-oss.o >> $MAP; then exit 1; fi
    fi
  fi
}

function insert() {
  if ! $INSMOD -m $MODDIR/$@ >> $MAP; then exit 1; fi
}

function restore() {
  if [ -r /etc/asound/$1 ]; then
    /usr/sbin/alsactl -f /etc/asound/$1 restore
  fi
}

if [ -z "$1" ]; then
  echo "Specify soundcard ID..."
  exit
fi

if [ -w $MAP ]; then
  mv -f $MAP $OLDMAP
fi

./remove

case "$1" in
  interwave-stb|stb)
    basic; isapnp
    insert snd-cs4231-lib.o
    insert snd-gus.o
    insert snd-gus-synth.o
    insert snd-i2c.o
    insert snd-tea6330t.o
    insert snd-interwave-stb.o port=0x240 irq=7 dma1=5 dma2=6 midi=1 pcm_channels=8
    restore interwave-stb.conf
    ;;
  interwave|iw)
    basic; isapnp
    insert snd-cs4231-lib.o
    insert snd-gus.o
    insert snd-gus-synth.o
    insert snd-interwave.o irq=7 dma1=5 dma2=6 midi=1
    restore interwave.conf
    ;;
  es1688)
    basic
    insert snd-es1688-lib.o
    insert snd-mpu401-uart.o 
    insert snd-opl3-lib.o
    insert snd-es1688.o mpu_port=0x330
    restore es1688.conf
    ;;
  es18xx)
    basic; isapnp
    insert snd-mpu401-uart.o 
    insert snd-opl3-lib.o
    insert snd-es18xx.o irq=7 dma1=0 dma2=1
    restore es18xx.conf
    ;;
  sb16)
    basic; isapnp
    insert snd-sb-common.o
    insert snd-mpu401-uart.o 
    insert snd-sb16-dsp.o
    insert snd-sb16-csp.o
    insert snd-opl3-lib.o
    insert snd-sb16.o irq=7 dma8=1 dma16=5
    restore sb16.conf
    ;;
  sb)
    basic; isapnp
    insert snd-sb-common.o
    insert snd-sb8-dsp.o
    insert snd-opl3-lib.o
    insert snd-sb8.o port=0x220 irq=7 dma8=1
    restore sb.conf
    ;;
  sbawe)
    basic; isapnp
    insert snd-sb-common.o
    insert snd-sb16-dsp.o
    insert snd-sb16-csp.o
    insert snd-mpu401-uart.o 
    insert snd-opl3-lib.o
    if [ -r $MODDIR/snd-emu8000.o ]; then
      insert snd-emu8000.o
    fi
    insert snd-sbawe.o irq=7 dma8=1 dma16=5
    restore sbawe.conf
    ;;
  emu10k1|live)
    basic
    insert snd-ac97-codec.o
    insert snd-util-mem.o
    insert snd-emu10k1.o
    insert snd-seq-virmidi.o
    insert snd-emux-synth.o
    insert snd-emu10k1-synth.o
    restore emu10k1.conf
    ;;
  sb8)
    basic
    insert snd-sb-common.o
    insert snd-sb8-dsp.o
    insert snd-opl3-lib.o
    insert snd-sb8.o irq=5 dma8=1
    restore sb8.conf
    ;;
  gusm*|max)
    basic
    insert snd-cs4231-lib.o
    insert snd-gus.o
    insert snd-gus-synth.o
    insert snd-gusmax.o irq=7 pcm_channels=8 dma1=6 dma2=7
    restore gusmax.conf
    ;;
  gusc*|clas*)
    basic
    insert snd-gus.o
    insert snd-gus-synth.o
    insert snd-gusclassic.o irq=7 dma1=6 dma2=7
    restore gusclassic.conf
    ;;
  guse*|ext*)
    basic
    insert snd-es1688.o
    insert snd-mpu401-uart.o 
    insert snd-opl3-lib.o
    insert snd-gus.o
    insert snd-gus-synth.o
    insert snd-opl3-synth.o
    insert snd-gusextreme.o irq=5 gf1_irq=11 mpu_port=0x300
    restore gusextreme.conf
    ;;
  opl3sa2)
    basic; isapnp
    insert snd-cs4231.o
    insert snd-mpu401-uart.o
    insert snd-opl3-lib.o
    insert snd-opl3sa2.o port=0x100 wss_port=0xe80 \
                        fm_port=0x388 midi_port=0x300 \
                        irq=5 dma1=0 dma2=1
    restore opl3sa2.conf
    ;;
  mozart)
    basic
    insert snd-ad1848.o
    insert snd-mozart.o
    restore mozart.conf
    ;;
  p1)
    basic; isapnp
    insert snd-sb16-dsp.o
    insert snd-mpu401-uart.o 
    insert snd-sb16.o irq=5 dma8=1 dma16=5 mpu_port=0x330
    insert snd-gus.o
    insert snd-gusclassic.o dma2=-1
    restore p1.conf
    ;;
  p2)
    basic
    insert snd-cs4231.o
    insert snd-es1688.o
    insert snd-mpu401-uart.o 
    insert snd-gus.o
    insert snd-gusmax.o
    insert snd-gusextreme.o irq1=11 mpu_port=0x300
    restore p2.conf
    ;;
  s3)
    basic
    insert snd-mpu401-uart.o 
    insert snd-opl3-lib.o
    insert snd-sonicvibes.o reverb=1
    restore sonicvibes.conf
    ;;
  ens1370)
    basic
    insert snd-ak4531-codec.o
    insert snd-ens1370.o
    restore ens1370.conf
    ;;
  ens1371)
    basic
    insert snd-ac97-codec.o
    insert snd-ens1371.o
#    insert snd-share.o
    restore ens1371.conf
    ;;
  trident)
    basic
    insert snd-mpu401-uart.o 
    insert snd-ac97-codec.o
    insert snd-util-mem.o
    insert snd-trident.o
    insert snd-trident-synth.o
    restore trident.conf
    ;;
  cs46xx)
    basic
    insert snd-ac97-codec.o
    insert snd-cs46xx.o
    restore cs46xx.conf
    ;;
  cs4281)
    basic
    insert snd-ac97-codec.o
    insert snd-opl3-lib.o
    insert snd-cs4281.o
    restore cs4281.conf
    ;;
  fm801)
    basic
    insert snd-ac97-codec.o
    insert snd-mpu401-uart.o 
    insert snd-opl3-lib.o
    insert snd-tea575x-tuner.o
    insert snd-fm801.o
    restore fm801.conf
    ;;
  fm801-radio)
    basic
    insert snd-ac97-codec.o
    insert snd-mpu401-uart.o 
    insert snd-opl3-lib.o
    insert snd-tea575x-tuner.o
    insert snd-fm801.o tea575x_tuner=1
    restore fm801.conf
    ;;
  es1938|solo1)
    basic
    insert snd-mpu401-uart.o
    insert snd-opl3-lib.o
    insert snd-es1938.o    
    restore solo1.conf
    ;;
  cs4232)
    basic; isapnp
    insert snd-mpu401-uart.o 
    insert snd-cs4231-lib.o
    insert snd-opl3-lib.o
    insert snd-cs4232.o port=0x534 \
		fm_port=0x388 mpu_port=0x330 jport=0x208 \
		dma1=1 dma2=0 \
		irq=5 mpu_irq=7
    restore cs4232.conf
    ;;
  cs4236)
    basic; isapnp
    insert snd-mpu401-uart.o 
    insert snd-cs4231.o
    insert snd-cs4236.o
    insert snd-opl3-lib.o
#    insert snd-cs4236.o port=0x534 cport=0x120 \
#		fm_port=0x388 mpu_port=0x330 jport=0x208 \
#		dma1=1 dma2=0 \
#		irq=5 mpu_irq=7
    insert snd-cs4236.o irq=7
    restore cs4236.conf
    ;;
  ice1712|envy24)
    basic
    insert snd-ac97-codec.o
    insert snd-mpu401-uart.o 
    insert snd-i2c.o
    insert snd-cs8427.o
    insert snd-ak4xxx-adda.o
    insert snd-ice17xx-ak4xxx.o
    insert snd-ice1712.o enable=1,1 cs8427_timeout=5
    restore ice1712.conf
    ;;
  ice1724|envy24ht)
    basic
    insert snd-ac97-codec.o
    insert snd-mpu401-uart.o 
    insert snd-i2c.o
    insert snd-cs8427.o
    insert snd-ak4xxx-adda.o
    insert snd-ice17xx-ak4xxx.o
    insert snd-ice1724.o enable=1,1
    restore ice1724.conf
    ;;
  i8x0|ich)
    basic
    insert snd-ac97-codec.o
    insert snd-mpu401-uart.o 
    insert snd-intel8x0.o ac97_clock=48000
    restore intel8x0.conf
    ;;
  pdplus|prodif-plus)
    basic
    insert snd-pdplus.o
    restore prodif-plus.conf
    ;;
  via686*|via8233*|via)
    basic
    insert snd-ac97-codec.o
    insert snd-mpu401-uart.o
    insert snd-via82xx.o mpu_port=0x330
    restore via82xx.conf
    ;;
  ymfpci|yamaha)
    basic
    insert snd-ac97-codec.o
    insert snd-mpu401-uart.o
    insert snd-opl3-lib.o
    insert snd-ymfpci.o
    restore ymfpci.conf
    ;;
  dummy)
    basic
    insert snd-dummy.o enable=1,1 pcm_devs=4,4
    #restore dummy.conf
    ;;
  virmidi)
    basic
    insert snd-seq-virmidi.o
    insert snd-virmidi.o enable=1,1 midi_devs=8,8
    ;;
  serialmidi)
    basic
    insert snd-serialmidi.o
    ;;
  usb)
    basic
    insert snd-usb-audio.o
    ;;
  vxpocket2)
    basic
    insert snd-vx-lib.o
    insert snd-vx-cs.o
    insert snd-vxpocket.o
    ;;
  pdaudiocf)
    basic
    insert snd-ak4117.o
    insert snd-pdaudiocf.o
    ;;
  t1)
    basic; isapnp
    insert snd-mpu401-uart.o 
    insert snd-cs4231-lib.o
    insert snd-cs4236-lib.o
    insert snd-opl3-lib.o
    insert snd-sb16-dsp.o
    insert snd-sb16-csp.o
    insert snd-sb16.o irq=10 dma8=1 dma16=5
    insert snd-cs4236.o
    ;;
  t2)
    basic
    insert snd-ac97-codec.o
    insert snd-util-mem.o
    insert snd-emu10k1.o
    insert snd-seq-virmidi.o
    insert snd-emux-synth.o
    insert snd-emu10k1-synth.o
    insert snd-mpu401-uart.o 
    insert snd-ice1712.o
    restore t2.conf
    ;;
  t3)
    basic
    insert snd-ac97-codec.o
    insert snd-mpu401-uart.o
    insert snd-opl3-lib.o
    insert snd-ymfpci.o
    insert snd-i2c.o
    insert snd-cs8427.o
    insert snd-ice1712.o
    restore t3.conf
    ;;
  t4)
    basic
    insert snd-ak4117.o
    insert snd-pdaudiocf.o
    insert snd-mpu401-uart.o 
    insert snd-ac97-codec.o
    insert snd-util-mem.o
    insert snd-trident.o
    #insert snd-trident-synth.o
    restore trident.conf
    ;;
  *)
    echo "Unknown soundcard $1..."
    ;;
esac
echo "Insert done..."