3 # Turtle Beach MultiSound Driver Notes
4 # -- Andrew Veliath <andrewtv@usa.net>
6 # Last update: September 10, 1998
7 # Corresponding msnd driver: 0.8.3
9 # ** This file is a README (top part) and shell archive (bottom part).
10 # The corresponding archived utility sources can be unpacked by
11 # running `sh MultiSound' (the utilities are only needed for the
12 # Pinnacle and Fiji cards). **
15 # -=-=- Getting Firmware -=-=-
16 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 # See the section `Obtaining and Creating Firmware Files' in this
19 # document for instructions on obtaining the necessary firmware
26 # Currently, full-duplex digital audio (/dev/dsp only, /dev/audio is
27 # not currently available) and mixer functionality (/dev/mixer) are
28 # supported (memory mapped digital audio is not yet supported).
29 # Digital transfers and monitoring can be done as well if you have
30 # the digital daughterboard (see the section on using the S/PDIF port
31 # for more information).
33 # Support for the Turtle Beach MultiSound Hurricane architecture is
34 # composed of the following modules (these can also operate compiled
37 # msnd - MultiSound base (requires soundcore)
39 # msnd_classic - Base audio/mixer support for Classic, Monetery and
42 # msnd_pinnacle - Base audio/mixer support for Pinnacle and Fiji cards
50 # Use pnpdump to obtain a sample configuration if you can; I was able
51 # to obtain one with the command `pnpdump 1 0x203' -- this may vary
52 # for you (running pnpdump by itself did not work for me). Then,
53 # edit this file and use isapnp to uncomment and set the card values.
54 # Use these values when inserting the msnd_pinnacle module. Using
55 # this method, you can set the resources for the DSP and the Kurzweil
56 # synth (Pinnacle). Since Linux does not directly support PnP
57 # devices, you may have difficulty when using the card in PnP mode
58 # when it the driver is compiled into the kernel. Using non-PnP mode
59 # is preferable in this case.
61 # Here is an example mypinnacle.conf for isapnp that sets the card to
62 # io base 0x210, irq 5 and mem 0xd8000, and also sets the Kurzweil
63 # synth to 0x330 and irq 9 (may need editing for your system):
70 # (CONFIGURE BVJ0440/-1 (LD 0
71 # (INT 0 (IRQ 5 (MODE +E))) (IO 0 (BASE 0x0210)) (MEM 0 (BASE 0x0d8000))
74 # # Kurzweil Synth (Pinnacle Only)
75 # (CONFIGURE BVJ0440/-1 (LD 1
76 # (IO 0 (BASE 0x0330)) (INT 0 (IRQ 9 (MODE +E)))
84 # The second way is by running the card in non-PnP mode. This
85 # actually has some advantages in that you can access some other
86 # devices on the card, such as the joystick and IDE controller. To
87 # configure the card, unpack this shell archive and build the
88 # pinnaclecfg program. Using this program, you can assign the
89 # resource values to the card's devices, or disable the devices. As
90 # an alternative to using pinnaclecfg, you can specify many of the
91 # configuration values when loading the msnd_pinnacle module (or
92 # during kernel configuration when compiling the driver into the
95 # If you specify cfg=0x250 for the msnd_pinnacle module, it
96 # automatically configure the card to the given io, irq and memory
97 # values using that config port (the config port is jumper selectable
98 # on the card to 0x250, 0x260 or 0x270).
100 # See the `msnd_pinnacle Additional Options' section below for more
101 # information on these parameters (also, if you compile the driver
102 # directly into the kernel, these extra parameters can be useful
106 # ** It is very easy to cause problems in your machine if you choose a
107 # resource value which is incorrect. **
113 # * MultiSound Classic/Monterey/Tahiti:
117 # insmod msnd_classic io=0x290 irq=7 mem=0xd0000
119 # * MultiSound Pinnacle in PnP mode:
123 # isapnp mypinnacle.conf
124 # insmod msnd_pinnacle io=0x210 irq=5 mem=0xd8000 <-- match mypinnacle.conf values
126 # * MultiSound Pinnacle in non-PnP mode (replace 0x250 with your configuration port,
127 # one of 0x250, 0x260 or 0x270):
131 # insmod msnd_pinnacle cfg=0x250 io=0x290 irq=5 mem=0xd0000
133 # * To use the MPU-compatible Kurzweil synth on the Pinnacle in PnP
134 # mode, add the following (assumes you did `isapnp mypinnacle.conf'):
137 # insmod mpu401 io=0x330 irq=9 <-- match mypinnacle.conf values
139 # * To use the MPU-compatible Kurzweil synth on the Pinnacle in non-PnP
140 # mode, add the following. Note how we first configure the peripheral's
141 # resources, _then_ install a Linux driver for it:
144 # pinnaclecfg 0x250 mpu 0x330 9
145 # insmod mpu401 io=0x330 irq=9
147 # -- OR you can use the following sequence without pinnaclecfg in non-PnP mode:
151 # insmod msnd_pinnacle cfg=0x250 io=0x290 irq=5 mem=0xd0000 mpu_io=0x330 mpu_irq=9
153 # insmod mpu401 io=0x330 irq=9
155 # * To setup the joystick port on the Pinnacle in non-PnP mode (though
156 # you have to find the actual Linux joystick driver elsewhere), you
157 # can use pinnaclecfg:
159 # pinnaclecfg 0x250 joystick 0x200
161 # -- OR you can configure this using msnd_pinnacle with the following:
165 # insmod msnd_pinnacle cfg=0x250 io=0x290 irq=5 mem=0xd0000 joystick_io=0x200
168 # msnd_classic, msnd_pinnacle Required Options
169 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171 # If the following options are not given, the module will not load.
172 # Examine the kernel message log for informative error messages.
173 # WARNING--probing isn't supported so try to make sure you have the
174 # correct shared memory area, otherwise you may experience problems.
176 # io I/O base of DSP, e.g. io=0x210
177 # irq IRQ number, e.g. irq=5
178 # mem Shared memory area, e.g. mem=0xd8000
181 # msnd_classic, msnd_pinnacle Additional Options
182 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
184 # fifosize The digital audio FIFOs, in kilobytes. If not
185 # specified, the default will be used. Increasing
186 # this value will reduce the chance of a FIFO
187 # underflow at the expense of increasing overall
188 # latency. For example, fifosize=512 will
189 # allocate 512kB read and write FIFOs (1MB total).
190 # While this may reduce dropouts, a heavy machine
191 # load will undoubtedly starve the FIFO of data
192 # and you will eventually get dropouts. One
193 # option is to alter the scheduling priority of
194 # the playback process, using `nice' or some form
195 # of POSIX soft real-time scheduling.
197 # calibrate_signal Setting this to one calibrates the ADCs to the
198 # signal, zero calibrates to the card (defaults
202 # msnd_pinnacle Additional Options
203 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205 # digital Specify digital=1 to enable the S/PDIF input
206 # if you have the digital daughterboard
207 # adapter. This will enable access to the
208 # DIGITAL1 input for the soundcard in the mixer.
209 # Some mixer programs might have trouble setting
210 # the DIGITAL1 source as an input. If you have
211 # trouble, you can try the setdigital.c program
212 # at the bottom of this document.
214 # cfg Non-PnP configuration port for the Pinnacle
215 # and Fiji (typically 0x250, 0x260 or 0x270,
216 # depending on the jumper configuration). If
217 # this option is omitted, then it is assumed
218 # that the card is in PnP mode, and that the
219 # specified DSP resource values are already
220 # configured with PnP (i.e. it won't attempt to
221 # do any sort of configuration).
223 # When the Pinnacle is in non-PnP mode, you can use the following
224 # options to configure particular devices. If a full specification
225 # for a device is not given, then the device is not configured. Note
226 # that you still must use a Linux driver for any of these devices
227 # once their resources are setup (such as the Linux joystick driver,
228 # or the MPU401 driver from OSS for the Kurzweil synth).
230 # mpu_io I/O port of MPU (on-board Kurzweil synth)
231 # mpu_irq IRQ of MPU (on-board Kurzweil synth)
232 # ide_io0 First I/O port of IDE controller
233 # ide_io1 Second I/O port of IDE controller
234 # ide_irq IRQ IDE controller
235 # joystick_io I/O port of joystick
241 # -- Shell archive attached below, just run `sh MultiSound' to extract.
242 # Contains Pinnacle/Fiji utilities to convert firmware, configure
243 # in non-PnP mode, and select the DIGITAL1 input for the mixer.
247 # This is a shell archive (produced by GNU sharutils 4.2).
248 # To extract the files from this archive, save it to some FILE, remove
249 # everything before the `!/bin/sh' line above, then type `sh FILE'.
251 # Made on 1998-12-04 10:07 EST by <andrewtv@ztransform.velsoft.com>.
252 # Source directory was `/home/andrewtv/programming/pinnacle/pinnacle'.
254 # Existing files will *not* be overwritten unless `-c' is specified.
256 # This shar contains:
258 # ------ ---------- ------------------------------------------
259 # 2046 -rw-rw-r-- MultiSound.d/setdigital.c
260 # 10235 -rw-rw-r-- MultiSound.d/pinnaclecfg.c
261 # 106 -rw-rw-r-- MultiSound.d/Makefile
262 # 141 -rw-rw-r-- MultiSound.d/conv.l
263 # 1472 -rw-rw-r-- MultiSound.d/msndreset.c
272 if test "$gettext_dir" = FAILED && test -f $dir/gettext \
273 && ($dir/gettext --version >/dev/null 2>&1)
275 set `$dir/gettext --version 2>&1`
281 if test "$locale_dir" = FAILED && test -f $dir/shar \
282 && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
284 locale_dir=`$dir/shar --print-text-domain-dir`
288 if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
292 TEXTDOMAINDIR=$locale_dir
296 echo="$gettext_dir/gettext -s"
298 touch -am 1231235999 $$.touch >/dev/null 2>&1
299 if test ! -f 1231235999 && test -f $$.touch; then
304 $echo 'WARNING: not restoring timestamps. Consider getting and'
305 $echo "installing GNU \`touch', distributed in GNU File Utilities..."
308 rm -f 1231235999 $$.touch
310 if mkdir _sh01426; then
311 $echo 'x -' 'creating lock directory'
313 $echo 'failed to create lock directory'
316 # ============= MultiSound.d/setdigital.c ==============
317 if test ! -d 'MultiSound.d'; then
318 $echo 'x -' 'creating directory' 'MultiSound.d'
321 if test -f 'MultiSound.d/setdigital.c' && test "$first_param" != -c; then
322 $echo 'x -' SKIPPING 'MultiSound.d/setdigital.c' '(file already exists)'
324 $echo 'x -' extracting 'MultiSound.d/setdigital.c' '(text)'
325 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/setdigital.c' &&
326 /*********************************************************************
328 X * setdigital.c - sets the DIGITAL1 input for a mixer
330 X * Copyright (C) 1998 Andrew Veliath
332 X * This program is free software; you can redistribute it and/or modify
333 X * it under the terms of the GNU General Public License as published by
334 X * the Free Software Foundation; either version 2 of the License, or
335 X * (at your option) any later version.
337 X * This program is distributed in the hope that it will be useful,
338 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
339 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
340 X * GNU General Public License for more details.
342 X * You should have received a copy of the GNU General Public License
343 X * along with this program; if not, write to the Free Software
344 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
346 X ********************************************************************/
351 #include <sys/types.h>
352 #include <sys/stat.h>
353 #include <sys/ioctl.h>
354 #include <sys/soundcard.h>
356 int main(int argc, char *argv[])
359 X unsigned long recmask, recsrc;
362 X fprintf(stderr, "usage: setdigital <mixer device>\n");
366 X if ((fd = open(argv[1], O_RDWR)) < 0) {
371 X if (ioctl(fd, SOUND_MIXER_READ_RECMASK, &recmask) < 0) {
372 X fprintf(stderr, "error: ioctl read recording mask failed\n");
378 X if (!(recmask & SOUND_MASK_DIGITAL1)) {
379 X fprintf(stderr, "error: cannot find DIGITAL1 device in mixer\n");
384 X if (ioctl(fd, SOUND_MIXER_READ_RECSRC, &recsrc) < 0) {
385 X fprintf(stderr, "error: ioctl read recording source failed\n");
391 X recsrc |= SOUND_MASK_DIGITAL1;
393 X if (ioctl(fd, SOUND_MIXER_WRITE_RECSRC, &recsrc) < 0) {
394 X fprintf(stderr, "error: ioctl write recording source failed\n");
405 $shar_touch -am 1204092598 'MultiSound.d/setdigital.c' &&
406 chmod 0664 'MultiSound.d/setdigital.c' ||
407 $echo 'restore of' 'MultiSound.d/setdigital.c' 'failed'
408 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
409 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
410 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
411 || $echo 'MultiSound.d/setdigital.c:' 'MD5 check failed'
412 e87217fc3e71288102ba41fd81f71ec4 MultiSound.d/setdigital.c
415 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/setdigital.c'`"
416 test 2046 -eq "$shar_count" ||
417 $echo 'MultiSound.d/setdigital.c:' 'original size' '2046,' 'current size' "$shar_count!"
420 # ============= MultiSound.d/pinnaclecfg.c ==============
421 if test -f 'MultiSound.d/pinnaclecfg.c' && test "$first_param" != -c; then
422 $echo 'x -' SKIPPING 'MultiSound.d/pinnaclecfg.c' '(file already exists)'
424 $echo 'x -' extracting 'MultiSound.d/pinnaclecfg.c' '(text)'
425 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/pinnaclecfg.c' &&
426 /*********************************************************************
428 X * pinnaclecfg.c - Pinnacle/Fiji Device Configuration Program
430 X * This is for NON-PnP mode only. For PnP mode, use isapnptools.
432 X * This is Linux-specific, and must be run with root permissions.
434 X * Part of the Turtle Beach MultiSound Sound Card Driver for Linux
436 X * Copyright (C) 1998 Andrew Veliath
438 X * This program is free software; you can redistribute it and/or modify
439 X * it under the terms of the GNU General Public License as published by
440 X * the Free Software Foundation; either version 2 of the License, or
441 X * (at your option) any later version.
443 X * This program is distributed in the hope that it will be useful,
444 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
445 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
446 X * GNU General Public License for more details.
448 X * You should have received a copy of the GNU General Public License
449 X * along with this program; if not, write to the Free Software
450 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
452 X ********************************************************************/
460 #include <asm/types.h>
462 #define IREG_LOGDEVICE 0x07
463 #define IREG_ACTIVATE 0x30
464 #define LD_ACTIVATE 0x01
465 #define LD_DISACTIVATE 0x00
466 #define IREG_EECONTROL 0x3F
467 #define IREG_MEMBASEHI 0x40
468 #define IREG_MEMBASELO 0x41
469 #define IREG_MEMCONTROL 0x42
470 #define IREG_MEMRANGEHI 0x43
471 #define IREG_MEMRANGELO 0x44
472 #define MEMTYPE_8BIT 0x00
473 #define MEMTYPE_16BIT 0x02
474 #define MEMTYPE_RANGE 0x00
475 #define MEMTYPE_HIADDR 0x01
476 #define IREG_IO0_BASEHI 0x60
477 #define IREG_IO0_BASELO 0x61
478 #define IREG_IO1_BASEHI 0x62
479 #define IREG_IO1_BASELO 0x63
480 #define IREG_IRQ_NUMBER 0x70
481 #define IREG_IRQ_TYPE 0x71
482 #define IRQTYPE_HIGH 0x02
483 #define IRQTYPE_LOW 0x00
484 #define IRQTYPE_LEVEL 0x01
485 #define IRQTYPE_EDGE 0x00
487 #define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))
488 #define LOBYTE(w) ((BYTE)(w))
489 #define MAKEWORD(low,hi) ((WORD)(((BYTE)(low))|(((WORD)((BYTE)(hi)))<<8)))
492 typedef __u16 USHORT;
495 static int config_port = -1;
497 static int msnd_write_cfg(int cfg, int reg, int value)
500 X outb(value, cfg + 1);
501 X if (value != inb(cfg + 1)) {
502 X fprintf(stderr, "error: msnd_write_cfg: I/O error\n");
508 static int msnd_read_cfg(int cfg, int reg)
511 X return inb(cfg + 1);
514 static int msnd_write_cfg_io0(int cfg, int num, WORD io)
516 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
518 X if (msnd_write_cfg(cfg, IREG_IO0_BASEHI, HIBYTE(io)))
520 X if (msnd_write_cfg(cfg, IREG_IO0_BASELO, LOBYTE(io)))
525 static int msnd_read_cfg_io0(int cfg, int num, WORD *io)
527 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
530 X *io = MAKEWORD(msnd_read_cfg(cfg, IREG_IO0_BASELO),
531 X msnd_read_cfg(cfg, IREG_IO0_BASEHI));
536 static int msnd_write_cfg_io1(int cfg, int num, WORD io)
538 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
540 X if (msnd_write_cfg(cfg, IREG_IO1_BASEHI, HIBYTE(io)))
542 X if (msnd_write_cfg(cfg, IREG_IO1_BASELO, LOBYTE(io)))
547 static int msnd_read_cfg_io1(int cfg, int num, WORD *io)
549 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
552 X *io = MAKEWORD(msnd_read_cfg(cfg, IREG_IO1_BASELO),
553 X msnd_read_cfg(cfg, IREG_IO1_BASEHI));
558 static int msnd_write_cfg_irq(int cfg, int num, WORD irq)
560 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
562 X if (msnd_write_cfg(cfg, IREG_IRQ_NUMBER, LOBYTE(irq)))
564 X if (msnd_write_cfg(cfg, IREG_IRQ_TYPE, IRQTYPE_EDGE))
569 static int msnd_read_cfg_irq(int cfg, int num, WORD *irq)
571 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
574 X *irq = msnd_read_cfg(cfg, IREG_IRQ_NUMBER);
579 static int msnd_write_cfg_mem(int cfg, int num, int mem)
586 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
588 X if (msnd_write_cfg(cfg, IREG_MEMBASEHI, HIBYTE(wmem)))
590 X if (msnd_write_cfg(cfg, IREG_MEMBASELO, LOBYTE(wmem)))
592 X if (wmem && msnd_write_cfg(cfg, IREG_MEMCONTROL, (MEMTYPE_HIADDR | MEMTYPE_16BIT)))
597 static int msnd_read_cfg_mem(int cfg, int num, int *mem)
599 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
602 X *mem = MAKEWORD(msnd_read_cfg(cfg, IREG_MEMBASELO),
603 X msnd_read_cfg(cfg, IREG_MEMBASEHI));
609 static int msnd_activate_logical(int cfg, int num)
611 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
613 X if (msnd_write_cfg(cfg, IREG_ACTIVATE, LD_ACTIVATE))
618 static int msnd_write_cfg_logical(int cfg, int num, WORD io0, WORD io1, WORD irq, int mem)
620 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
622 X if (msnd_write_cfg_io0(cfg, num, io0))
624 X if (msnd_write_cfg_io1(cfg, num, io1))
626 X if (msnd_write_cfg_irq(cfg, num, irq))
628 X if (msnd_write_cfg_mem(cfg, num, mem))
630 X if (msnd_activate_logical(cfg, num))
635 static int msnd_read_cfg_logical(int cfg, int num, WORD *io0, WORD *io1, WORD *irq, int *mem)
637 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
639 X if (msnd_read_cfg_io0(cfg, num, io0))
641 X if (msnd_read_cfg_io1(cfg, num, io1))
643 X if (msnd_read_cfg_irq(cfg, num, irq))
645 X if (msnd_read_cfg_mem(cfg, num, mem))
650 static void usage(void)
654 X "pinnaclecfg 1.0\n"
656 X "usage: pinnaclecfg <config port> [device config]\n"
658 X "This is for use with the card in NON-PnP mode only.\n"
660 X "Available devices (not all available for Fiji):\n"
662 X " Device Description\n"
663 X " -------------------------------------------------------------------\n"
664 X " reset Reset all devices (i.e. disable)\n"
665 X " show Display current device configurations\n"
667 X " dsp <io> <irq> <mem> Audio device\n"
668 X " mpu <io> <irq> Internal Kurzweil synth\n"
669 X " ide <io0> <io1> <irq> On-board IDE controller\n"
670 X " joystick <io> Joystick port\n"
675 static int cfg_reset(void)
679 X for (i = 0; i < 4; ++i)
680 X msnd_write_cfg_logical(config_port, i, 0, 0, 0, 0);
685 static int cfg_show(void)
690 X for (i = 0; i < 4; ++i) {
691 X WORD io0, io1, irq;
693 X msnd_read_cfg_logical(config_port, i, &io0, &io1, &irq, &mem);
696 X if (io0 || irq || mem) {
697 X printf("dsp 0x%x %d 0x%x\n", io0, irq, mem);
703 X printf("mpu 0x%x %d\n", io0, irq);
708 X if (io0 || io1 || irq) {
709 X printf("ide 0x%x 0x%x %d\n", io0, io1, irq);
715 X printf("joystick 0x%x\n", io0);
723 X fprintf(stderr, "no devices configured\n");
728 static int cfg_dsp(int argc, char *argv[])
733 X sscanf(argv[0], "0x%x", &io) != 1 ||
734 X sscanf(argv[1], "%d", &irq) != 1 ||
735 X sscanf(argv[2], "0x%x", &mem) != 1)
738 X if (!(io == 0x290 ||
746 X fprintf(stderr, "error: io must be one of "
747 X "210, 220, 230, 240, 250, 260, 290, or 3E0\n");
757 X fprintf(stderr, "error: irq must be one of "
758 X "5, 7, 9, 10, 11 or 12\n");
762 X if (!(mem == 0xb0000 ||
768 X fprintf(stderr, "error: mem must be one of "
769 X "0xb0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000 or 0xe8000\n");
773 X return msnd_write_cfg_logical(config_port, 0, io, 0, irq, mem);
776 static int cfg_mpu(int argc, char *argv[])
781 X sscanf(argv[0], "0x%x", &io) != 1 ||
782 X sscanf(argv[1], "%d", &irq) != 1)
785 X return msnd_write_cfg_logical(config_port, 1, io, 0, irq, 0);
788 static int cfg_ide(int argc, char *argv[])
793 X sscanf(argv[0], "0x%x", &io0) != 1 ||
794 X sscanf(argv[0], "0x%x", &io1) != 1 ||
795 X sscanf(argv[1], "%d", &irq) != 1)
798 X return msnd_write_cfg_logical(config_port, 2, io0, io1, irq, 0);
801 static int cfg_joystick(int argc, char *argv[])
806 X sscanf(argv[0], "0x%x", &io) != 1)
809 X return msnd_write_cfg_logical(config_port, 3, io, 0, 0, 0);
812 int main(int argc, char *argv[])
822 X sscanf(argv[0], "0x%x", &config_port);
823 X if (config_port != 0x250 && config_port != 0x260 && config_port != 0x270) {
824 X fprintf(stderr, "error: <config port> must be 0x250, 0x260 or 0x270\n");
827 X if (ioperm(config_port, 2, 1)) {
829 X fprintf(stderr, "note: pinnaclecfg must be run as root\n");
834 X argc -= 2; argv += 2;
836 X if (strcmp(device, "reset") == 0)
838 X else if (strcmp(device, "show") == 0)
840 X else if (strcmp(device, "dsp") == 0)
841 X rv = cfg_dsp(argc, argv);
842 X else if (strcmp(device, "mpu") == 0)
843 X rv = cfg_mpu(argc, argv);
844 X else if (strcmp(device, "ide") == 0)
845 X rv = cfg_ide(argc, argv);
846 X else if (strcmp(device, "joystick") == 0)
847 X rv = cfg_joystick(argc, argv);
849 X fprintf(stderr, "error: unknown device %s\n", device);
854 X fprintf(stderr, "error: device configuration failed\n");
859 $shar_touch -am 1204092598 'MultiSound.d/pinnaclecfg.c' &&
860 chmod 0664 'MultiSound.d/pinnaclecfg.c' ||
861 $echo 'restore of' 'MultiSound.d/pinnaclecfg.c' 'failed'
862 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
863 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
864 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
865 || $echo 'MultiSound.d/pinnaclecfg.c:' 'MD5 check failed'
866 366bdf27f0db767a3c7921d0a6db20fe MultiSound.d/pinnaclecfg.c
869 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/pinnaclecfg.c'`"
870 test 10235 -eq "$shar_count" ||
871 $echo 'MultiSound.d/pinnaclecfg.c:' 'original size' '10235,' 'current size' "$shar_count!"
874 # ============= MultiSound.d/Makefile ==============
875 if test -f 'MultiSound.d/Makefile' && test "$first_param" != -c; then
876 $echo 'x -' SKIPPING 'MultiSound.d/Makefile' '(file already exists)'
878 $echo 'x -' extracting 'MultiSound.d/Makefile' '(text)'
879 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/Makefile' &&
882 PROGS = setdigital msndreset pinnaclecfg conv
889 $shar_touch -am 1204092398 'MultiSound.d/Makefile' &&
890 chmod 0664 'MultiSound.d/Makefile' ||
891 $echo 'restore of' 'MultiSound.d/Makefile' 'failed'
892 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
893 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
894 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
895 || $echo 'MultiSound.d/Makefile:' 'MD5 check failed'
896 76ca8bb44e3882edcf79c97df6c81845 MultiSound.d/Makefile
899 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/Makefile'`"
900 test 106 -eq "$shar_count" ||
901 $echo 'MultiSound.d/Makefile:' 'original size' '106,' 'current size' "$shar_count!"
904 # ============= MultiSound.d/conv.l ==============
905 if test -f 'MultiSound.d/conv.l' && test "$first_param" != -c; then
906 $echo 'x -' SKIPPING 'MultiSound.d/conv.l' '(file already exists)'
908 $echo 'x -' extracting 'MultiSound.d/conv.l' '(text)'
909 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/conv.l' &&
914 [0-9A-Fa-f]+H { int n; sscanf(yytext, "%xH", &n); printf("%c", n); }
916 int yywrap() { return 1; }
919 $shar_touch -am 0828231798 'MultiSound.d/conv.l' &&
920 chmod 0664 'MultiSound.d/conv.l' ||
921 $echo 'restore of' 'MultiSound.d/conv.l' 'failed'
922 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
923 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
924 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
925 || $echo 'MultiSound.d/conv.l:' 'MD5 check failed'
926 d2411fc32cd71a00dcdc1f009e858dd2 MultiSound.d/conv.l
929 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/conv.l'`"
930 test 141 -eq "$shar_count" ||
931 $echo 'MultiSound.d/conv.l:' 'original size' '141,' 'current size' "$shar_count!"
934 # ============= MultiSound.d/msndreset.c ==============
935 if test -f 'MultiSound.d/msndreset.c' && test "$first_param" != -c; then
936 $echo 'x -' SKIPPING 'MultiSound.d/msndreset.c' '(file already exists)'
938 $echo 'x -' extracting 'MultiSound.d/msndreset.c' '(text)'
939 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/msndreset.c' &&
940 /*********************************************************************
942 X * msndreset.c - resets the MultiSound card
944 X * Copyright (C) 1998 Andrew Veliath
946 X * This program is free software; you can redistribute it and/or modify
947 X * it under the terms of the GNU General Public License as published by
948 X * the Free Software Foundation; either version 2 of the License, or
949 X * (at your option) any later version.
951 X * This program is distributed in the hope that it will be useful,
952 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
953 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
954 X * GNU General Public License for more details.
956 X * You should have received a copy of the GNU General Public License
957 X * along with this program; if not, write to the Free Software
958 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
960 X ********************************************************************/
965 #include <sys/types.h>
966 #include <sys/stat.h>
967 #include <sys/ioctl.h>
968 #include <sys/soundcard.h>
970 int main(int argc, char *argv[])
975 X fprintf(stderr, "usage: msndreset <mixer device>\n");
979 X if ((fd = open(argv[1], O_RDWR)) < 0) {
984 X if (ioctl(fd, SOUND_MIXER_PRIVATE1, 0) < 0) {
985 X fprintf(stderr, "error: msnd ioctl reset failed\n");
996 $shar_touch -am 1204100698 'MultiSound.d/msndreset.c' &&
997 chmod 0664 'MultiSound.d/msndreset.c' ||
998 $echo 'restore of' 'MultiSound.d/msndreset.c' 'failed'
999 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
1000 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
1001 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
1002 || $echo 'MultiSound.d/msndreset.c:' 'MD5 check failed'
1003 c52f876521084e8eb25e12e01dcccb8a MultiSound.d/msndreset.c
1006 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/msndreset.c'`"
1007 test 1472 -eq "$shar_count" ||
1008 $echo 'MultiSound.d/msndreset.c:' 'original size' '1472,' 'current size' "$shar_count!"