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 # snd-msnd-lib - MultiSound base (requires snd)
39 # snd-msnd-classic - Base audio/mixer support for Classic, Monetery and
42 # snd-msnd-pinnacle - Base audio/mixer support for Pinnacle and Fiji cards
48 # Configuring Card Resources
49 # ~~~~~~~~~~~~~~~~~~~~~~~~~~
51 # ** This section is very important, as your card may not work at all
52 # or your machine may crash if you do not do this correctly. **
54 # * Classic/Monterey/Tahiti
56 # These cards are configured through the driver snd-msnd-classic. You must
57 # know the io port, then the driver will select the irq and memory resources
58 # on the card. It is up to you to know if these are free locations or now,
59 # a conflict can lock the machine up.
63 # The Pinnacle and Fiji cards have an extra config port, either
64 # 0x250, 0x260 or 0x270. This port can be disabled to have the card
65 # configured strictly through PnP, however you lose the ability to
66 # access the IDE controller and joystick devices on this card when
67 # using PnP. The included pinnaclecfg program in this shell archive
68 # can be used to configure the card in non-PnP mode, and in PnP mode
69 # you can use isapnptools. These are described briefly here.
71 # pinnaclecfg is not required; you can use the snd-msnd-pinnacle module
72 # to fully configure the card as well. However, pinnaclecfg can be
73 # used to change the resource values of a particular device after the
74 # snd-msnd-pinnacle module has been loaded. If you are compiling the
75 # driver into the kernel, you must set these values during compile
76 # time, however other peripheral resource values can be changed with
77 # the pinnaclecfg program after the kernel is loaded.
82 # Use pnpdump to obtain a sample configuration if you can; I was able
83 # to obtain one with the command `pnpdump 1 0x203' -- this may vary
84 # for you (running pnpdump by itself did not work for me). Then,
85 # edit this file and use isapnp to uncomment and set the card values.
86 # Use these values when inserting the snd-msnd-pinnacle module. Using
87 # this method, you can set the resources for the DSP and the Kurzweil
88 # synth (Pinnacle). Since Linux does not directly support PnP
89 # devices, you may have difficulty when using the card in PnP mode
90 # when it the driver is compiled into the kernel. Using non-PnP mode
91 # is preferable in this case.
93 # Here is an example mypinnacle.conf for isapnp that sets the card to
94 # io base 0x210, irq 5 and mem 0xd8000, and also sets the Kurzweil
95 # synth to 0x330 and irq 9 (may need editing for your system):
102 # (CONFIGURE BVJ0440/-1 (LD 0
103 # (INT 0 (IRQ 5 (MODE +E))) (IO 0 (BASE 0x0210)) (MEM 0 (BASE 0x0d8000))
106 # # Kurzweil Synth (Pinnacle Only)
107 # (CONFIGURE BVJ0440/-1 (LD 1
108 # (IO 0 (BASE 0x0330)) (INT 0 (IRQ 9 (MODE +E)))
116 # The second way is by running the card in non-PnP mode. This
117 # actually has some advantages in that you can access some other
118 # devices on the card, such as the joystick and IDE controller. To
119 # configure the card, unpack this shell archive and build the
120 # pinnaclecfg program. Using this program, you can assign the
121 # resource values to the card's devices, or disable the devices. As
122 # an alternative to using pinnaclecfg, you can specify many of the
123 # configuration values when loading the snd-msnd-pinnacle module (or
124 # during kernel configuration when compiling the driver into the
127 # If you specify cfg=0x250 for the snd-msnd-pinnacle module, it
128 # automatically configure the card to the given io, irq and memory
129 # values using that config port (the config port is jumper selectable
130 # on the card to 0x250, 0x260 or 0x270).
132 # See the `snd-msnd-pinnacle Additional Options' section below for more
133 # information on these parameters (also, if you compile the driver
134 # directly into the kernel, these extra parameters can be useful
138 # ** It is very easy to cause problems in your machine if you choose a
139 # resource value which is incorrect. **
145 # * MultiSound Classic/Monterey/Tahiti:
148 # insmod snd-msnd-lib
149 # insmod snd-msnd-classic io=0x290 irq=7 mem=0xd0000
151 # * MultiSound Pinnacle in PnP mode:
154 # insmod snd-msnd-lib
155 # isapnp mypinnacle.conf
156 # insmod snd-msnd-pinnacle io=0x210 irq=5 mem=0xd8000 <-- match mypinnacle.conf values
158 # * MultiSound Pinnacle in non-PnP mode (replace 0x250 with your configuration port,
159 # one of 0x250, 0x260 or 0x270):
162 # insmod snd-msnd-lib
163 # insmod snd-msnd-pinnacle cfg=0x250 io=0x290 irq=5 mem=0xd0000
165 # * To use the MPU-compatible Kurzweil synth on the Pinnacle in PnP
166 # mode, add the following (assumes you did `isapnp mypinnacle.conf'):
169 # insmod mpu401 io=0x330 irq=9 <-- match mypinnacle.conf values
171 # * To use the MPU-compatible Kurzweil synth on the Pinnacle in non-PnP
172 # mode, add the following. Note how we first configure the peripheral's
173 # resources, _then_ install a Linux driver for it:
176 # pinnaclecfg 0x250 mpu 0x330 9
177 # insmod mpu401 io=0x330 irq=9
179 # -- OR you can use the following sequence without pinnaclecfg in non-PnP mode:
182 # insmod snd-msnd-lib
183 # insmod snd-msnd-pinnacle cfg=0x250 io=0x290 irq=5 mem=0xd0000 mpu_io=0x330 mpu_irq=9
185 # insmod mpu401 io=0x330 irq=9
187 # * To setup the joystick port on the Pinnacle in non-PnP mode (though
188 # you have to find the actual Linux joystick driver elsewhere), you
189 # can use pinnaclecfg:
191 # pinnaclecfg 0x250 joystick 0x200
193 # -- OR you can configure this using snd-msnd-pinnacle with the following:
196 # insmod snd-msnd-lib
197 # insmod snd-msnd-pinnacle cfg=0x250 io=0x290 irq=5 mem=0xd0000 joystick_io=0x200
200 # snd-msnd-classic, snd-msnd-pinnacle Required Options
201 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
203 # If the following options are not given, the module will not load.
204 # Examine the kernel message log for informative error messages.
205 # WARNING--probing isn't supported so try to make sure you have the
206 # correct shared memory area, otherwise you may experience problems.
208 # io I/O base of DSP, e.g. io=0x210
209 # irq IRQ number, e.g. irq=5
210 # mem Shared memory area, e.g. mem=0xd8000
213 # snd-msnd-classic, snd-msnd-pinnacle Additional Options
214 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216 # fifosize The digital audio FIFOs, in kilobytes. If not
217 # specified, the default will be used. Increasing
218 # this value will reduce the chance of a FIFO
219 # underflow at the expense of increasing overall
220 # latency. For example, fifosize=512 will
221 # allocate 512kB read and write FIFOs (1MB total).
222 # While this may reduce dropouts, a heavy machine
223 # load will undoubtedly starve the FIFO of data
224 # and you will eventually get dropouts. One
225 # option is to alter the scheduling priority of
226 # the playback process, using `nice' or some form
227 # of POSIX soft real-time scheduling.
229 # calibrate_signal Setting this to one calibrates the ADCs to the
230 # signal, zero calibrates to the card (defaults
234 # snd-msnd-pinnacle Additional Options
235 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
237 # digital Specify digital=1 to enable the S/PDIF input
238 # if you have the digital daughterboard
239 # adapter. This will enable access to the
240 # DIGITAL1 input for the soundcard in the mixer.
241 # Some mixer programs might have trouble setting
242 # the DIGITAL1 source as an input. If you have
243 # trouble, you can try the setdigital.c program
244 # at the bottom of this document.
246 # cfg Non-PnP configuration port for the Pinnacle
247 # and Fiji (typically 0x250, 0x260 or 0x270,
248 # depending on the jumper configuration). If
249 # this option is omitted, then it is assumed
250 # that the card is in PnP mode, and that the
251 # specified DSP resource values are already
252 # configured with PnP (i.e. it won't attempt to
253 # do any sort of configuration).
255 # When the Pinnacle is in non-PnP mode, you can use the following
256 # options to configure particular devices. If a full specification
257 # for a device is not given, then the device is not configured. Note
258 # that you still must use a Linux driver for any of these devices
259 # once their resources are setup (such as the Linux joystick driver,
260 # or the MPU401 driver from OSS for the Kurzweil synth).
262 # mpu_io I/O port of MPU (on-board Kurzweil synth)
263 # mpu_irq IRQ of MPU (on-board Kurzweil synth)
264 # ide_io0 First I/O port of IDE controller
265 # ide_io1 Second I/O port of IDE controller
266 # ide_irq IRQ IDE controller
267 # joystick_io I/O port of joystick
273 # Using Digital I/O with the S/PDIF Port
274 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
276 # If you have a Pinnacle or Fiji with the digital daughterboard and
277 # want to set it as the input source, you can use this program if you
278 # have trouble trying to do it with a mixer program (be sure to
279 # insert the module with the digital=1 option, or say Y to the option
280 # during compiled-in kernel operation). Upon selection of the S/PDIF
281 # port, you should be able monitor and record from it.
283 # There is something to note about using the S/PDIF port. Digital
284 # timing is taken from the digital signal, so if a signal is not
285 # connected to the port and it is selected as recording input, you
286 # will find PCM playback to be distorted in playback rate. Also,
287 # attempting to record at a sampling rate other than the DAT rate may
288 # be problematic (i.e. trying to record at 8000Hz when the DAT signal
289 # is 44100Hz). If you have a problem with this, set the recording
290 # input to analog if you need to record at a rate other than that of
294 # -- Shell archive attached below, just run `sh MultiSound' to extract.
295 # Contains Pinnacle/Fiji utilities to convert firmware, configure
296 # in non-PnP mode, and select the DIGITAL1 input for the mixer.
300 # This is a shell archive (produced by GNU sharutils 4.2).
301 # To extract the files from this archive, save it to some FILE, remove
302 # everything before the `!/bin/sh' line above, then type `sh FILE'.
304 # Made on 1998-12-04 10:07 EST by <andrewtv@ztransform.velsoft.com>.
305 # Source directory was `/home/andrewtv/programming/pinnacle/pinnacle'.
307 # Existing files will *not* be overwritten unless `-c' is specified.
309 # This shar contains:
311 # ------ ---------- ------------------------------------------
312 # 2064 -rw-rw-r-- MultiSound.d/setdigital.c
313 # 10224 -rw-rw-r-- MultiSound.d/pinnaclecfg.c
314 # 106 -rw-rw-r-- MultiSound.d/Makefile
315 # 146 -rw-rw-r-- MultiSound.d/conv.l
316 # 1491 -rw-rw-r-- MultiSound.d/msndreset.c
325 if test "$gettext_dir" = FAILED && test -f $dir/gettext \
326 && ($dir/gettext --version >/dev/null 2>&1)
328 set `$dir/gettext --version 2>&1`
334 if test "$locale_dir" = FAILED && test -f $dir/shar \
335 && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
337 locale_dir=`$dir/shar --print-text-domain-dir`
341 if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
345 TEXTDOMAINDIR=$locale_dir
349 echo="$gettext_dir/gettext -s"
351 touch -am 1231235999 $$.touch >/dev/null 2>&1
352 if test ! -f 1231235999 && test -f $$.touch; then
357 $echo 'WARNING: not restoring timestamps. Consider getting and'
358 $echo "installing GNU \`touch', distributed in GNU File Utilities..."
361 rm -f 1231235999 $$.touch
363 if mkdir _sh01426; then
364 $echo 'x -' 'creating lock directory'
366 $echo 'failed to create lock directory'
369 # ============= MultiSound.d/setdigital.c ==============
370 if test ! -d 'MultiSound.d'; then
371 $echo 'x -' 'creating directory' 'MultiSound.d'
374 if test -f 'MultiSound.d/setdigital.c' && test "$first_param" != -c; then
375 $echo 'x -' SKIPPING 'MultiSound.d/setdigital.c' '(file already exists)'
377 $echo 'x -' extracting 'MultiSound.d/setdigital.c' '(text)'
378 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/setdigital.c' &&
379 /*********************************************************************
381 X * setdigital.c - sets the DIGITAL1 input for a mixer
383 X * Copyright (C) 1998 Andrew Veliath
385 X * This program is free software; you can redistribute it and/or modify
386 X * it under the terms of the GNU General Public License as published by
387 X * the Free Software Foundation; either version 2 of the License, or
388 X * (at your option) any later version.
390 X * This program is distributed in the hope that it will be useful,
391 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
392 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
393 X * GNU General Public License for more details.
395 X * You should have received a copy of the GNU General Public License
396 X * along with this program; if not, write to the Free Software
397 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
399 X ********************************************************************/
405 #include <sys/types.h>
406 #include <sys/stat.h>
407 #include <sys/ioctl.h>
408 #include <sys/soundcard.h>
410 int main(int argc, char *argv[])
413 X unsigned long recmask, recsrc;
416 X fprintf(stderr, "usage: setdigital <mixer device>\n");
420 X if ((fd = open(argv[1], O_RDWR)) < 0) {
425 X if (ioctl(fd, SOUND_MIXER_READ_RECMASK, &recmask) < 0) {
426 X fprintf(stderr, "error: ioctl read recording mask failed\n");
432 X if (!(recmask & SOUND_MASK_DIGITAL1)) {
433 X fprintf(stderr, "error: cannot find DIGITAL1 device in mixer\n");
438 X if (ioctl(fd, SOUND_MIXER_READ_RECSRC, &recsrc) < 0) {
439 X fprintf(stderr, "error: ioctl read recording source failed\n");
445 X recsrc |= SOUND_MASK_DIGITAL1;
447 X if (ioctl(fd, SOUND_MIXER_WRITE_RECSRC, &recsrc) < 0) {
448 X fprintf(stderr, "error: ioctl write recording source failed\n");
459 $shar_touch -am 1204092598 'MultiSound.d/setdigital.c' &&
460 chmod 0664 'MultiSound.d/setdigital.c' ||
461 $echo 'restore of' 'MultiSound.d/setdigital.c' 'failed'
462 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
463 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
464 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
465 || $echo 'MultiSound.d/setdigital.c:' 'MD5 check failed'
466 e87217fc3e71288102ba41fd81f71ec4 MultiSound.d/setdigital.c
469 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/setdigital.c'`"
470 test 2064 -eq "$shar_count" ||
471 $echo 'MultiSound.d/setdigital.c:' 'original size' '2064,' 'current size' "$shar_count!"
474 # ============= MultiSound.d/pinnaclecfg.c ==============
475 if test -f 'MultiSound.d/pinnaclecfg.c' && test "$first_param" != -c; then
476 $echo 'x -' SKIPPING 'MultiSound.d/pinnaclecfg.c' '(file already exists)'
478 $echo 'x -' extracting 'MultiSound.d/pinnaclecfg.c' '(text)'
479 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/pinnaclecfg.c' &&
480 /*********************************************************************
482 X * pinnaclecfg.c - Pinnacle/Fiji Device Configuration Program
484 X * This is for NON-PnP mode only. For PnP mode, use isapnptools.
486 X * This is Linux-specific, and must be run with root permissions.
488 X * Part of the Turtle Beach MultiSound Sound Card Driver for Linux
490 X * Copyright (C) 1998 Andrew Veliath
492 X * This program is free software; you can redistribute it and/or modify
493 X * it under the terms of the GNU General Public License as published by
494 X * the Free Software Foundation; either version 2 of the License, or
495 X * (at your option) any later version.
497 X * This program is distributed in the hope that it will be useful,
498 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
499 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
500 X * GNU General Public License for more details.
502 X * You should have received a copy of the GNU General Public License
503 X * along with this program; if not, write to the Free Software
504 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
506 X ********************************************************************/
513 #include <asm/types.h>
516 #define IREG_LOGDEVICE 0x07
517 #define IREG_ACTIVATE 0x30
518 #define LD_ACTIVATE 0x01
519 #define LD_DISACTIVATE 0x00
520 #define IREG_EECONTROL 0x3F
521 #define IREG_MEMBASEHI 0x40
522 #define IREG_MEMBASELO 0x41
523 #define IREG_MEMCONTROL 0x42
524 #define IREG_MEMRANGEHI 0x43
525 #define IREG_MEMRANGELO 0x44
526 #define MEMTYPE_8BIT 0x00
527 #define MEMTYPE_16BIT 0x02
528 #define MEMTYPE_RANGE 0x00
529 #define MEMTYPE_HIADDR 0x01
530 #define IREG_IO0_BASEHI 0x60
531 #define IREG_IO0_BASELO 0x61
532 #define IREG_IO1_BASEHI 0x62
533 #define IREG_IO1_BASELO 0x63
534 #define IREG_IRQ_NUMBER 0x70
535 #define IREG_IRQ_TYPE 0x71
536 #define IRQTYPE_HIGH 0x02
537 #define IRQTYPE_LOW 0x00
538 #define IRQTYPE_LEVEL 0x01
539 #define IRQTYPE_EDGE 0x00
541 #define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))
542 #define LOBYTE(w) ((BYTE)(w))
543 #define MAKEWORD(low,hi) ((WORD)(((BYTE)(low))|(((WORD)((BYTE)(hi)))<<8)))
546 typedef __u16 USHORT;
549 static int config_port = -1;
551 static int msnd_write_cfg(int cfg, int reg, int value)
554 X outb(value, cfg + 1);
555 X if (value != inb(cfg + 1)) {
556 X fprintf(stderr, "error: msnd_write_cfg: I/O error\n");
562 static int msnd_read_cfg(int cfg, int reg)
565 X return inb(cfg + 1);
568 static int msnd_write_cfg_io0(int cfg, int num, WORD io)
570 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
572 X if (msnd_write_cfg(cfg, IREG_IO0_BASEHI, HIBYTE(io)))
574 X if (msnd_write_cfg(cfg, IREG_IO0_BASELO, LOBYTE(io)))
579 static int msnd_read_cfg_io0(int cfg, int num, WORD *io)
581 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
584 X *io = MAKEWORD(msnd_read_cfg(cfg, IREG_IO0_BASELO),
585 X msnd_read_cfg(cfg, IREG_IO0_BASEHI));
590 static int msnd_write_cfg_io1(int cfg, int num, WORD io)
592 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
594 X if (msnd_write_cfg(cfg, IREG_IO1_BASEHI, HIBYTE(io)))
596 X if (msnd_write_cfg(cfg, IREG_IO1_BASELO, LOBYTE(io)))
601 static int msnd_read_cfg_io1(int cfg, int num, WORD *io)
603 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
606 X *io = MAKEWORD(msnd_read_cfg(cfg, IREG_IO1_BASELO),
607 X msnd_read_cfg(cfg, IREG_IO1_BASEHI));
612 static int msnd_write_cfg_irq(int cfg, int num, WORD irq)
614 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
616 X if (msnd_write_cfg(cfg, IREG_IRQ_NUMBER, LOBYTE(irq)))
618 X if (msnd_write_cfg(cfg, IREG_IRQ_TYPE, IRQTYPE_EDGE))
623 static int msnd_read_cfg_irq(int cfg, int num, WORD *irq)
625 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
628 X *irq = msnd_read_cfg(cfg, IREG_IRQ_NUMBER);
633 static int msnd_write_cfg_mem(int cfg, int num, int mem)
640 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
642 X if (msnd_write_cfg(cfg, IREG_MEMBASEHI, HIBYTE(wmem)))
644 X if (msnd_write_cfg(cfg, IREG_MEMBASELO, LOBYTE(wmem)))
646 X if (wmem && msnd_write_cfg(cfg, IREG_MEMCONTROL, (MEMTYPE_HIADDR | MEMTYPE_16BIT)))
651 static int msnd_read_cfg_mem(int cfg, int num, int *mem)
653 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
656 X *mem = MAKEWORD(msnd_read_cfg(cfg, IREG_MEMBASELO),
657 X msnd_read_cfg(cfg, IREG_MEMBASEHI));
663 static int msnd_activate_logical(int cfg, int num)
665 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
667 X if (msnd_write_cfg(cfg, IREG_ACTIVATE, LD_ACTIVATE))
672 static int msnd_write_cfg_logical(int cfg, int num, WORD io0, WORD io1, WORD irq, int mem)
674 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
676 X if (msnd_write_cfg_io0(cfg, num, io0))
678 X if (msnd_write_cfg_io1(cfg, num, io1))
680 X if (msnd_write_cfg_irq(cfg, num, irq))
682 X if (msnd_write_cfg_mem(cfg, num, mem))
684 X if (msnd_activate_logical(cfg, num))
689 static int msnd_read_cfg_logical(int cfg, int num, WORD *io0, WORD *io1, WORD *irq, int *mem)
691 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
693 X if (msnd_read_cfg_io0(cfg, num, io0))
695 X if (msnd_read_cfg_io1(cfg, num, io1))
697 X if (msnd_read_cfg_irq(cfg, num, irq))
699 X if (msnd_read_cfg_mem(cfg, num, mem))
704 static void usage(void)
708 X "pinnaclecfg 1.0\n"
710 X "usage: pinnaclecfg <config port> [device config]\n"
712 X "This is for use with the card in NON-PnP mode only.\n"
714 X "Available devices (not all available for Fiji):\n"
716 X " Device Description\n"
717 X " -------------------------------------------------------------------\n"
718 X " reset Reset all devices (i.e. disable)\n"
719 X " show Display current device configurations\n"
721 X " dsp <io> <irq> <mem> Audio device\n"
722 X " mpu <io> <irq> Internal Kurzweil synth\n"
723 X " ide <io0> <io1> <irq> On-board IDE controller\n"
724 X " joystick <io> Joystick port\n"
729 static int cfg_reset(void)
733 X for (i = 0; i < 4; ++i)
734 X msnd_write_cfg_logical(config_port, i, 0, 0, 0, 0);
739 static int cfg_show(void)
744 X for (i = 0; i < 4; ++i) {
745 X WORD io0, io1, irq;
747 X msnd_read_cfg_logical(config_port, i, &io0, &io1, &irq, &mem);
750 X if (io0 || irq || mem) {
751 X printf("dsp 0x%x %d 0x%x\n", io0, irq, mem);
757 X printf("mpu 0x%x %d\n", io0, irq);
762 X if (io0 || io1 || irq) {
763 X printf("ide 0x%x 0x%x %d\n", io0, io1, irq);
769 X printf("joystick 0x%x\n", io0);
777 X fprintf(stderr, "no devices configured\n");
782 static int cfg_dsp(int argc, char *argv[])
787 X sscanf(argv[0], "0x%x", &io) != 1 ||
788 X sscanf(argv[1], "%d", &irq) != 1 ||
789 X sscanf(argv[2], "0x%x", &mem) != 1)
792 X if (!(io == 0x290 ||
800 X fprintf(stderr, "error: io must be one of "
801 X "210, 220, 230, 240, 250, 260, 290, or 3E0\n");
811 X fprintf(stderr, "error: irq must be one of "
812 X "5, 7, 9, 10, 11 or 12\n");
816 X if (!(mem == 0xb0000 ||
822 X fprintf(stderr, "error: mem must be one of "
823 X "0xb0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000 or 0xe8000\n");
827 X return msnd_write_cfg_logical(config_port, 0, io, 0, irq, mem);
830 static int cfg_mpu(int argc, char *argv[])
835 X sscanf(argv[0], "0x%x", &io) != 1 ||
836 X sscanf(argv[1], "%d", &irq) != 1)
839 X return msnd_write_cfg_logical(config_port, 1, io, 0, irq, 0);
842 static int cfg_ide(int argc, char *argv[])
847 X sscanf(argv[0], "0x%x", &io0) != 1 ||
848 X sscanf(argv[0], "0x%x", &io1) != 1 ||
849 X sscanf(argv[1], "%d", &irq) != 1)
852 X return msnd_write_cfg_logical(config_port, 2, io0, io1, irq, 0);
855 static int cfg_joystick(int argc, char *argv[])
860 X sscanf(argv[0], "0x%x", &io) != 1)
863 X return msnd_write_cfg_logical(config_port, 3, io, 0, 0, 0);
866 int main(int argc, char *argv[])
876 X sscanf(argv[0], "0x%x", &config_port);
877 X if (config_port != 0x250 && config_port != 0x260 && config_port != 0x270) {
878 X fprintf(stderr, "error: <config port> must be 0x250, 0x260 or 0x270\n");
881 X if (ioperm(config_port, 2, 1)) {
883 X fprintf(stderr, "note: pinnaclecfg must be run as root\n");
888 X argc -= 2; argv += 2;
890 X if (strcmp(device, "reset") == 0)
892 X else if (strcmp(device, "show") == 0)
894 X else if (strcmp(device, "dsp") == 0)
895 X rv = cfg_dsp(argc, argv);
896 X else if (strcmp(device, "mpu") == 0)
897 X rv = cfg_mpu(argc, argv);
898 X else if (strcmp(device, "ide") == 0)
899 X rv = cfg_ide(argc, argv);
900 X else if (strcmp(device, "joystick") == 0)
901 X rv = cfg_joystick(argc, argv);
903 X fprintf(stderr, "error: unknown device %s\n", device);
908 X fprintf(stderr, "error: device configuration failed\n");
913 $shar_touch -am 1204092598 'MultiSound.d/pinnaclecfg.c' &&
914 chmod 0664 'MultiSound.d/pinnaclecfg.c' ||
915 $echo 'restore of' 'MultiSound.d/pinnaclecfg.c' 'failed'
916 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
917 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
918 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
919 || $echo 'MultiSound.d/pinnaclecfg.c:' 'MD5 check failed'
920 366bdf27f0db767a3c7921d0a6db20fe MultiSound.d/pinnaclecfg.c
923 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/pinnaclecfg.c'`"
924 test 10224 -eq "$shar_count" ||
925 $echo 'MultiSound.d/pinnaclecfg.c:' 'original size' '10224,' 'current size' "$shar_count!"
928 # ============= MultiSound.d/Makefile ==============
929 if test -f 'MultiSound.d/Makefile' && test "$first_param" != -c; then
930 $echo 'x -' SKIPPING 'MultiSound.d/Makefile' '(file already exists)'
932 $echo 'x -' extracting 'MultiSound.d/Makefile' '(text)'
933 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/Makefile' &&
936 PROGS = setdigital msndreset pinnaclecfg conv
943 $shar_touch -am 1204092398 'MultiSound.d/Makefile' &&
944 chmod 0664 'MultiSound.d/Makefile' ||
945 $echo 'restore of' 'MultiSound.d/Makefile' 'failed'
946 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
947 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
948 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
949 || $echo 'MultiSound.d/Makefile:' 'MD5 check failed'
950 76ca8bb44e3882edcf79c97df6c81845 MultiSound.d/Makefile
953 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/Makefile'`"
954 test 106 -eq "$shar_count" ||
955 $echo 'MultiSound.d/Makefile:' 'original size' '106,' 'current size' "$shar_count!"
958 # ============= MultiSound.d/conv.l ==============
959 if test -f 'MultiSound.d/conv.l' && test "$first_param" != -c; then
960 $echo 'x -' SKIPPING 'MultiSound.d/conv.l' '(file already exists)'
962 $echo 'x -' extracting 'MultiSound.d/conv.l' '(text)'
963 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/conv.l' &&
968 [0-9A-Fa-f]+H { int n; sscanf(yytext, "%xH", &n); printf("%c", n); }
970 int yywrap() { return 1; }
971 void main() { yylex(); }
973 $shar_touch -am 0828231798 'MultiSound.d/conv.l' &&
974 chmod 0664 'MultiSound.d/conv.l' ||
975 $echo 'restore of' 'MultiSound.d/conv.l' 'failed'
976 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
977 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
978 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
979 || $echo 'MultiSound.d/conv.l:' 'MD5 check failed'
980 d2411fc32cd71a00dcdc1f009e858dd2 MultiSound.d/conv.l
983 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/conv.l'`"
984 test 146 -eq "$shar_count" ||
985 $echo 'MultiSound.d/conv.l:' 'original size' '146,' 'current size' "$shar_count!"
988 # ============= MultiSound.d/msndreset.c ==============
989 if test -f 'MultiSound.d/msndreset.c' && test "$first_param" != -c; then
990 $echo 'x -' SKIPPING 'MultiSound.d/msndreset.c' '(file already exists)'
992 $echo 'x -' extracting 'MultiSound.d/msndreset.c' '(text)'
993 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/msndreset.c' &&
994 /*********************************************************************
996 X * msndreset.c - resets the MultiSound card
998 X * Copyright (C) 1998 Andrew Veliath
1000 X * This program is free software; you can redistribute it and/or modify
1001 X * it under the terms of the GNU General Public License as published by
1002 X * the Free Software Foundation; either version 2 of the License, or
1003 X * (at your option) any later version.
1005 X * This program is distributed in the hope that it will be useful,
1006 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
1007 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1008 X * GNU General Public License for more details.
1010 X * You should have received a copy of the GNU General Public License
1011 X * along with this program; if not, write to the Free Software
1012 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1014 X ********************************************************************/
1020 #include <sys/types.h>
1021 #include <sys/stat.h>
1022 #include <sys/ioctl.h>
1023 #include <sys/soundcard.h>
1025 int main(int argc, char *argv[])
1030 X fprintf(stderr, "usage: msndreset <mixer device>\n");
1034 X if ((fd = open(argv[1], O_RDWR)) < 0) {
1039 X if (ioctl(fd, SOUND_MIXER_PRIVATE1, 0) < 0) {
1040 X fprintf(stderr, "error: msnd ioctl reset failed\n");
1051 $shar_touch -am 1204100698 'MultiSound.d/msndreset.c' &&
1052 chmod 0664 'MultiSound.d/msndreset.c' ||
1053 $echo 'restore of' 'MultiSound.d/msndreset.c' 'failed'
1054 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
1055 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
1056 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
1057 || $echo 'MultiSound.d/msndreset.c:' 'MD5 check failed'
1058 c52f876521084e8eb25e12e01dcccb8a MultiSound.d/msndreset.c
1061 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/msndreset.c'`"
1062 test 1491 -eq "$shar_count" ||
1063 $echo 'MultiSound.d/msndreset.c:' 'original size' '1491,' 'current size' "$shar_count!"