~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/sound/cards/multisound.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/sound/cards/multisound.sh (Version linux-6.12-rc7) and /Documentation/sound/cards/multisound.sh (Version linux-5.5.19)


  1 #! /bin/sh                                          1 #! /bin/sh
  2 #                                                   2 #
  3 #  Turtle Beach MultiSound Driver Notes             3 #  Turtle Beach MultiSound Driver Notes
  4 #  -- Andrew Veliath <andrewtv@usa.net>              4 #  -- Andrew Veliath <andrewtv@usa.net>
  5 #                                                   5 #
  6 #  Last update:                      September      6 #  Last update:                      September 10, 1998
  7 #  Corresponding msnd driver:        0.8.3          7 #  Corresponding msnd driver:        0.8.3
  8 #                                                   8 #
  9 # ** This file is a README (top part) and shel      9 # ** This file is a README (top part) and shell archive (bottom part).
 10 #    The corresponding archived utility source     10 #    The corresponding archived utility sources can be unpacked by
 11 #    running `sh MultiSound' (the utilities ar     11 #    running `sh MultiSound' (the utilities are only needed for the
 12 #    Pinnacle and Fiji cards). **                  12 #    Pinnacle and Fiji cards). **
 13 #                                                  13 #
 14 #                                                  14 #
 15 #  -=-=- Getting Firmware -=-=-                    15 #  -=-=- Getting Firmware -=-=-
 16 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~                    16 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 17 #                                                  17 #
 18 #  See the section `Obtaining and Creating Fir     18 #  See the section `Obtaining and Creating Firmware Files' in this
 19 #  document for instructions on obtaining the      19 #  document for instructions on obtaining the necessary firmware
 20 #  files.                                          20 #  files.
 21 #                                                  21 #
 22 #                                                  22 #
 23 #  Supported Features                              23 #  Supported Features
 24 #  ~~~~~~~~~~~~~~~~~~                              24 #  ~~~~~~~~~~~~~~~~~~
 25 #                                                  25 #
 26 #  Currently, full-duplex digital audio (/dev/     26 #  Currently, full-duplex digital audio (/dev/dsp only, /dev/audio is
 27 #  not currently available) and mixer function     27 #  not currently available) and mixer functionality (/dev/mixer) are
 28 #  supported (memory mapped digital audio is n     28 #  supported (memory mapped digital audio is not yet supported).
 29 #  Digital transfers and monitoring can be don     29 #  Digital transfers and monitoring can be done as well if you have
 30 #  the digital daughterboard (see the section      30 #  the digital daughterboard (see the section on using the S/PDIF port
 31 #  for more information).                          31 #  for more information).
 32 #                                                  32 #
 33 #  Support for the Turtle Beach MultiSound Hur     33 #  Support for the Turtle Beach MultiSound Hurricane architecture is
 34 #  composed of the following modules (these ca     34 #  composed of the following modules (these can also operate compiled
 35 #  into the kernel):                               35 #  into the kernel):
 36 #                                                  36 #
 37 #  snd-msnd-lib           - MultiSound base (r     37 #  snd-msnd-lib           - MultiSound base (requires snd)
 38 #                                                  38 #
 39 #  snd-msnd-classic       - Base audio/mixer s     39 #  snd-msnd-classic       - Base audio/mixer support for Classic, Monetery and
 40 #                           Tahiti cards           40 #                           Tahiti cards
 41 #                                                  41 #
 42 #  snd-msnd-pinnacle      - Base audio/mixer s     42 #  snd-msnd-pinnacle      - Base audio/mixer support for Pinnacle and Fiji cards
 43 #                                                  43 #
 44 #                                                  44 #
 45 #  Important Notes - Read Before Using             45 #  Important Notes - Read Before Using
 46 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             46 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 47 #                                                  47 #
 48 #  The firmware files are not included (may ch     48 #  The firmware files are not included (may change in future).  You
 49 #  must obtain these images from Turtle Beach      49 #  must obtain these images from Turtle Beach (they are included in
 50 #  the MultiSound Development Kits), and place     50 #  the MultiSound Development Kits), and place them in /etc/sound for
 51 #  example, and give the full paths in the Lin     51 #  example, and give the full paths in the Linux configuration.  If
 52 #  you are compiling in support for the MultiS     52 #  you are compiling in support for the MultiSound driver rather than
 53 #  using it as a module, these firmware files      53 #  using it as a module, these firmware files must be accessible
 54 #  during kernel compilation.                      54 #  during kernel compilation.
 55 #                                                  55 #
 56 #  Please note these files must be binary file     56 #  Please note these files must be binary files, not assembler.  See
 57 #  the section later in this document for inst     57 #  the section later in this document for instructions to obtain these
 58 #  files.                                          58 #  files.
 59 #                                                  59 #
 60 #                                                  60 #
 61 #  Configuring Card Resources                      61 #  Configuring Card Resources
 62 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~                      62 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~
 63 #                                                  63 #
 64 #  ** This section is very important, as your      64 #  ** This section is very important, as your card may not work at all
 65 #     or your machine may crash if you do not      65 #     or your machine may crash if you do not do this correctly. **
 66 #                                                  66 #
 67 #  * Classic/Monterey/Tahiti                       67 #  * Classic/Monterey/Tahiti
 68 #                                                  68 #
 69 #  These cards are configured through the driv     69 #  These cards are configured through the driver snd-msnd-classic.  You must
 70 #  know the io port, then the driver will sele     70 #  know the io port, then the driver will select the irq and memory resources
 71 #  on the card.  It is up to you to know if th     71 #  on the card.  It is up to you to know if these are free locations or now,
 72 #  a conflict can lock the machine up.             72 #  a conflict can lock the machine up.
 73 #                                                  73 #
 74 #  * Pinnacle/Fiji                                 74 #  * Pinnacle/Fiji
 75 #                                                  75 #
 76 #  The Pinnacle and Fiji cards have an extra c     76 #  The Pinnacle and Fiji cards have an extra config port, either
 77 #  0x250, 0x260 or 0x270.  This port can be di     77 #  0x250, 0x260 or 0x270.  This port can be disabled to have the card
 78 #  configured strictly through PnP, however yo     78 #  configured strictly through PnP, however you lose the ability to
 79 #  access the IDE controller and joystick devi     79 #  access the IDE controller and joystick devices on this card when
 80 #  using PnP.  The included pinnaclecfg progra     80 #  using PnP.  The included pinnaclecfg program in this shell archive
 81 #  can be used to configure the card in non-Pn     81 #  can be used to configure the card in non-PnP mode, and in PnP mode
 82 #  you can use isapnptools.  These are describ     82 #  you can use isapnptools.  These are described briefly here.
 83 #                                                  83 #
 84 #  pinnaclecfg is not required; you can use th     84 #  pinnaclecfg is not required; you can use the snd-msnd-pinnacle module
 85 #  to fully configure the card as well.  Howev     85 #  to fully configure the card as well.  However, pinnaclecfg can be
 86 #  used to change the resource values of a par     86 #  used to change the resource values of a particular device after the
 87 #  snd-msnd-pinnacle module has been loaded.       87 #  snd-msnd-pinnacle module has been loaded.  If you are compiling the
 88 #  driver into the kernel, you must set these      88 #  driver into the kernel, you must set these values during compile
 89 #  time, however other peripheral resource val     89 #  time, however other peripheral resource values can be changed with
 90 #  the pinnaclecfg program after the kernel is     90 #  the pinnaclecfg program after the kernel is loaded.
 91 #                                                  91 #
 92 #                                                  92 #
 93 #  *** PnP mode                                    93 #  *** PnP mode
 94 #                                                  94 #
 95 #  Use pnpdump to obtain a sample configuratio     95 #  Use pnpdump to obtain a sample configuration if you can; I was able
 96 #  to obtain one with the command `pnpdump 1 0     96 #  to obtain one with the command `pnpdump 1 0x203' -- this may vary
 97 #  for you (running pnpdump by itself did not      97 #  for you (running pnpdump by itself did not work for me).  Then,
 98 #  edit this file and use isapnp to uncomment      98 #  edit this file and use isapnp to uncomment and set the card values.
 99 #  Use these values when inserting the snd-msn     99 #  Use these values when inserting the snd-msnd-pinnacle module.  Using
100 #  this method, you can set the resources for     100 #  this method, you can set the resources for the DSP and the Kurzweil
101 #  synth (Pinnacle).  Since Linux does not dir    101 #  synth (Pinnacle).  Since Linux does not directly support PnP
102 #  devices, you may have difficulty when using    102 #  devices, you may have difficulty when using the card in PnP mode
103 #  when it the driver is compiled into the ker    103 #  when it the driver is compiled into the kernel.  Using non-PnP mode
104 #  is preferable in this case.                    104 #  is preferable in this case.
105 #                                                 105 #
106 #  Here is an example mypinnacle.conf for isap    106 #  Here is an example mypinnacle.conf for isapnp that sets the card to
107 #  io base 0x210, irq 5 and mem 0xd8000, and a    107 #  io base 0x210, irq 5 and mem 0xd8000, and also sets the Kurzweil
108 #  synth to 0x330 and irq 9 (may need editing     108 #  synth to 0x330 and irq 9 (may need editing for your system):
109 #                                                 109 #
110 #  (READPORT 0x0203)                              110 #  (READPORT 0x0203)
111 #  (CSN 2)                                        111 #  (CSN 2)
112 #  (IDENTIFY *)                                   112 #  (IDENTIFY *)
113 #                                                 113 #
114 #  # DSP                                          114 #  # DSP
115 #  (CONFIGURE BVJ0440/-1 (LD 0                    115 #  (CONFIGURE BVJ0440/-1 (LD 0
116 #          (INT 0 (IRQ 5 (MODE +E))) (IO 0 (BA    116 #          (INT 0 (IRQ 5 (MODE +E))) (IO 0 (BASE 0x0210)) (MEM 0 (BASE 0x0d8000))
117 #          (ACT Y)))                              117 #          (ACT Y)))
118 #                                                 118 #
119 #  # Kurzweil Synth (Pinnacle Only)               119 #  # Kurzweil Synth (Pinnacle Only)
120 #  (CONFIGURE BVJ0440/-1 (LD 1                    120 #  (CONFIGURE BVJ0440/-1 (LD 1
121 #          (IO 0 (BASE 0x0330)) (INT 0 (IRQ 9     121 #          (IO 0 (BASE 0x0330)) (INT 0 (IRQ 9 (MODE +E)))
122 #          (ACT Y)))                              122 #          (ACT Y)))
123 #                                                 123 #
124 #  (WAITFORKEY)                                   124 #  (WAITFORKEY)
125 #                                                 125 #
126 #                                                 126 #
127 #  *** Non-PnP mode                               127 #  *** Non-PnP mode
128 #                                                 128 #
129 #  The second way is by running the card in no    129 #  The second way is by running the card in non-PnP mode.  This
130 #  actually has some advantages in that you ca    130 #  actually has some advantages in that you can access some other
131 #  devices on the card, such as the joystick a    131 #  devices on the card, such as the joystick and IDE controller.  To
132 #  configure the card, unpack this shell archi    132 #  configure the card, unpack this shell archive and build the
133 #  pinnaclecfg program.  Using this program, y    133 #  pinnaclecfg program.  Using this program, you can assign the
134 #  resource values to the card's devices, or d    134 #  resource values to the card's devices, or disable the devices.  As
135 #  an alternative to using pinnaclecfg, you ca    135 #  an alternative to using pinnaclecfg, you can specify many of the
136 #  configuration values when loading the snd-m    136 #  configuration values when loading the snd-msnd-pinnacle module (or
137 #  during kernel configuration when compiling     137 #  during kernel configuration when compiling the driver into the
138 #  kernel).                                       138 #  kernel).
139 #                                                 139 #
140 #  If you specify cfg=0x250 for the snd-msnd-p    140 #  If you specify cfg=0x250 for the snd-msnd-pinnacle module, it
141 #  automatically configure the card to the giv    141 #  automatically configure the card to the given io, irq and memory
142 #  values using that config port (the config p    142 #  values using that config port (the config port is jumper selectable
143 #  on the card to 0x250, 0x260 or 0x270).         143 #  on the card to 0x250, 0x260 or 0x270).
144 #                                                 144 #
145 #  See the `snd-msnd-pinnacle Additional Optio    145 #  See the `snd-msnd-pinnacle Additional Options' section below for more
146 #  information on these parameters (also, if y    146 #  information on these parameters (also, if you compile the driver
147 #  directly into the kernel, these extra param    147 #  directly into the kernel, these extra parameters can be useful
148 #  here).                                         148 #  here).
149 #                                                 149 #
150 #                                                 150 #
151 # ** It is very easy to cause problems in your    151 # ** It is very easy to cause problems in your machine if you choose a
152 #    resource value which is incorrect. **        152 #    resource value which is incorrect. **
153 #                                                 153 #
154 #                                                 154 #
155 #  Examples                                       155 #  Examples
156 #  ~~~~~~~~                                       156 #  ~~~~~~~~
157 #                                                 157 #
158 #  * MultiSound Classic/Monterey/Tahiti:          158 #  * MultiSound Classic/Monterey/Tahiti:
159 #                                                 159 #
160 #  modprobe snd                                   160 #  modprobe snd
161 #  insmod snd-msnd-lib                            161 #  insmod snd-msnd-lib
162 #  insmod snd-msnd-classic io=0x290 irq=7 mem=    162 #  insmod snd-msnd-classic io=0x290 irq=7 mem=0xd0000
163 #                                                 163 #
164 #  * MultiSound Pinnacle in PnP mode:             164 #  * MultiSound Pinnacle in PnP mode:
165 #                                                 165 #
166 #  modprobe snd                                   166 #  modprobe snd
167 #  insmod snd-msnd-lib                            167 #  insmod snd-msnd-lib
168 #  isapnp mypinnacle.conf                         168 #  isapnp mypinnacle.conf
169 #  insmod snd-msnd-pinnacle io=0x210 irq=5 mem    169 #  insmod snd-msnd-pinnacle io=0x210 irq=5 mem=0xd8000 <-- match mypinnacle.conf values
170 #                                                 170 #
171 #  * MultiSound Pinnacle in non-PnP mode (repl    171 #  * MultiSound Pinnacle in non-PnP mode (replace 0x250 with your configuration port,
172 #    one of 0x250, 0x260 or 0x270):               172 #    one of 0x250, 0x260 or 0x270):
173 #                                                 173 #
174 #  modprobe snd                                   174 #  modprobe snd
175 #  insmod snd-msnd-lib                            175 #  insmod snd-msnd-lib
176 #  insmod snd-msnd-pinnacle cfg=0x250 io=0x290    176 #  insmod snd-msnd-pinnacle cfg=0x250 io=0x290 irq=5 mem=0xd0000
177 #                                                 177 #
178 # * To use the MPU-compatible Kurzweil synth o    178 # * To use the MPU-compatible Kurzweil synth on the Pinnacle in PnP
179 #   mode, add the following (assumes you did `    179 #   mode, add the following (assumes you did `isapnp mypinnacle.conf'):
180 #                                                 180 #
181 #  insmod snd                                     181 #  insmod snd
182 #  insmod mpu401 io=0x330 irq=9                   182 #  insmod mpu401 io=0x330 irq=9                    <-- match mypinnacle.conf values
183 #                                                 183 #
184 # * To use the MPU-compatible Kurzweil synth o    184 # * To use the MPU-compatible Kurzweil synth on the Pinnacle in non-PnP
185 #   mode, add the following.  Note how we firs    185 #   mode, add the following.  Note how we first configure the peripheral's
186 #   resources, _then_ install a Linux driver f    186 #   resources, _then_ install a Linux driver for it:
187 #                                                 187 #
188 #  insmod snd                                     188 #  insmod snd
189 #  pinnaclecfg 0x250 mpu 0x330 9                  189 #  pinnaclecfg 0x250 mpu 0x330 9
190 #  insmod mpu401 io=0x330 irq=9                   190 #  insmod mpu401 io=0x330 irq=9
191 #                                                 191 #
192 #  -- OR you can use the following sequence wi    192 #  -- OR you can use the following sequence without pinnaclecfg in non-PnP mode:
193 #                                                 193 #
194 #  modprobe snd                                   194 #  modprobe snd
195 #  insmod snd-msnd-lib                            195 #  insmod snd-msnd-lib
196 #  insmod snd-msnd-pinnacle cfg=0x250 io=0x290    196 #  insmod snd-msnd-pinnacle cfg=0x250 io=0x290 irq=5 mem=0xd0000 mpu_io=0x330 mpu_irq=9
197 #  insmod snd                                     197 #  insmod snd
198 #  insmod mpu401 io=0x330 irq=9                   198 #  insmod mpu401 io=0x330 irq=9
199 #                                                 199 #
200 # * To setup the joystick port on the Pinnacle    200 # * To setup the joystick port on the Pinnacle in non-PnP mode (though
201 #   you have to find the actual Linux joystick    201 #   you have to find the actual Linux joystick driver elsewhere), you
202 #   can use pinnaclecfg:                          202 #   can use pinnaclecfg:
203 #                                                 203 #
204 #   pinnaclecfg 0x250 joystick 0x200              204 #   pinnaclecfg 0x250 joystick 0x200
205 #                                                 205 #
206 #  -- OR you can configure this using snd-msnd    206 #  -- OR you can configure this using snd-msnd-pinnacle with the following:
207 #                                                 207 #
208 #  modprobe snd                                   208 #  modprobe snd
209 #  insmod snd-msnd-lib                            209 #  insmod snd-msnd-lib
210 #  insmod snd-msnd-pinnacle cfg=0x250 io=0x290    210 #  insmod snd-msnd-pinnacle cfg=0x250 io=0x290 irq=5 mem=0xd0000 joystick_io=0x200
211 #                                                 211 #
212 #                                                 212 #
213 #  snd-msnd-classic, snd-msnd-pinnacle Require    213 #  snd-msnd-classic, snd-msnd-pinnacle Required Options
214 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    214 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
215 #                                                 215 #
216 #  If the following options are not given, the    216 #  If the following options are not given, the module will not load.
217 #  Examine the kernel message log for informat    217 #  Examine the kernel message log for informative error messages.
218 #  WARNING--probing isn't supported so try to     218 #  WARNING--probing isn't supported so try to make sure you have the
219 #  correct shared memory area, otherwise you m    219 #  correct shared memory area, otherwise you may experience problems.
220 #                                                 220 #
221 #  io                   I/O base of DSP, e.g.     221 #  io                   I/O base of DSP, e.g. io=0x210
222 #  irq                  IRQ number, e.g. irq=5    222 #  irq                  IRQ number, e.g. irq=5
223 #  mem                  Shared memory area, e.    223 #  mem                  Shared memory area, e.g. mem=0xd8000
224 #                                                 224 #
225 #                                                 225 #
226 #  snd-msnd-classic, snd-msnd-pinnacle Additio    226 #  snd-msnd-classic, snd-msnd-pinnacle Additional Options
227 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    227 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
228 #                                                 228 #
229 #  fifosize             The digital audio FIFO    229 #  fifosize             The digital audio FIFOs, in kilobytes.  If not
230 #                       specified, the default    230 #                       specified, the default will be used.  Increasing
231 #                       this value will reduce    231 #                       this value will reduce the chance of a FIFO
232 #                       underflow at the expen    232 #                       underflow at the expense of increasing overall
233 #                       latency.  For example,    233 #                       latency.  For example, fifosize=512 will
234 #                       allocate 512kB read an    234 #                       allocate 512kB read and write FIFOs (1MB total).
235 #                       While this may reduce     235 #                       While this may reduce dropouts, a heavy machine
236 #                       load will undoubtedly     236 #                       load will undoubtedly starve the FIFO of data
237 #                       and you will eventuall    237 #                       and you will eventually get dropouts.  One
238 #                       option is to alter the    238 #                       option is to alter the scheduling priority of
239 #                       the playback process,     239 #                       the playback process, using `nice' or some form
240 #                       of POSIX soft real-tim    240 #                       of POSIX soft real-time scheduling.
241 #                                                 241 #
242 #  calibrate_signal     Setting this to one ca    242 #  calibrate_signal     Setting this to one calibrates the ADCs to the
243 #                       signal, zero calibrate    243 #                       signal, zero calibrates to the card (defaults
244 #                       to zero).                 244 #                       to zero).
245 #                                                 245 #
246 #                                                 246 #
247 #  snd-msnd-pinnacle Additional Options           247 #  snd-msnd-pinnacle Additional Options
248 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           248 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
249 #                                                 249 #
250 #  digital              Specify digital=1 to e    250 #  digital              Specify digital=1 to enable the S/PDIF input
251 #                       if you have the digita    251 #                       if you have the digital daughterboard
252 #                       adapter. This will ena    252 #                       adapter. This will enable access to the
253 #                       DIGITAL1 input for the    253 #                       DIGITAL1 input for the soundcard in the mixer.
254 #                       Some mixer programs mi    254 #                       Some mixer programs might have trouble setting
255 #                       the DIGITAL1 source as    255 #                       the DIGITAL1 source as an input.  If you have
256 #                       trouble, you can try t    256 #                       trouble, you can try the setdigital.c program
257 #                       at the bottom of this     257 #                       at the bottom of this document.
258 #                                                 258 #
259 #  cfg                  Non-PnP configuration     259 #  cfg                  Non-PnP configuration port for the Pinnacle
260 #                       and Fiji (typically 0x    260 #                       and Fiji (typically 0x250, 0x260 or 0x270,
261 #                       depending on the jumpe    261 #                       depending on the jumper configuration).  If
262 #                       this option is omitted    262 #                       this option is omitted, then it is assumed
263 #                       that the card is in Pn    263 #                       that the card is in PnP mode, and that the
264 #                       specified DSP resource    264 #                       specified DSP resource values are already
265 #                       configured with PnP (i    265 #                       configured with PnP (i.e. it won't attempt to
266 #                       do any sort of configu    266 #                       do any sort of configuration).
267 #                                                 267 #
268 #  When the Pinnacle is in non-PnP mode, you c    268 #  When the Pinnacle is in non-PnP mode, you can use the following
269 #  options to configure particular devices.  I    269 #  options to configure particular devices.  If a full specification
270 #  for a device is not given, then the device     270 #  for a device is not given, then the device is not configured.  Note
271 #  that you still must use a Linux driver for     271 #  that you still must use a Linux driver for any of these devices
272 #  once their resources are setup (such as the    272 #  once their resources are setup (such as the Linux joystick driver,
273 #  or the MPU401 driver from OSS for the Kurzw    273 #  or the MPU401 driver from OSS for the Kurzweil synth).
274 #                                                 274 #
275 #  mpu_io               I/O port of MPU (on-bo    275 #  mpu_io               I/O port of MPU (on-board Kurzweil synth)
276 #  mpu_irq              IRQ of MPU (on-board K    276 #  mpu_irq              IRQ of MPU (on-board Kurzweil synth)
277 #  ide_io0              First I/O port of IDE     277 #  ide_io0              First I/O port of IDE controller
278 #  ide_io1              Second I/O port of IDE    278 #  ide_io1              Second I/O port of IDE controller
279 #  ide_irq              IRQ IDE controller        279 #  ide_irq              IRQ IDE controller
280 #  joystick_io          I/O port of joystick      280 #  joystick_io          I/O port of joystick
281 #                                                 281 #
282 #                                                 282 #
283 #  Obtaining and Creating Firmware Files          283 #  Obtaining and Creating Firmware Files
284 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~          284 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
285 #                                                 285 #
286 #       For the Classic/Tahiti/Monterey           286 #       For the Classic/Tahiti/Monterey
287 #       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           287 #       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
288 #                                                 288 #
289 #  Download to /tmp and unzip the following fi    289 #  Download to /tmp and unzip the following file from Turtle Beach:
290 #                                                 290 #
291 #       ftp://ftp.voyetra.com/pub/tbs/msndcl/m    291 #       ftp://ftp.voyetra.com/pub/tbs/msndcl/msndvkit.zip
292 #                                                 292 #
293 #  When unzipped, unzip the file named MsndFil    293 #  When unzipped, unzip the file named MsndFiles.zip.  Then copy the
294 #  following firmware files to /etc/sound (not    294 #  following firmware files to /etc/sound (note the file renaming):
295 #                                                 295 #
296 #    cp DSPCODE/MSNDINIT.BIN /etc/sound/msndin    296 #    cp DSPCODE/MSNDINIT.BIN /etc/sound/msndinit.bin
297 #    cp DSPCODE/MSNDPERM.REB /etc/sound/msndpe    297 #    cp DSPCODE/MSNDPERM.REB /etc/sound/msndperm.bin
298 #                                                 298 #
299 #  When configuring the Linux kernel, specify     299 #  When configuring the Linux kernel, specify /etc/sound/msndinit.bin and
300 #  /etc/sound/msndperm.bin for the two firmwar    300 #  /etc/sound/msndperm.bin for the two firmware files (Linux kernel
301 #  versions older than 2.2 do not ask for firm    301 #  versions older than 2.2 do not ask for firmware paths, and are
302 #  hardcoded to /etc/sound).                      302 #  hardcoded to /etc/sound).
303 #                                                 303 #
304 #  If you are compiling the driver into the ke    304 #  If you are compiling the driver into the kernel, these files must
305 #  be accessible during compilation, but will     305 #  be accessible during compilation, but will not be needed later.
306 #  The files must remain, however, if the driv    306 #  The files must remain, however, if the driver is used as a module.
307 #                                                 307 #
308 #                                                 308 #
309 #       For the Pinnacle/Fiji                     309 #       For the Pinnacle/Fiji
310 #       ~~~~~~~~~~~~~~~~~~~~~                     310 #       ~~~~~~~~~~~~~~~~~~~~~
311 #                                                 311 #
312 #  Download to /tmp and unzip the following fi    312 #  Download to /tmp and unzip the following file from Turtle Beach (be
313 #  sure to use the entire URL; some have had t    313 #  sure to use the entire URL; some have had trouble navigating to the
314 #  URL):                                          314 #  URL):
315 #                                                 315 #
316 #       ftp://ftp.voyetra.com/pub/tbs/pinn/pnd    316 #       ftp://ftp.voyetra.com/pub/tbs/pinn/pnddk100.zip
317 #                                                 317 #
318 #  Unpack this shell archive, and run make in     318 #  Unpack this shell archive, and run make in the created directory
319 #  (you need a C compiler and flex to build th    319 #  (you need a C compiler and flex to build the utilities).  This
320 #  should give you the executables conv, pinna    320 #  should give you the executables conv, pinnaclecfg and setdigital.
321 #  conv is only used temporarily here to creat    321 #  conv is only used temporarily here to create the firmware files,
322 #  while pinnaclecfg is used to configure the     322 #  while pinnaclecfg is used to configure the Pinnacle or Fiji card in
323 #  non-PnP mode, and setdigital can be used to    323 #  non-PnP mode, and setdigital can be used to set the S/PDIF input on
324 #  the mixer (pinnaclecfg and setdigital shoul    324 #  the mixer (pinnaclecfg and setdigital should be copied to a
325 #  convenient place, possibly run during syste    325 #  convenient place, possibly run during system initialization).
326 #                                                 326 #
327 #  To generating the firmware files with the `    327 #  To generating the firmware files with the `conv' program, we create
328 #  the binary firmware files by doing the foll    328 #  the binary firmware files by doing the following conversion
329 #  (assuming the archive unpacked into a direc    329 #  (assuming the archive unpacked into a directory named PINNDDK):
330 #                                                 330 #
331 #    ./conv < PINNDDK/dspcode/pndspini.asm > /    331 #    ./conv < PINNDDK/dspcode/pndspini.asm > /etc/sound/pndspini.bin
332 #    ./conv < PINNDDK/dspcode/pndsperm.asm > /    332 #    ./conv < PINNDDK/dspcode/pndsperm.asm > /etc/sound/pndsperm.bin
333 #                                                 333 #
334 #  The conv (and conv.l) program is not needed    334 #  The conv (and conv.l) program is not needed after conversion and can
335 #  be safely deleted.  Then, when configuring     335 #  be safely deleted.  Then, when configuring the Linux kernel, specify
336 #  /etc/sound/pndspini.bin and /etc/sound/pnds    336 #  /etc/sound/pndspini.bin and /etc/sound/pndsperm.bin for the two
337 #  firmware files (Linux kernel versions older    337 #  firmware files (Linux kernel versions older than 2.2 do not ask for
338 #  firmware paths, and are hardcoded to /etc/s    338 #  firmware paths, and are hardcoded to /etc/sound).
339 #                                                 339 #
340 #  If you are compiling the driver into the ke    340 #  If you are compiling the driver into the kernel, these files must
341 #  be accessible during compilation, but will     341 #  be accessible during compilation, but will not be needed later.
342 #  The files must remain, however, if the driv    342 #  The files must remain, however, if the driver is used as a module.
343 #                                                 343 #
344 #                                                 344 #
345 #  Using Digital I/O with the S/PDIF Port         345 #  Using Digital I/O with the S/PDIF Port
346 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         346 #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
347 #                                                 347 #
348 #  If you have a Pinnacle or Fiji with the dig    348 #  If you have a Pinnacle or Fiji with the digital daughterboard and
349 #  want to set it as the input source, you can    349 #  want to set it as the input source, you can use this program if you
350 #  have trouble trying to do it with a mixer p    350 #  have trouble trying to do it with a mixer program (be sure to
351 #  insert the module with the digital=1 option    351 #  insert the module with the digital=1 option, or say Y to the option
352 #  during compiled-in kernel operation).  Upon    352 #  during compiled-in kernel operation).  Upon selection of the S/PDIF
353 #  port, you should be able monitor and record    353 #  port, you should be able monitor and record from it.
354 #                                                 354 #
355 #  There is something to note about using the     355 #  There is something to note about using the S/PDIF port.  Digital
356 #  timing is taken from the digital signal, so    356 #  timing is taken from the digital signal, so if a signal is not
357 #  connected to the port and it is selected as    357 #  connected to the port and it is selected as recording input, you
358 #  will find PCM playback to be distorted in p    358 #  will find PCM playback to be distorted in playback rate.  Also,
359 #  attempting to record at a sampling rate oth    359 #  attempting to record at a sampling rate other than the DAT rate may
360 #  be problematic (i.e. trying to record at 80    360 #  be problematic (i.e. trying to record at 8000Hz when the DAT signal
361 #  is 44100Hz).  If you have a problem with th    361 #  is 44100Hz).  If you have a problem with this, set the recording
362 #  input to analog if you need to record at a     362 #  input to analog if you need to record at a rate other than that of
363 #  the DAT rate.                                  363 #  the DAT rate.
364 #                                                 364 #
365 #                                                 365 #
366 #  -- Shell archive attached below, just run `    366 #  -- Shell archive attached below, just run `sh MultiSound' to extract.
367 #     Contains Pinnacle/Fiji utilities to conv    367 #     Contains Pinnacle/Fiji utilities to convert firmware, configure
368 #     in non-PnP mode, and select the DIGITAL1    368 #     in non-PnP mode, and select the DIGITAL1 input for the mixer.
369 #                                                 369 #
370 #                                                 370 #
371 #!/bin/sh                                         371 #!/bin/sh
372 # This is a shell archive (produced by GNU sha    372 # This is a shell archive (produced by GNU sharutils 4.2).
373 # To extract the files from this archive, save    373 # To extract the files from this archive, save it to some FILE, remove
374 # everything before the `!/bin/sh' line above,    374 # everything before the `!/bin/sh' line above, then type `sh FILE'.
375 #                                                 375 #
376 # Made on 1998-12-04 10:07 EST by <andrewtv@ztr    376 # Made on 1998-12-04 10:07 EST by <andrewtv@ztransform.velsoft.com>.
377 # Source directory was `/home/andrewtv/program    377 # Source directory was `/home/andrewtv/programming/pinnacle/pinnacle'.
378 #                                                 378 #
379 # Existing files will *not* be overwritten unl    379 # Existing files will *not* be overwritten unless `-c' is specified.
380 #                                                 380 #
381 # This shar contains:                             381 # This shar contains:
382 # length mode       name                          382 # length mode       name
383 # ------ ---------- --------------------------    383 # ------ ---------- ------------------------------------------
384 #   2064 -rw-rw-r-- MultiSound.d/setdigital.c     384 #   2064 -rw-rw-r-- MultiSound.d/setdigital.c
385 #  10224 -rw-rw-r-- MultiSound.d/pinnaclecfg.c    385 #  10224 -rw-rw-r-- MultiSound.d/pinnaclecfg.c
386 #    106 -rw-rw-r-- MultiSound.d/Makefile         386 #    106 -rw-rw-r-- MultiSound.d/Makefile
387 #    146 -rw-rw-r-- MultiSound.d/conv.l           387 #    146 -rw-rw-r-- MultiSound.d/conv.l
388 #   1491 -rw-rw-r-- MultiSound.d/msndreset.c      388 #   1491 -rw-rw-r-- MultiSound.d/msndreset.c
389 #                                                 389 #
390 save_IFS="${IFS}"                                 390 save_IFS="${IFS}"
391 IFS="${IFS}:"                                     391 IFS="${IFS}:"
392 gettext_dir=FAILED                                392 gettext_dir=FAILED
393 locale_dir=FAILED                                 393 locale_dir=FAILED
394 first_param="$1"                                  394 first_param="$1"
395 for dir in $PATH                                  395 for dir in $PATH
396 do                                                396 do
397   if test "$gettext_dir" = FAILED && test -f $    397   if test "$gettext_dir" = FAILED && test -f $dir/gettext \
398      && ($dir/gettext --version >/dev/null 2>&    398      && ($dir/gettext --version >/dev/null 2>&1)
399   then                                            399   then
400     set `$dir/gettext --version 2>&1`             400     set `$dir/gettext --version 2>&1`
401     if test "$3" = GNU                            401     if test "$3" = GNU
402     then                                          402     then
403       gettext_dir=$dir                            403       gettext_dir=$dir
404     fi                                            404     fi
405   fi                                              405   fi
406   if test "$locale_dir" = FAILED && test -f $d    406   if test "$locale_dir" = FAILED && test -f $dir/shar \
407      && ($dir/shar --print-text-domain-dir >/d    407      && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
408   then                                            408   then
409     locale_dir=`$dir/shar --print-text-domain-    409     locale_dir=`$dir/shar --print-text-domain-dir`
410   fi                                              410   fi
411 done                                              411 done
412 IFS="$save_IFS"                                   412 IFS="$save_IFS"
413 if test "$locale_dir" = FAILED || test "$gette    413 if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
414 then                                              414 then
415   echo=echo                                       415   echo=echo
416 else                                              416 else
417   TEXTDOMAINDIR=$locale_dir                       417   TEXTDOMAINDIR=$locale_dir
418   export TEXTDOMAINDIR                            418   export TEXTDOMAINDIR
419   TEXTDOMAIN=sharutils                            419   TEXTDOMAIN=sharutils
420   export TEXTDOMAIN                               420   export TEXTDOMAIN
421   echo="$gettext_dir/gettext -s"                  421   echo="$gettext_dir/gettext -s"
422 fi                                                422 fi
423 touch -am 1231235999 $$.touch >/dev/null 2>&1     423 touch -am 1231235999 $$.touch >/dev/null 2>&1
424 if test ! -f 1231235999 && test -f $$.touch; t    424 if test ! -f 1231235999 && test -f $$.touch; then
425   shar_touch=touch                                425   shar_touch=touch
426 else                                              426 else
427   shar_touch=:                                    427   shar_touch=:
428   echo                                            428   echo
429   $echo 'WARNING: not restoring timestamps.  C    429   $echo 'WARNING: not restoring timestamps.  Consider getting and'
430   $echo "installing GNU \`touch', distributed     430   $echo "installing GNU \`touch', distributed in GNU File Utilities..."
431   echo                                            431   echo
432 fi                                                432 fi
433 rm -f 1231235999 $$.touch                         433 rm -f 1231235999 $$.touch
434 #                                                 434 #
435 if mkdir _sh01426; then                           435 if mkdir _sh01426; then
436   $echo 'x -' 'creating lock directory'           436   $echo 'x -' 'creating lock directory'
437 else                                              437 else
438   $echo 'failed to create lock directory'         438   $echo 'failed to create lock directory'
439   exit 1                                          439   exit 1
440 fi                                                440 fi
441 # ============= MultiSound.d/setdigital.c ====    441 # ============= MultiSound.d/setdigital.c ==============
442 if test ! -d 'MultiSound.d'; then                 442 if test ! -d 'MultiSound.d'; then
443   $echo 'x -' 'creating directory' 'MultiSound    443   $echo 'x -' 'creating directory' 'MultiSound.d'
444   mkdir 'MultiSound.d'                            444   mkdir 'MultiSound.d'
445 fi                                                445 fi
446 if test -f 'MultiSound.d/setdigital.c' && test    446 if test -f 'MultiSound.d/setdigital.c' && test "$first_param" != -c; then
447   $echo 'x -' SKIPPING 'MultiSound.d/setdigita    447   $echo 'x -' SKIPPING 'MultiSound.d/setdigital.c' '(file already exists)'
448 else                                              448 else
449   $echo 'x -' extracting 'MultiSound.d/setdigi    449   $echo 'x -' extracting 'MultiSound.d/setdigital.c' '(text)'
450   sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/s    450   sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/setdigital.c' &&
451 /*********************************************    451 /*********************************************************************
452 X *                                               452 X *
453 X * setdigital.c - sets the DIGITAL1 input for    453 X * setdigital.c - sets the DIGITAL1 input for a mixer
454 X *                                               454 X *
455 X * Copyright (C) 1998 Andrew Veliath             455 X * Copyright (C) 1998 Andrew Veliath
456 X *                                               456 X *
457 X * This program is free software; you can red    457 X * This program is free software; you can redistribute it and/or modify
458 X * it under the terms of the GNU General Publ    458 X * it under the terms of the GNU General Public License as published by
459 X * the Free Software Foundation; either versi    459 X * the Free Software Foundation; either version 2 of the License, or
460 X * (at your option) any later version.           460 X * (at your option) any later version.
461 X *                                               461 X *
462 X * This program is distributed in the hope th    462 X * This program is distributed in the hope that it will be useful,
463 X * but WITHOUT ANY WARRANTY; without even the    463 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
464 X * MERCHANTABILITY or FITNESS FOR A PARTICULA    464 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
465 X * GNU General Public License for more detail    465 X * GNU General Public License for more details.
466 X *                                               466 X *
467 X * You should have received a copy of the GNU    467 X * You should have received a copy of the GNU General Public License
468 X * along with this program; if not, write to     468 X * along with this program; if not, write to the Free Software
469 X * Foundation, Inc., 675 Mass Ave, Cambridge,    469 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
470 X *                                               470 X *
471 X ********************************************    471 X ********************************************************************/
472 X                                                 472 X
473 #include <stdio.h>                                473 #include <stdio.h>
474 #include <stdlib.h>                               474 #include <stdlib.h>
475 #include <unistd.h>                               475 #include <unistd.h>
476 #include <fcntl.h>                                476 #include <fcntl.h>
477 #include <sys/types.h>                            477 #include <sys/types.h>
478 #include <sys/stat.h>                             478 #include <sys/stat.h>
479 #include <sys/ioctl.h>                            479 #include <sys/ioctl.h>
480 #include <sys/soundcard.h>                        480 #include <sys/soundcard.h>
481 X                                                 481 X
482 int main(int argc, char *argv[])                  482 int main(int argc, char *argv[])
483 {                                                 483 {
484 X       int fd;                                   484 X       int fd;
485 X       unsigned long recmask, recsrc;            485 X       unsigned long recmask, recsrc;
486 X                                                 486 X
487 X       if (argc != 2) {                          487 X       if (argc != 2) {
488 X               fprintf(stderr, "usage: setdig    488 X               fprintf(stderr, "usage: setdigital <mixer device>\n");
489 X               exit(1);                          489 X               exit(1);
490 X       }                                         490 X       }
491 X                                                 491 X
492 X       if ((fd = open(argv[1], O_RDWR)) < 0)     492 X       if ((fd = open(argv[1], O_RDWR)) < 0) {
493 X               perror(argv[1]);                  493 X               perror(argv[1]);
494 X               exit(1);                          494 X               exit(1);
495 X       }                                         495 X       }
496 X                                                 496 X
497 X       if (ioctl(fd, SOUND_MIXER_READ_RECMASK    497 X       if (ioctl(fd, SOUND_MIXER_READ_RECMASK, &recmask) < 0) {
498 X               fprintf(stderr, "error: ioctl     498 X               fprintf(stderr, "error: ioctl read recording mask failed\n");
499 X               perror("ioctl");                  499 X               perror("ioctl");
500 X               close(fd);                        500 X               close(fd);
501 X               exit(1);                          501 X               exit(1);
502 X       }                                         502 X       }
503 X                                                 503 X
504 X       if (!(recmask & SOUND_MASK_DIGITAL1))     504 X       if (!(recmask & SOUND_MASK_DIGITAL1)) {
505 X               fprintf(stderr, "error: cannot    505 X               fprintf(stderr, "error: cannot find DIGITAL1 device in mixer\n");
506 X               close(fd);                        506 X               close(fd);
507 X               exit(1);                          507 X               exit(1);
508 X       }                                         508 X       }
509 X                                                 509 X
510 X       if (ioctl(fd, SOUND_MIXER_READ_RECSRC,    510 X       if (ioctl(fd, SOUND_MIXER_READ_RECSRC, &recsrc) < 0) {
511 X               fprintf(stderr, "error: ioctl     511 X               fprintf(stderr, "error: ioctl read recording source failed\n");
512 X               perror("ioctl");                  512 X               perror("ioctl");
513 X               close(fd);                        513 X               close(fd);
514 X               exit(1);                          514 X               exit(1);
515 X       }                                         515 X       }
516 X                                                 516 X
517 X       recsrc |= SOUND_MASK_DIGITAL1;            517 X       recsrc |= SOUND_MASK_DIGITAL1;
518 X                                                 518 X
519 X       if (ioctl(fd, SOUND_MIXER_WRITE_RECSRC    519 X       if (ioctl(fd, SOUND_MIXER_WRITE_RECSRC, &recsrc) < 0) {
520 X               fprintf(stderr, "error: ioctl     520 X               fprintf(stderr, "error: ioctl write recording source failed\n");
521 X               perror("ioctl");                  521 X               perror("ioctl");
522 X               close(fd);                        522 X               close(fd);
523 X               exit(1);                          523 X               exit(1);
524 X       }                                         524 X       }
525 X                                                 525 X
526 X       close(fd);                                526 X       close(fd);
527 X                                                 527 X
528 X       return 0;                                 528 X       return 0;
529 }                                                 529 }
530 SHAR_EOF                                          530 SHAR_EOF
531   $shar_touch -am 1204092598 'MultiSound.d/set    531   $shar_touch -am 1204092598 'MultiSound.d/setdigital.c' &&
532   chmod 0664 'MultiSound.d/setdigital.c' ||       532   chmod 0664 'MultiSound.d/setdigital.c' ||
533   $echo 'restore of' 'MultiSound.d/setdigital.    533   $echo 'restore of' 'MultiSound.d/setdigital.c' 'failed'
534   if ( md5sum --help 2>&1 | grep 'sage: md5sum    534   if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
535   && ( md5sum --version 2>&1 | grep -v 'textut    535   && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
536     md5sum -c << SHAR_EOF >/dev/null 2>&1 \       536     md5sum -c << SHAR_EOF >/dev/null 2>&1 \
537     || $echo 'MultiSound.d/setdigital.c:' 'MD5    537     || $echo 'MultiSound.d/setdigital.c:' 'MD5 check failed'
538 e87217fc3e71288102ba41fd81f71ec4  MultiSound.d    538 e87217fc3e71288102ba41fd81f71ec4  MultiSound.d/setdigital.c
539 SHAR_EOF                                          539 SHAR_EOF
540   else                                            540   else
541     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c    541     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/setdigital.c'`"
542     test 2064 -eq "$shar_count" ||                542     test 2064 -eq "$shar_count" ||
543     $echo 'MultiSound.d/setdigital.c:' 'origin    543     $echo 'MultiSound.d/setdigital.c:' 'original size' '2064,' 'current size' "$shar_count!"
544   fi                                              544   fi
545 fi                                                545 fi
546 # ============= MultiSound.d/pinnaclecfg.c ===    546 # ============= MultiSound.d/pinnaclecfg.c ==============
547 if test -f 'MultiSound.d/pinnaclecfg.c' && tes    547 if test -f 'MultiSound.d/pinnaclecfg.c' && test "$first_param" != -c; then
548   $echo 'x -' SKIPPING 'MultiSound.d/pinnaclec    548   $echo 'x -' SKIPPING 'MultiSound.d/pinnaclecfg.c' '(file already exists)'
549 else                                              549 else
550   $echo 'x -' extracting 'MultiSound.d/pinnacl    550   $echo 'x -' extracting 'MultiSound.d/pinnaclecfg.c' '(text)'
551   sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/p    551   sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/pinnaclecfg.c' &&
552 /*********************************************    552 /*********************************************************************
553 X *                                               553 X *
554 X * pinnaclecfg.c - Pinnacle/Fiji Device Confi    554 X * pinnaclecfg.c - Pinnacle/Fiji Device Configuration Program
555 X *                                               555 X *
556 X * This is for NON-PnP mode only.  For PnP mo    556 X * This is for NON-PnP mode only.  For PnP mode, use isapnptools.
557 X *                                               557 X *
558 X * This is Linux-specific, and must be run wi    558 X * This is Linux-specific, and must be run with root permissions.
559 X *                                               559 X *
560 X * Part of the Turtle Beach MultiSound Sound     560 X * Part of the Turtle Beach MultiSound Sound Card Driver for Linux
561 X *                                               561 X *
562 X * Copyright (C) 1998 Andrew Veliath             562 X * Copyright (C) 1998 Andrew Veliath
563 X *                                               563 X *
564 X * This program is free software; you can red    564 X * This program is free software; you can redistribute it and/or modify
565 X * it under the terms of the GNU General Publ    565 X * it under the terms of the GNU General Public License as published by
566 X * the Free Software Foundation; either versi    566 X * the Free Software Foundation; either version 2 of the License, or
567 X * (at your option) any later version.           567 X * (at your option) any later version.
568 X *                                               568 X *
569 X * This program is distributed in the hope th    569 X * This program is distributed in the hope that it will be useful,
570 X * but WITHOUT ANY WARRANTY; without even the    570 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
571 X * MERCHANTABILITY or FITNESS FOR A PARTICULA    571 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
572 X * GNU General Public License for more detail    572 X * GNU General Public License for more details.
573 X *                                               573 X *
574 X * You should have received a copy of the GNU    574 X * You should have received a copy of the GNU General Public License
575 X * along with this program; if not, write to     575 X * along with this program; if not, write to the Free Software
576 X * Foundation, Inc., 675 Mass Ave, Cambridge,    576 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
577 X *                                               577 X *
578 X ********************************************    578 X ********************************************************************/
579 X                                                 579 X
580 #include <stdio.h>                                580 #include <stdio.h>
581 #include <stdlib.h>                               581 #include <stdlib.h>
582 #include <string.h>                               582 #include <string.h>
583 #include <errno.h>                                583 #include <errno.h>
584 #include <unistd.h>                               584 #include <unistd.h>
585 #include <asm/types.h>                            585 #include <asm/types.h>
586 #include <sys/io.h>                               586 #include <sys/io.h>
587 X                                                 587 X
588 #define IREG_LOGDEVICE          0x07              588 #define IREG_LOGDEVICE          0x07
589 #define IREG_ACTIVATE           0x30              589 #define IREG_ACTIVATE           0x30
590 #define LD_ACTIVATE             0x01              590 #define LD_ACTIVATE             0x01
591 #define LD_DISACTIVATE          0x00              591 #define LD_DISACTIVATE          0x00
592 #define IREG_EECONTROL          0x3F              592 #define IREG_EECONTROL          0x3F
593 #define IREG_MEMBASEHI          0x40              593 #define IREG_MEMBASEHI          0x40
594 #define IREG_MEMBASELO          0x41              594 #define IREG_MEMBASELO          0x41
595 #define IREG_MEMCONTROL         0x42              595 #define IREG_MEMCONTROL         0x42
596 #define IREG_MEMRANGEHI         0x43              596 #define IREG_MEMRANGEHI         0x43
597 #define IREG_MEMRANGELO         0x44              597 #define IREG_MEMRANGELO         0x44
598 #define MEMTYPE_8BIT            0x00              598 #define MEMTYPE_8BIT            0x00
599 #define MEMTYPE_16BIT           0x02              599 #define MEMTYPE_16BIT           0x02
600 #define MEMTYPE_RANGE           0x00              600 #define MEMTYPE_RANGE           0x00
601 #define MEMTYPE_HIADDR          0x01              601 #define MEMTYPE_HIADDR          0x01
602 #define IREG_IO0_BASEHI         0x60              602 #define IREG_IO0_BASEHI         0x60
603 #define IREG_IO0_BASELO         0x61              603 #define IREG_IO0_BASELO         0x61
604 #define IREG_IO1_BASEHI         0x62              604 #define IREG_IO1_BASEHI         0x62
605 #define IREG_IO1_BASELO         0x63              605 #define IREG_IO1_BASELO         0x63
606 #define IREG_IRQ_NUMBER         0x70              606 #define IREG_IRQ_NUMBER         0x70
607 #define IREG_IRQ_TYPE           0x71              607 #define IREG_IRQ_TYPE           0x71
608 #define IRQTYPE_HIGH            0x02              608 #define IRQTYPE_HIGH            0x02
609 #define IRQTYPE_LOW             0x00              609 #define IRQTYPE_LOW             0x00
610 #define IRQTYPE_LEVEL           0x01              610 #define IRQTYPE_LEVEL           0x01
611 #define IRQTYPE_EDGE            0x00              611 #define IRQTYPE_EDGE            0x00
612 X                                                 612 X
613 #define HIBYTE(w)               ((BYTE)(((WORD    613 #define HIBYTE(w)               ((BYTE)(((WORD)(w) >> 8) & 0xFF))
614 #define LOBYTE(w)               ((BYTE)(w))       614 #define LOBYTE(w)               ((BYTE)(w))
615 #define MAKEWORD(low,hi)        ((WORD)(((BYTE    615 #define MAKEWORD(low,hi)        ((WORD)(((BYTE)(low))|(((WORD)((BYTE)(hi)))<<8)))
616 X                                                 616 X
617 typedef __u8                    BYTE;             617 typedef __u8                    BYTE;
618 typedef __u16                   USHORT;           618 typedef __u16                   USHORT;
619 typedef __u16                   WORD;             619 typedef __u16                   WORD;
620 X                                                 620 X
621 static int config_port = -1;                      621 static int config_port = -1;
622 X                                                 622 X
623 static int msnd_write_cfg(int cfg, int reg, in    623 static int msnd_write_cfg(int cfg, int reg, int value)
624 {                                                 624 {
625 X       outb(reg, cfg);                           625 X       outb(reg, cfg);
626 X       outb(value, cfg + 1);                     626 X       outb(value, cfg + 1);
627 X       if (value != inb(cfg + 1)) {              627 X       if (value != inb(cfg + 1)) {
628 X               fprintf(stderr, "error: msnd_w    628 X               fprintf(stderr, "error: msnd_write_cfg: I/O error\n");
629 X               return -EIO;                      629 X               return -EIO;
630 X       }                                         630 X       }
631 X       return 0;                                 631 X       return 0;
632 }                                                 632 }
633 X                                                 633 X
634 static int msnd_read_cfg(int cfg, int reg)        634 static int msnd_read_cfg(int cfg, int reg)
635 {                                                 635 {
636 X       outb(reg, cfg);                           636 X       outb(reg, cfg);
637 X       return inb(cfg + 1);                      637 X       return inb(cfg + 1);
638 }                                                 638 }
639 X                                                 639 X
640 static int msnd_write_cfg_io0(int cfg, int num    640 static int msnd_write_cfg_io0(int cfg, int num, WORD io)
641 {                                                 641 {
642 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    642 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
643 X               return -EIO;                      643 X               return -EIO;
644 X       if (msnd_write_cfg(cfg, IREG_IO0_BASEH    644 X       if (msnd_write_cfg(cfg, IREG_IO0_BASEHI, HIBYTE(io)))
645 X               return -EIO;                      645 X               return -EIO;
646 X       if (msnd_write_cfg(cfg, IREG_IO0_BASEL    646 X       if (msnd_write_cfg(cfg, IREG_IO0_BASELO, LOBYTE(io)))
647 X               return -EIO;                      647 X               return -EIO;
648 X       return 0;                                 648 X       return 0;
649 }                                                 649 }
650 X                                                 650 X
651 static int msnd_read_cfg_io0(int cfg, int num,    651 static int msnd_read_cfg_io0(int cfg, int num, WORD *io)
652 {                                                 652 {
653 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    653 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
654 X               return -EIO;                      654 X               return -EIO;
655 X                                                 655 X
656 X       *io = MAKEWORD(msnd_read_cfg(cfg, IREG    656 X       *io = MAKEWORD(msnd_read_cfg(cfg, IREG_IO0_BASELO),
657 X                      msnd_read_cfg(cfg, IREG    657 X                      msnd_read_cfg(cfg, IREG_IO0_BASEHI));
658 X                                                 658 X
659 X       return 0;                                 659 X       return 0;
660 }                                                 660 }
661 X                                                 661 X
662 static int msnd_write_cfg_io1(int cfg, int num    662 static int msnd_write_cfg_io1(int cfg, int num, WORD io)
663 {                                                 663 {
664 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    664 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
665 X               return -EIO;                      665 X               return -EIO;
666 X       if (msnd_write_cfg(cfg, IREG_IO1_BASEH    666 X       if (msnd_write_cfg(cfg, IREG_IO1_BASEHI, HIBYTE(io)))
667 X               return -EIO;                      667 X               return -EIO;
668 X       if (msnd_write_cfg(cfg, IREG_IO1_BASEL    668 X       if (msnd_write_cfg(cfg, IREG_IO1_BASELO, LOBYTE(io)))
669 X               return -EIO;                      669 X               return -EIO;
670 X       return 0;                                 670 X       return 0;
671 }                                                 671 }
672 X                                                 672 X
673 static int msnd_read_cfg_io1(int cfg, int num,    673 static int msnd_read_cfg_io1(int cfg, int num, WORD *io)
674 {                                                 674 {
675 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    675 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
676 X               return -EIO;                      676 X               return -EIO;
677 X                                                 677 X
678 X       *io = MAKEWORD(msnd_read_cfg(cfg, IREG    678 X       *io = MAKEWORD(msnd_read_cfg(cfg, IREG_IO1_BASELO),
679 X                      msnd_read_cfg(cfg, IREG    679 X                      msnd_read_cfg(cfg, IREG_IO1_BASEHI));
680 X                                                 680 X
681 X       return 0;                                 681 X       return 0;
682 }                                                 682 }
683 X                                                 683 X
684 static int msnd_write_cfg_irq(int cfg, int num    684 static int msnd_write_cfg_irq(int cfg, int num, WORD irq)
685 {                                                 685 {
686 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    686 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
687 X               return -EIO;                      687 X               return -EIO;
688 X       if (msnd_write_cfg(cfg, IREG_IRQ_NUMBE    688 X       if (msnd_write_cfg(cfg, IREG_IRQ_NUMBER, LOBYTE(irq)))
689 X               return -EIO;                      689 X               return -EIO;
690 X       if (msnd_write_cfg(cfg, IREG_IRQ_TYPE,    690 X       if (msnd_write_cfg(cfg, IREG_IRQ_TYPE, IRQTYPE_EDGE))
691 X               return -EIO;                      691 X               return -EIO;
692 X       return 0;                                 692 X       return 0;
693 }                                                 693 }
694 X                                                 694 X
695 static int msnd_read_cfg_irq(int cfg, int num,    695 static int msnd_read_cfg_irq(int cfg, int num, WORD *irq)
696 {                                                 696 {
697 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    697 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
698 X               return -EIO;                      698 X               return -EIO;
699 X                                                 699 X
700 X       *irq = msnd_read_cfg(cfg, IREG_IRQ_NUM    700 X       *irq = msnd_read_cfg(cfg, IREG_IRQ_NUMBER);
701 X                                                 701 X
702 X       return 0;                                 702 X       return 0;
703 }                                                 703 }
704 X                                                 704 X
705 static int msnd_write_cfg_mem(int cfg, int num    705 static int msnd_write_cfg_mem(int cfg, int num, int mem)
706 {                                                 706 {
707 X       WORD wmem;                                707 X       WORD wmem;
708 X                                                 708 X
709 X       mem >>= 8;                                709 X       mem >>= 8;
710 X       mem &= 0xfff;                             710 X       mem &= 0xfff;
711 X       wmem = (WORD)mem;                         711 X       wmem = (WORD)mem;
712 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    712 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
713 X               return -EIO;                      713 X               return -EIO;
714 X       if (msnd_write_cfg(cfg, IREG_MEMBASEHI    714 X       if (msnd_write_cfg(cfg, IREG_MEMBASEHI, HIBYTE(wmem)))
715 X               return -EIO;                      715 X               return -EIO;
716 X       if (msnd_write_cfg(cfg, IREG_MEMBASELO    716 X       if (msnd_write_cfg(cfg, IREG_MEMBASELO, LOBYTE(wmem)))
717 X               return -EIO;                      717 X               return -EIO;
718 X       if (wmem && msnd_write_cfg(cfg, IREG_M    718 X       if (wmem && msnd_write_cfg(cfg, IREG_MEMCONTROL, (MEMTYPE_HIADDR | MEMTYPE_16BIT)))
719 X               return -EIO;                      719 X               return -EIO;
720 X       return 0;                                 720 X       return 0;
721 }                                                 721 }
722 X                                                 722 X
723 static int msnd_read_cfg_mem(int cfg, int num,    723 static int msnd_read_cfg_mem(int cfg, int num, int *mem)
724 {                                                 724 {
725 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    725 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
726 X               return -EIO;                      726 X               return -EIO;
727 X                                                 727 X
728 X       *mem = MAKEWORD(msnd_read_cfg(cfg, IRE    728 X       *mem = MAKEWORD(msnd_read_cfg(cfg, IREG_MEMBASELO),
729 X                       msnd_read_cfg(cfg, IRE    729 X                       msnd_read_cfg(cfg, IREG_MEMBASEHI));
730 X       *mem <<= 8;                               730 X       *mem <<= 8;
731 X                                                 731 X
732 X       return 0;                                 732 X       return 0;
733 }                                                 733 }
734 X                                                 734 X
735 static int msnd_activate_logical(int cfg, int     735 static int msnd_activate_logical(int cfg, int num)
736 {                                                 736 {
737 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    737 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
738 X               return -EIO;                      738 X               return -EIO;
739 X       if (msnd_write_cfg(cfg, IREG_ACTIVATE,    739 X       if (msnd_write_cfg(cfg, IREG_ACTIVATE, LD_ACTIVATE))
740 X               return -EIO;                      740 X               return -EIO;
741 X       return 0;                                 741 X       return 0;
742 }                                                 742 }
743 X                                                 743 X
744 static int msnd_write_cfg_logical(int cfg, int    744 static int msnd_write_cfg_logical(int cfg, int num, WORD io0, WORD io1, WORD irq, int mem)
745 {                                                 745 {
746 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    746 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
747 X               return -EIO;                      747 X               return -EIO;
748 X       if (msnd_write_cfg_io0(cfg, num, io0))    748 X       if (msnd_write_cfg_io0(cfg, num, io0))
749 X               return -EIO;                      749 X               return -EIO;
750 X       if (msnd_write_cfg_io1(cfg, num, io1))    750 X       if (msnd_write_cfg_io1(cfg, num, io1))
751 X               return -EIO;                      751 X               return -EIO;
752 X       if (msnd_write_cfg_irq(cfg, num, irq))    752 X       if (msnd_write_cfg_irq(cfg, num, irq))
753 X               return -EIO;                      753 X               return -EIO;
754 X       if (msnd_write_cfg_mem(cfg, num, mem))    754 X       if (msnd_write_cfg_mem(cfg, num, mem))
755 X               return -EIO;                      755 X               return -EIO;
756 X       if (msnd_activate_logical(cfg, num))      756 X       if (msnd_activate_logical(cfg, num))
757 X               return -EIO;                      757 X               return -EIO;
758 X       return 0;                                 758 X       return 0;
759 }                                                 759 }
760 X                                                 760 X
761 static int msnd_read_cfg_logical(int cfg, int     761 static int msnd_read_cfg_logical(int cfg, int num, WORD *io0, WORD *io1, WORD *irq, int *mem)
762 {                                                 762 {
763 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE    763 X       if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
764 X               return -EIO;                      764 X               return -EIO;
765 X       if (msnd_read_cfg_io0(cfg, num, io0))     765 X       if (msnd_read_cfg_io0(cfg, num, io0))
766 X               return -EIO;                      766 X               return -EIO;
767 X       if (msnd_read_cfg_io1(cfg, num, io1))     767 X       if (msnd_read_cfg_io1(cfg, num, io1))
768 X               return -EIO;                      768 X               return -EIO;
769 X       if (msnd_read_cfg_irq(cfg, num, irq))     769 X       if (msnd_read_cfg_irq(cfg, num, irq))
770 X               return -EIO;                      770 X               return -EIO;
771 X       if (msnd_read_cfg_mem(cfg, num, mem))     771 X       if (msnd_read_cfg_mem(cfg, num, mem))
772 X               return -EIO;                      772 X               return -EIO;
773 X       return 0;                                 773 X       return 0;
774 }                                                 774 }
775 X                                                 775 X
776 static void usage(void)                           776 static void usage(void)
777 {                                                 777 {
778 X       fprintf(stderr,                           778 X       fprintf(stderr,
779 X               "\n"                              779 X               "\n"
780 X               "pinnaclecfg 1.0\n"               780 X               "pinnaclecfg 1.0\n"
781 X               "\n"                              781 X               "\n"
782 X               "usage: pinnaclecfg <config po    782 X               "usage: pinnaclecfg <config port> [device config]\n"
783 X               "\n"                              783 X               "\n"
784 X               "This is for use with the card    784 X               "This is for use with the card in NON-PnP mode only.\n"
785 X               "\n"                              785 X               "\n"
786 X               "Available devices (not all av    786 X               "Available devices (not all available for Fiji):\n"
787 X               "\n"                              787 X               "\n"
788 X               "        Device                   788 X               "        Device                       Description\n"
789 X               "        ---------------------    789 X               "        -------------------------------------------------------------------\n"
790 X               "        reset                    790 X               "        reset                        Reset all devices (i.e. disable)\n"
791 X               "        show                     791 X               "        show                         Display current device configurations\n"
792 X               "\n"                              792 X               "\n"
793 X               "        dsp <io> <irq> <mem>     793 X               "        dsp <io> <irq> <mem>         Audio device\n"
794 X               "        mpu <io> <irq>           794 X               "        mpu <io> <irq>               Internal Kurzweil synth\n"
795 X               "        ide <io0> <io1> <irq>    795 X               "        ide <io0> <io1> <irq>        On-board IDE controller\n"
796 X               "        joystick <io>            796 X               "        joystick <io>                Joystick port\n"
797 X               "\n");                            797 X               "\n");
798 X       exit(1);                                  798 X       exit(1);
799 }                                                 799 }
800 X                                                 800 X
801 static int cfg_reset(void)                        801 static int cfg_reset(void)
802 {                                                 802 {
803 X       int i;                                    803 X       int i;
804 X                                                 804 X
805 X       for (i = 0; i < 4; ++i)                   805 X       for (i = 0; i < 4; ++i)
806 X               msnd_write_cfg_logical(config_    806 X               msnd_write_cfg_logical(config_port, i, 0, 0, 0, 0);
807 X                                                 807 X
808 X       return 0;                                 808 X       return 0;
809 }                                                 809 }
810 X                                                 810 X
811 static int cfg_show(void)                         811 static int cfg_show(void)
812 {                                                 812 {
813 X       int i;                                    813 X       int i;
814 X       int count = 0;                            814 X       int count = 0;
815 X                                                 815 X
816 X       for (i = 0; i < 4; ++i) {                 816 X       for (i = 0; i < 4; ++i) {
817 X               WORD io0, io1, irq;               817 X               WORD io0, io1, irq;
818 X               int mem;                          818 X               int mem;
819 X               msnd_read_cfg_logical(config_p    819 X               msnd_read_cfg_logical(config_port, i, &io0, &io1, &irq, &mem);
820 X               switch (i) {                      820 X               switch (i) {
821 X               case 0:                           821 X               case 0:
822 X                       if (io0 || irq || mem)    822 X                       if (io0 || irq || mem) {
823 X                               printf("dsp 0x    823 X                               printf("dsp 0x%x %d 0x%x\n", io0, irq, mem);
824 X                               ++count;          824 X                               ++count;
825 X                       }                         825 X                       }
826 X                       break;                    826 X                       break;
827 X               case 1:                           827 X               case 1:
828 X                       if (io0 || irq) {         828 X                       if (io0 || irq) {
829 X                               printf("mpu 0x    829 X                               printf("mpu 0x%x %d\n", io0, irq);
830 X                               ++count;          830 X                               ++count;
831 X                       }                         831 X                       }
832 X                       break;                    832 X                       break;
833 X               case 2:                           833 X               case 2:
834 X                       if (io0 || io1 || irq)    834 X                       if (io0 || io1 || irq) {
835 X                               printf("ide 0x    835 X                               printf("ide 0x%x 0x%x %d\n", io0, io1, irq);
836 X                               ++count;          836 X                               ++count;
837 X                       }                         837 X                       }
838 X                       break;                    838 X                       break;
839 X               case 3:                           839 X               case 3:
840 X                       if (io0) {                840 X                       if (io0) {
841 X                               printf("joysti    841 X                               printf("joystick 0x%x\n", io0);
842 X                               ++count;          842 X                               ++count;
843 X                       }                         843 X                       }
844 X                       break;                    844 X                       break;
845 X               }                                 845 X               }
846 X       }                                         846 X       }
847 X                                                 847 X
848 X       if (count == 0)                           848 X       if (count == 0)
849 X               fprintf(stderr, "no devices co    849 X               fprintf(stderr, "no devices configured\n");
850 X                                                 850 X
851 X       return 0;                                 851 X       return 0;
852 }                                                 852 }
853 X                                                 853 X
854 static int cfg_dsp(int argc, char *argv[])        854 static int cfg_dsp(int argc, char *argv[])
855 {                                                 855 {
856 X       int io, irq, mem;                         856 X       int io, irq, mem;
857 X                                                 857 X
858 X       if (argc < 3 ||                           858 X       if (argc < 3 ||
859 X           sscanf(argv[0], "0x%x", &io) != 1     859 X           sscanf(argv[0], "0x%x", &io) != 1 ||
860 X           sscanf(argv[1], "%d", &irq) != 1 |    860 X           sscanf(argv[1], "%d", &irq) != 1 ||
861 X           sscanf(argv[2], "0x%x", &mem) != 1    861 X           sscanf(argv[2], "0x%x", &mem) != 1)
862 X               usage();                          862 X               usage();
863 X                                                 863 X
864 X       if (!(io == 0x290 ||                      864 X       if (!(io == 0x290 ||
865 X             io == 0x260 ||                      865 X             io == 0x260 ||
866 X             io == 0x250 ||                      866 X             io == 0x250 ||
867 X             io == 0x240 ||                      867 X             io == 0x240 ||
868 X             io == 0x230 ||                      868 X             io == 0x230 ||
869 X             io == 0x220 ||                      869 X             io == 0x220 ||
870 X             io == 0x210 ||                      870 X             io == 0x210 ||
871 X             io == 0x3e0)) {                     871 X             io == 0x3e0)) {
872 X               fprintf(stderr, "error: io mus    872 X               fprintf(stderr, "error: io must be one of "
873 X                       "210, 220, 230, 240, 2    873 X                       "210, 220, 230, 240, 250, 260, 290, or 3E0\n");
874 X               usage();                          874 X               usage();
875 X       }                                         875 X       }
876 X                                                 876 X
877 X       if (!(irq == 5 ||                         877 X       if (!(irq == 5 ||
878 X             irq == 7 ||                         878 X             irq == 7 ||
879 X             irq == 9 ||                         879 X             irq == 9 ||
880 X             irq == 10 ||                        880 X             irq == 10 ||
881 X             irq == 11 ||                        881 X             irq == 11 ||
882 X             irq == 12)) {                       882 X             irq == 12)) {
883 X               fprintf(stderr, "error: irq mu    883 X               fprintf(stderr, "error: irq must be one of "
884 X                       "5, 7, 9, 10, 11 or 12    884 X                       "5, 7, 9, 10, 11 or 12\n");
885 X               usage();                          885 X               usage();
886 X       }                                         886 X       }
887 X                                                 887 X
888 X       if (!(mem == 0xb0000 ||                   888 X       if (!(mem == 0xb0000 ||
889 X             mem == 0xc8000 ||                   889 X             mem == 0xc8000 ||
890 X             mem == 0xd0000 ||                   890 X             mem == 0xd0000 ||
891 X             mem == 0xd8000 ||                   891 X             mem == 0xd8000 ||
892 X             mem == 0xe0000 ||                   892 X             mem == 0xe0000 ||
893 X             mem == 0xe8000)) {                  893 X             mem == 0xe8000)) {
894 X               fprintf(stderr, "error: mem mu    894 X               fprintf(stderr, "error: mem must be one of "
895 X                       "0xb0000, 0xc8000, 0xd    895 X                       "0xb0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000 or 0xe8000\n");
896 X               usage();                          896 X               usage();
897 X       }                                         897 X       }
898 X                                                 898 X
899 X       return msnd_write_cfg_logical(config_p    899 X       return msnd_write_cfg_logical(config_port, 0, io, 0, irq, mem);
900 }                                                 900 }
901 X                                                 901 X
902 static int cfg_mpu(int argc, char *argv[])        902 static int cfg_mpu(int argc, char *argv[])
903 {                                                 903 {
904 X       int io, irq;                              904 X       int io, irq;
905 X                                                 905 X
906 X       if (argc < 2 ||                           906 X       if (argc < 2 ||
907 X           sscanf(argv[0], "0x%x", &io) != 1     907 X           sscanf(argv[0], "0x%x", &io) != 1 ||
908 X           sscanf(argv[1], "%d", &irq) != 1)     908 X           sscanf(argv[1], "%d", &irq) != 1)
909 X               usage();                          909 X               usage();
910 X                                                 910 X
911 X       return msnd_write_cfg_logical(config_p    911 X       return msnd_write_cfg_logical(config_port, 1, io, 0, irq, 0);
912 }                                                 912 }
913 X                                                 913 X
914 static int cfg_ide(int argc, char *argv[])        914 static int cfg_ide(int argc, char *argv[])
915 {                                                 915 {
916 X       int io0, io1, irq;                        916 X       int io0, io1, irq;
917 X                                                 917 X
918 X       if (argc < 3 ||                           918 X       if (argc < 3 ||
919 X           sscanf(argv[0], "0x%x", &io0) != 1    919 X           sscanf(argv[0], "0x%x", &io0) != 1 ||
920 X           sscanf(argv[0], "0x%x", &io1) != 1    920 X           sscanf(argv[0], "0x%x", &io1) != 1 ||
921 X           sscanf(argv[1], "%d", &irq) != 1)     921 X           sscanf(argv[1], "%d", &irq) != 1)
922 X               usage();                          922 X               usage();
923 X                                                 923 X
924 X       return msnd_write_cfg_logical(config_p    924 X       return msnd_write_cfg_logical(config_port, 2, io0, io1, irq, 0);
925 }                                                 925 }
926 X                                                 926 X
927 static int cfg_joystick(int argc, char *argv[]    927 static int cfg_joystick(int argc, char *argv[])
928 {                                                 928 {
929 X       int io;                                   929 X       int io;
930 X                                                 930 X
931 X       if (argc < 1 ||                           931 X       if (argc < 1 ||
932 X           sscanf(argv[0], "0x%x", &io) != 1)    932 X           sscanf(argv[0], "0x%x", &io) != 1)
933 X               usage();                          933 X               usage();
934 X                                                 934 X
935 X       return msnd_write_cfg_logical(config_p    935 X       return msnd_write_cfg_logical(config_port, 3, io, 0, 0, 0);
936 }                                                 936 }
937 X                                                 937 X
938 int main(int argc, char *argv[])                  938 int main(int argc, char *argv[])
939 {                                                 939 {
940 X       char *device;                             940 X       char *device;
941 X       int rv = 0;                               941 X       int rv = 0;
942 X                                                 942 X
943 X       --argc; ++argv;                           943 X       --argc; ++argv;
944 X                                                 944 X
945 X       if (argc < 2)                             945 X       if (argc < 2)
946 X               usage();                          946 X               usage();
947 X                                                 947 X
948 X       sscanf(argv[0], "0x%x", &config_port);    948 X       sscanf(argv[0], "0x%x", &config_port);
949 X       if (config_port != 0x250 && config_por    949 X       if (config_port != 0x250 && config_port != 0x260 && config_port != 0x270) {
950 X               fprintf(stderr, "error: <confi    950 X               fprintf(stderr, "error: <config port> must be 0x250, 0x260 or 0x270\n");
951 X               exit(1);                          951 X               exit(1);
952 X       }                                         952 X       }
953 X       if (ioperm(config_port, 2, 1)) {          953 X       if (ioperm(config_port, 2, 1)) {
954 X               perror("ioperm");                 954 X               perror("ioperm");
955 X               fprintf(stderr, "note: pinnacl    955 X               fprintf(stderr, "note: pinnaclecfg must be run as root\n");
956 X               exit(1);                          956 X               exit(1);
957 X       }                                         957 X       }
958 X       device = argv[1];                         958 X       device = argv[1];
959 X                                                 959 X
960 X       argc -= 2; argv += 2;                     960 X       argc -= 2; argv += 2;
961 X                                                 961 X
962 X       if (strcmp(device, "reset") == 0)         962 X       if (strcmp(device, "reset") == 0)
963 X               rv = cfg_reset();                 963 X               rv = cfg_reset();
964 X       else if (strcmp(device, "show") == 0)     964 X       else if (strcmp(device, "show") == 0)
965 X               rv = cfg_show();                  965 X               rv = cfg_show();
966 X       else if (strcmp(device, "dsp") == 0)      966 X       else if (strcmp(device, "dsp") == 0)
967 X               rv = cfg_dsp(argc, argv);         967 X               rv = cfg_dsp(argc, argv);
968 X       else if (strcmp(device, "mpu") == 0)      968 X       else if (strcmp(device, "mpu") == 0)
969 X               rv = cfg_mpu(argc, argv);         969 X               rv = cfg_mpu(argc, argv);
970 X       else if (strcmp(device, "ide") == 0)      970 X       else if (strcmp(device, "ide") == 0)
971 X               rv = cfg_ide(argc, argv);         971 X               rv = cfg_ide(argc, argv);
972 X       else if (strcmp(device, "joystick") ==    972 X       else if (strcmp(device, "joystick") == 0)
973 X               rv = cfg_joystick(argc, argv);    973 X               rv = cfg_joystick(argc, argv);
974 X       else {                                    974 X       else {
975 X               fprintf(stderr, "error: unknow    975 X               fprintf(stderr, "error: unknown device %s\n", device);
976 X               usage();                          976 X               usage();
977 X       }                                         977 X       }
978 X                                                 978 X
979 X       if (rv)                                   979 X       if (rv)
980 X               fprintf(stderr, "error: device    980 X               fprintf(stderr, "error: device configuration failed\n");
981 X                                                 981 X
982 X       return 0;                                 982 X       return 0;
983 }                                                 983 }
984 SHAR_EOF                                          984 SHAR_EOF
985   $shar_touch -am 1204092598 'MultiSound.d/pin    985   $shar_touch -am 1204092598 'MultiSound.d/pinnaclecfg.c' &&
986   chmod 0664 'MultiSound.d/pinnaclecfg.c' ||      986   chmod 0664 'MultiSound.d/pinnaclecfg.c' ||
987   $echo 'restore of' 'MultiSound.d/pinnaclecfg    987   $echo 'restore of' 'MultiSound.d/pinnaclecfg.c' 'failed'
988   if ( md5sum --help 2>&1 | grep 'sage: md5sum    988   if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
989   && ( md5sum --version 2>&1 | grep -v 'textut    989   && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
990     md5sum -c << SHAR_EOF >/dev/null 2>&1 \       990     md5sum -c << SHAR_EOF >/dev/null 2>&1 \
991     || $echo 'MultiSound.d/pinnaclecfg.c:' 'MD    991     || $echo 'MultiSound.d/pinnaclecfg.c:' 'MD5 check failed'
992 366bdf27f0db767a3c7921d0a6db20fe  MultiSound.d    992 366bdf27f0db767a3c7921d0a6db20fe  MultiSound.d/pinnaclecfg.c
993 SHAR_EOF                                          993 SHAR_EOF
994   else                                            994   else
995     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c    995     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/pinnaclecfg.c'`"
996     test 10224 -eq "$shar_count" ||               996     test 10224 -eq "$shar_count" ||
997     $echo 'MultiSound.d/pinnaclecfg.c:' 'origi    997     $echo 'MultiSound.d/pinnaclecfg.c:' 'original size' '10224,' 'current size' "$shar_count!"
998   fi                                              998   fi
999 fi                                                999 fi
1000 # ============= MultiSound.d/Makefile =======    1000 # ============= MultiSound.d/Makefile ==============
1001 if test -f 'MultiSound.d/Makefile' && test "$    1001 if test -f 'MultiSound.d/Makefile' && test "$first_param" != -c; then
1002   $echo 'x -' SKIPPING 'MultiSound.d/Makefile    1002   $echo 'x -' SKIPPING 'MultiSound.d/Makefile' '(file already exists)'
1003 else                                             1003 else
1004   $echo 'x -' extracting 'MultiSound.d/Makefi    1004   $echo 'x -' extracting 'MultiSound.d/Makefile' '(text)'
1005   sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/    1005   sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/Makefile' &&
1006 CC      = gcc                                    1006 CC      = gcc
1007 CFLAGS  = -O                                     1007 CFLAGS  = -O
1008 PROGS   = setdigital msndreset pinnaclecfg co    1008 PROGS   = setdigital msndreset pinnaclecfg conv
1009 X                                                1009 X
1010 all: $(PROGS)                                    1010 all: $(PROGS)
1011 X                                                1011 X
1012 clean:                                           1012 clean:
1013 X       rm -f $(PROGS)                           1013 X       rm -f $(PROGS)
1014 SHAR_EOF                                         1014 SHAR_EOF
1015   $shar_touch -am 1204092398 'MultiSound.d/Ma    1015   $shar_touch -am 1204092398 'MultiSound.d/Makefile' &&
1016   chmod 0664 'MultiSound.d/Makefile' ||          1016   chmod 0664 'MultiSound.d/Makefile' ||
1017   $echo 'restore of' 'MultiSound.d/Makefile'     1017   $echo 'restore of' 'MultiSound.d/Makefile' 'failed'
1018   if ( md5sum --help 2>&1 | grep 'sage: md5su    1018   if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
1019   && ( md5sum --version 2>&1 | grep -v 'textu    1019   && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
1020     md5sum -c << SHAR_EOF >/dev/null 2>&1 \      1020     md5sum -c << SHAR_EOF >/dev/null 2>&1 \
1021     || $echo 'MultiSound.d/Makefile:' 'MD5 ch    1021     || $echo 'MultiSound.d/Makefile:' 'MD5 check failed'
1022 76ca8bb44e3882edcf79c97df6c81845  MultiSound.    1022 76ca8bb44e3882edcf79c97df6c81845  MultiSound.d/Makefile
1023 SHAR_EOF                                         1023 SHAR_EOF
1024   else                                           1024   else
1025     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -    1025     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/Makefile'`"
1026     test 106 -eq "$shar_count" ||                1026     test 106 -eq "$shar_count" ||
1027     $echo 'MultiSound.d/Makefile:' 'original     1027     $echo 'MultiSound.d/Makefile:' 'original size' '106,' 'current size' "$shar_count!"
1028   fi                                             1028   fi
1029 fi                                               1029 fi
1030 # ============= MultiSound.d/conv.l =========    1030 # ============= MultiSound.d/conv.l ==============
1031 if test -f 'MultiSound.d/conv.l' && test "$fi    1031 if test -f 'MultiSound.d/conv.l' && test "$first_param" != -c; then
1032   $echo 'x -' SKIPPING 'MultiSound.d/conv.l'     1032   $echo 'x -' SKIPPING 'MultiSound.d/conv.l' '(file already exists)'
1033 else                                             1033 else
1034   $echo 'x -' extracting 'MultiSound.d/conv.l    1034   $echo 'x -' extracting 'MultiSound.d/conv.l' '(text)'
1035   sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/    1035   sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/conv.l' &&
1036 %%                                               1036 %%
1037 [ \n\t,\r]                                       1037 [ \n\t,\r]
1038 \;.*                                             1038 \;.*
1039 DB                                               1039 DB
1040 [0-9A-Fa-f]+H   { int n; sscanf(yytext, "%xH"    1040 [0-9A-Fa-f]+H   { int n; sscanf(yytext, "%xH", &n); printf("%c", n); }
1041 %%                                               1041 %%
1042 int yywrap() { return 1; }                       1042 int yywrap() { return 1; }
1043 void main() { yylex(); }                         1043 void main() { yylex(); }
1044 SHAR_EOF                                         1044 SHAR_EOF
1045   $shar_touch -am 0828231798 'MultiSound.d/co    1045   $shar_touch -am 0828231798 'MultiSound.d/conv.l' &&
1046   chmod 0664 'MultiSound.d/conv.l' ||            1046   chmod 0664 'MultiSound.d/conv.l' ||
1047   $echo 'restore of' 'MultiSound.d/conv.l' 'f    1047   $echo 'restore of' 'MultiSound.d/conv.l' 'failed'
1048   if ( md5sum --help 2>&1 | grep 'sage: md5su    1048   if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
1049   && ( md5sum --version 2>&1 | grep -v 'textu    1049   && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
1050     md5sum -c << SHAR_EOF >/dev/null 2>&1 \      1050     md5sum -c << SHAR_EOF >/dev/null 2>&1 \
1051     || $echo 'MultiSound.d/conv.l:' 'MD5 chec    1051     || $echo 'MultiSound.d/conv.l:' 'MD5 check failed'
1052 d2411fc32cd71a00dcdc1f009e858dd2  MultiSound.    1052 d2411fc32cd71a00dcdc1f009e858dd2  MultiSound.d/conv.l
1053 SHAR_EOF                                         1053 SHAR_EOF
1054   else                                           1054   else
1055     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -    1055     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/conv.l'`"
1056     test 146 -eq "$shar_count" ||                1056     test 146 -eq "$shar_count" ||
1057     $echo 'MultiSound.d/conv.l:' 'original si    1057     $echo 'MultiSound.d/conv.l:' 'original size' '146,' 'current size' "$shar_count!"
1058   fi                                             1058   fi
1059 fi                                               1059 fi
1060 # ============= MultiSound.d/msndreset.c ====    1060 # ============= MultiSound.d/msndreset.c ==============
1061 if test -f 'MultiSound.d/msndreset.c' && test    1061 if test -f 'MultiSound.d/msndreset.c' && test "$first_param" != -c; then
1062   $echo 'x -' SKIPPING 'MultiSound.d/msndrese    1062   $echo 'x -' SKIPPING 'MultiSound.d/msndreset.c' '(file already exists)'
1063 else                                             1063 else
1064   $echo 'x -' extracting 'MultiSound.d/msndre    1064   $echo 'x -' extracting 'MultiSound.d/msndreset.c' '(text)'
1065   sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/    1065   sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/msndreset.c' &&
1066 /********************************************    1066 /*********************************************************************
1067 X *                                              1067 X *
1068 X * msndreset.c - resets the MultiSound card     1068 X * msndreset.c - resets the MultiSound card
1069 X *                                              1069 X *
1070 X * Copyright (C) 1998 Andrew Veliath            1070 X * Copyright (C) 1998 Andrew Veliath
1071 X *                                              1071 X *
1072 X * This program is free software; you can re    1072 X * This program is free software; you can redistribute it and/or modify
1073 X * it under the terms of the GNU General Pub    1073 X * it under the terms of the GNU General Public License as published by
1074 X * the Free Software Foundation; either vers    1074 X * the Free Software Foundation; either version 2 of the License, or
1075 X * (at your option) any later version.          1075 X * (at your option) any later version.
1076 X *                                              1076 X *
1077 X * This program is distributed in the hope t    1077 X * This program is distributed in the hope that it will be useful,
1078 X * but WITHOUT ANY WARRANTY; without even th    1078 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
1079 X * MERCHANTABILITY or FITNESS FOR A PARTICUL    1079 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1080 X * GNU General Public License for more detai    1080 X * GNU General Public License for more details.
1081 X *                                              1081 X *
1082 X * You should have received a copy of the GN    1082 X * You should have received a copy of the GNU General Public License
1083 X * along with this program; if not, write to    1083 X * along with this program; if not, write to the Free Software
1084 X * Foundation, Inc., 675 Mass Ave, Cambridge    1084 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1085 X *                                              1085 X *
1086 X *******************************************    1086 X ********************************************************************/
1087 X                                                1087 X
1088 #include <stdio.h>                               1088 #include <stdio.h>
1089 #include <stdlib.h>                              1089 #include <stdlib.h>
1090 #include <unistd.h>                              1090 #include <unistd.h>
1091 #include <fcntl.h>                               1091 #include <fcntl.h>
1092 #include <sys/types.h>                           1092 #include <sys/types.h>
1093 #include <sys/stat.h>                            1093 #include <sys/stat.h>
1094 #include <sys/ioctl.h>                           1094 #include <sys/ioctl.h>
1095 #include <sys/soundcard.h>                       1095 #include <sys/soundcard.h>
1096 X                                                1096 X
1097 int main(int argc, char *argv[])                 1097 int main(int argc, char *argv[])
1098 {                                                1098 {
1099 X       int fd;                                  1099 X       int fd;
1100 X                                                1100 X
1101 X       if (argc != 2) {                         1101 X       if (argc != 2) {
1102 X               fprintf(stderr, "usage: msndr    1102 X               fprintf(stderr, "usage: msndreset <mixer device>\n");
1103 X               exit(1);                         1103 X               exit(1);
1104 X       }                                        1104 X       }
1105 X                                                1105 X
1106 X       if ((fd = open(argv[1], O_RDWR)) < 0)    1106 X       if ((fd = open(argv[1], O_RDWR)) < 0) {
1107 X               perror(argv[1]);                 1107 X               perror(argv[1]);
1108 X               exit(1);                         1108 X               exit(1);
1109 X       }                                        1109 X       }
1110 X                                                1110 X
1111 X       if (ioctl(fd, SOUND_MIXER_PRIVATE1, 0    1111 X       if (ioctl(fd, SOUND_MIXER_PRIVATE1, 0) < 0) {
1112 X               fprintf(stderr, "error: msnd     1112 X               fprintf(stderr, "error: msnd ioctl reset failed\n");
1113 X               perror("ioctl");                 1113 X               perror("ioctl");
1114 X               close(fd);                       1114 X               close(fd);
1115 X               exit(1);                         1115 X               exit(1);
1116 X       }                                        1116 X       }
1117 X                                                1117 X
1118 X       close(fd);                               1118 X       close(fd);
1119 X                                                1119 X
1120 X       return 0;                                1120 X       return 0;
1121 }                                                1121 }
1122 SHAR_EOF                                         1122 SHAR_EOF
1123   $shar_touch -am 1204100698 'MultiSound.d/ms    1123   $shar_touch -am 1204100698 'MultiSound.d/msndreset.c' &&
1124   chmod 0664 'MultiSound.d/msndreset.c' ||       1124   chmod 0664 'MultiSound.d/msndreset.c' ||
1125   $echo 'restore of' 'MultiSound.d/msndreset.    1125   $echo 'restore of' 'MultiSound.d/msndreset.c' 'failed'
1126   if ( md5sum --help 2>&1 | grep 'sage: md5su    1126   if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
1127   && ( md5sum --version 2>&1 | grep -v 'textu    1127   && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
1128     md5sum -c << SHAR_EOF >/dev/null 2>&1 \      1128     md5sum -c << SHAR_EOF >/dev/null 2>&1 \
1129     || $echo 'MultiSound.d/msndreset.c:' 'MD5    1129     || $echo 'MultiSound.d/msndreset.c:' 'MD5 check failed'
1130 c52f876521084e8eb25e12e01dcccb8a  MultiSound.    1130 c52f876521084e8eb25e12e01dcccb8a  MultiSound.d/msndreset.c
1131 SHAR_EOF                                         1131 SHAR_EOF
1132   else                                           1132   else
1133     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -    1133     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/msndreset.c'`"
1134     test 1491 -eq "$shar_count" ||               1134     test 1491 -eq "$shar_count" ||
1135     $echo 'MultiSound.d/msndreset.c:' 'origin    1135     $echo 'MultiSound.d/msndreset.c:' 'original size' '1491,' 'current size' "$shar_count!"
1136   fi                                             1136   fi
1137 fi                                               1137 fi
1138 rm -fr _sh01426                                  1138 rm -fr _sh01426
1139 exit 0                                           1139 exit 0
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php