Gravis Ultrasound Plug & Play Setup

Last modified: Mon Feb 3 21:14:20 EST 2014

As observed in Custom/Manual Setup with Version 1.0 board and Version 2.2 drivers from PNPV22B.ZIP.

Defaults  My settings

End of IW.INI (as resulting from manual setup)

[setup 0]
SynthBase=220
CodecBase=32C
CDBase=0
ATAPIBase=0
MpuBase=330
AdlibBase=388
GamePort=201
IRQ1=7
IRQ2=7
CDIRQ=0
MPUIRQ=9
SBIRQ=5
DMA1=5
DMA2=7
CDDMA=4
mode=legacy
GPusage=IRQ
revision=B0
csn=1
pnprdp=263
UseDma=true
SBDMA=1
vendor_id=GRV0001
effects=on
winrdp=273
dosrdp=263
config=0

IWINIT verbose output

UltraSound Initialization Version 2.23
Found a Plug And Play BIOS.
Audio Device: 
  P2XR     = 220
  P3XR     = 320
  PCODAR   = 32C
  DMA1     = 5
  DMA2     = 7
  IRQ1     = 7
  IRQ2     = 7
External Device:   PCDRAR = 0  PATAAR = 0  EXTIRQ = 0  EXTDMA = 4
Game Port Device:   P201AR = 201
Adlib/SB Device:   P388AR = 388  SBIRQ = 5
MPU-401 Device:   P401AR = 330  MPUIRQ = 9
Found 2621440 bytes of DRAM.
Found ROM chip: 1 AMDGM_1_1_.
UltraSound card #1 initialized.

Environment variables (corrected; see notes!)

SET ULTRASND=220,7,5,7,5
SET BLASTER=A220 I5 D1 T3

The values in ULTRASND are Baseport,Play DMA,Record DMA,UltraSound IRQ,SBIRQ.  BLASTER specifies Sound Blaster 2.0 emulation using IRQ 5 (SBIRQ) and DMA 1 (not changeable).

Notes

Setup sets up AUTOEXEC.BAT to invoke GETIWENV on each boot to update ULTRASND and BLASTER automatically based on IW.INI:

@REM ===== Gravis initialization (1.3) =====
@SET INTERWAVE=C:\GRAVIS\ULTRASND\IW.INI
@SET IWDIR=C:\GRAVIS\ULTRASND
@C:\GRAVIS\ULTRASND\IWINIT.EXE
@C:\GRAVIS\ULTRASND\GETIWENV.EXE > C:\GRAVIS\ULTRASND\SETIWENV.BAT
@CALL C:\GRAVIS\ULTRASND\SETIWENV.BAT
@SET ULTRADIR=C:\GRAVIS\ULTRASND
@REM ===== Gravis initialization ends =====

Unfortunately, somewhere in the process the two DMAs get reversed and ULTRASND winds up being wrong!  There is obviously a problem somewhere since the output is the reverse of what comes from GUS Classic setup (version 4.11 drivers) after the same playback and record DMAs are chosen.  With the anonymous identifiers DMA1 and DMA2, it's impossible to say which is which, but for ground truth, Mpxplay version 1.59b works with ULTRASND=220,7,5,7,5 (in agreement with the GUS Classic setup) but plays only silence with ULTRASND=220,5,7,7,5 (the result of the GUS PnP setup).  DOOM and DUKE3D apparently don't use this variable and work either way.

Setup also adds a completely redundant call to IWINIT in CONFIG.SYS:

DEVICE=C:\GRAVIS\ULTRASND\IWINIT.EXE ID=GRV00001 INTERWAVE=C:\GRAVIS\ULTRASND\IW.INI

Once the Gravis software is installed and IW.INI has been created, IRQ and DMA reassignments can be made through manual edits to IW.INI and the environment variables.

The default UltraSound IRQ setting of 11 runs into a limitation of the version of DOS4GW that is used by various DOS video games:  they can't use IRQs above 7.  DOS4GW can be patched with PREPGAME or replaced with DOS32A, but this wasn't enough to get Duke Nukem 3D working for me.  The path of least resistance is to disable the parallel port in BIOS and reclaim IRQ 7 for sound so that everything just works.

For record and play, 16-bit DMAs provide better performance (if they work at all) but 8-bit DMAs are usable.  DMA 1 is required for Sound Blaster emulation.

MPUIRQ appears to be for interrupt-driven I/O from an external MIDI device.  IRQ2 is for the GUS synth device, but its function is completely unclear.  Manual setup doesn't even mention it but always sets it the same as IRQ1.

There are several ways to reduce the number of IRQs and DMAs needed.  As-is, manual setup in the GUS PnP setup program allows disabling the CD-ROM and game port and setting the play and record DMAs to the same value (forcing half-duplex operation), but nothing more drastic.  Presumably, manually editing IW.INI to zero out other unwanted port and IRQ assignments has the intended effect.  An unwanted CDDMA should be set to 4 rather than 0; DMA 0 is actually usable while DMA 4 is not.

Additionally, there are three different tools for patching the PnP configuration information in the card's firmware to prevent resources from being allocated by PnP BIOS or "Automatic Setup:"

IWSBOS or MegaEm is required for Sound Blaster emulation.


GUS PnP
KB
Home