Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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