Notes on programming Creative Sound Blaster series ISA cards

In the world of PC hardware, Sound Blaster cards were the market leader in terms of install base. There are three different types of Sound Blaster cards which interest us. The types are derived from the BLASTER environment variable from DOS. We discuss the non-Vibra and non-PCI types only, because compatibility with software written for the standard “classic” Sound Blaster series was really suffering with PCI and Vibra.

Here are the ‘T’ types that correspond to the BLASTER environment variable:

  • T1 = CT-1310 (SB 1.0, DSP 1.x: 1.05), CT-1320 (SB 1.5, DSP 1.x: 1.05)
  • T2 = CT-1330 SB Pro (DSP 3.00?)
  • T3 = CT-1350(B) SB 2.0 (DSP 2.x: 2.01)
  • T4 = CT-16×0 SB Pro 2 (DSP 3.x: 3.01/3.02)
  • T5 = SB Pro Micro Channel
  • T6 = CT-17xx, CT-22xx, CT-27xx, CT-28xx SB16 (DSP 4.x: 4.01/4.04/4.05/4.11/4.12+)
  • T10 = Sound Blaster Micro Channel

T1 and T3 both have a single OPL2 chip. T1 and T3 have sockets for SAA1099 Game Blaster (CT-1300) chips and on SB 1.5, the required CT-1302 PAL as well. CT-1310 comes with SAA1099 chips installed. OPL2 chip can be read/written at 0x228-0x229 or 0x388-0x389 for Ad Lib compatibility. Writing 0x220-0x221 will access the first SAA1099 chip, and writing 0x222-0x223 will access the second. Writing to 0x220-0x223 on T1 with no GB chips causes an ISA bus hang; T3 seems to be okay. Therefore, not only must T1/T3 be checked for in the BLASTER variable, but also the user must deliberately enable GB support in the application if a T1 is found in order to be safe.

T2 has two OPL2 chips, one on the left and one on the right channel. Reading/writing 0x220-0x221 will access the first, and reading/writing 0x222-0x223 will access the second. Writing to 0x228/0x229 or 0x388/0x389 will perform the write to both chips, providing backwards compatibility for the previous mono FM cards. Reading from 0x228 or 0x388 will read from the first chip. Software written to produce stereo FM output on T2 will be heard in mono on any other type. Software written to produce stereo FM output on T4/T6 will not function correctly on T1/T2/T3.

T4 and T6 have one OPL3 chip. The OPL3 powers up in OPL2 compatibility mode. Writes to either bank of the OPL3 will result in an output on both channels. The OPL3 has 4 ports and is mapped at 0x220-0x223 and 0x388-0x38b. Half of the OPL3 is available at 0x228-0x229. The status register is accessed at 0x220, 0x228, or 0x388. In OPL3 mode, all 4 ports are used, so only 0x220-0x223 and 0x388-0x38b are useful port ranges for programming. The OPL2/OPL3 mode can only be set by accessing the second OPL3 bank.

Note on mixers

Because T2/T4 (DSP 3.xx) do not have 16-bit DMA, they instead have a special interleaved mode in the DSP for playback of stereo 8-bit audio. When using this mode, the “Stereo Switch” register, only present in the CT-1345 mixer chip, must also be enabled. Other types, such as T6, do not support this “8-bit Stereo PCM High Speed” mode nor do they have a CT-1345 mixer chip, though T6 has a backwards-compatible mixer mapping in other regards. This means that software programmed for a T2/T4 will sound incorrect on a T6 if it uses a stereo audio output stream. (The stream will sound mono, and slightly garbled. The shareware game Wolfenstein 3D is reported to exhibit this behavior.) The only stereo mode on a T2/T4 that is also supported with T6 cards is 8-bit auto-init DMA mode, but few T2/T4 applications use this mode because it was not documented until SB16 SDK was released. The CT-1345 also has filters that are omitted in later mixers.

T2/T4 (DSP 3.xx) also have a special command in the DSP to enable stereo for recording a stereo input stream. This command does not exist on any other type of card.

Note on MIDI

All cards except T6 support only SB-MIDI (programmed I/O through the DSP). T3/T4 with DSP 2.00+ have “full duplex midi with time stamp and 64 byte FIFO”, i.e. UART-style functionality, whereas earlier versions have only the half duplex functionality. SB-MIDI usage is mutually exclusive with digital audio or any other DSP functionality.

T6 supports both of the SB-MIDI modes along with a new MPU-401 compatible UART mode on port 0x300 or 0x330. The MPU-401 UART, unlike SB-MIDI, can be utilized simultaneously with DSP functionality.

MPU-401 intelligent (interrupt-driven) mode is not supported on any type of ISA Sound Blaster. If MPU-401 intelligent mode or a MPU-401 IRQ is required, the software will generally not function. Although, the project SoftMPU is capable of emulating intelligent mode on an ISA Sound Blaster using 386 protected mode port I/O traps and forwarding Sound Blaster MPU-401 UART interrupts (not SB-MIDI!) to the application’s MPU-401 interrupt handler.

An earlier Creative utility called SBMPU401 does not presume to enable intelligent mode, but at least fixes up a specific situation where the program hangs forever waiting for the Sound Blaster MPU-401 interface to issue an ACK to its command to enter MPU-401 UART mode, which is ignored without the utility.

Notes on errata

Some SB 1.0/1.5 clones erroneously return a DSP revision of 2.00.

Some SB16 SCSI-2 cards (DSP 4.11, 4.12) have a problem communicating with the “wave blaster” daughterboard, resulting in stuck MIDI notes or wrong instruments when using the daughterboard and playing digital audio simultaneously. This is because the daughterboard does not receive all the MIDI commands that the application is sending. Later DSP revisions (4.13+) don’t exhibit this problem, and even an earlier (4.05) revision does not exhibit this problem.

DSP 4.01 and 4.04 have bugs related to playback hanging, and noise in 8-bit sample playback.

Only T6 DSP 4.04 or later has full duplex audio support (playback and record one 8-bit and one 16-bit stream at a time).

To sum up

T6 is compatible with T4 OPL3 and T1/T3 single OPL2 at all ports. T2 is the only card to have two OPL2 chips, and nothing else is thus compatible with it. The best thing to be done to run T2 software on T4/T6 is emulate the two OPL2 through OPL3 stereo settings.

T2 and T4 are the only non-AWE cards to have filters and a special stereo mode on their mixer; nothing else is compatible with them and stereo software designed for T2 and T4 will produce wrong sounds on T6.

T1 and T3 are the only cards with SAA1099 chips/sockets.

T6 (SB16/AWE family) is the only type with a MPU-401 UART (at port 0x300 or 0x330). T6 (SB16 and some specific AWE32 cards) is the only card where the “Advanced Signal Processing” 12 MIPS ASP/CSP chip (CT-1748) is available. This ASP/CSP is a ST18932 DSP core with 16K of program RAM and 8k of data RAM.

AWE series cards

T6 (AWE32/64) are the only cards with a EMU-8000 150 MIPS DSP (located at I/O port 0x620). A standalone EMU-8000 card (CT-1920, CT-1924) was also made. Creative provides a utility (AWEUTIL) that is capable of forwarding MPU-401 traffic on port 0x330 to the EMU-8000 (using the /EM switch). In this way, software which is programmed to use a MIDI synthesizer through a MPU-401 UART can play sound through the EMU-8000 chip. This MPU-401 redirection on AWE series cards only functions if the motherboard does not disable NMI. If NMI is disabled on the motherboard, the MPU-401 UART can be used with a Wave Blaster (on AWE32) or an external MIDI module instead.

Only the AWE32 has a 26-pin internal MIDI synthesizer upgrade header (“wave blaster”), not AWE64.

T6 (AWE32/64) comes with 512KB RAM. AWE64 Gold comes with 4MB RAM. AWE32 can be upgraded to 28MB with two 16MB 30-pin SIMMS that are 80ns or faster. (4MB of address space is reserved for ROM, even though the EMU-8000 is only shipped with 1MB ROM.) When a AWE32 upgrade is applied, the onboard memory is disabled. The standalone EMU-8000 cards and certain AWE32 variants come with _no_ RAM onboard (upgradable to 28MB). AWE64 can be upgraded with proprietary Creative RAM. Creative supplied 2MB, 4MB, 8MB, 16MB, and 24MB upgrades. It is possible to use standard SIMMS to provide a 16MB upgrade to a AWE64, with Jeff Briden’s adapter:
(Archived here or with the more recent SIMMConn)

When a AWE64 is upgraded, the onboard memory is still used. The RAM is used for GS and MT32 emulation and for storing samples for the EMU-8000 chip. The EMU-8000 can play 32 samples at once, but only 30 are actually available (the other two voices are used for the [digital] connection of the OPL3 FM synthesizer, and are also used for refreshing RAM). A software synthesizer (WaveGuide) was provided for 32 more voices with a AWE64, but this is pointless to mention as it has nothing to do with the hardware.

Earlier AWE32 have a true Yamaha OPL3, which is noisy. Later AWE32 and all AWE64 have a Creative CQM chip which produces cleaner sound, but inauthentic FM synthesis compared to an OPL3. These chips are the same from a programming perspective.

On AWE32, the SPDIF connector only carries output from the EMU-8000 chip (and the OPL3 synthesizer through the EMU-8000, which is rather noisy when enabled). On AWE64, the SPDIF connector carries digital audio as well. The SPDIF interface is an unbuffered TTL interface. The AWE32/64’s digital audio is 18-bit, while the AWE64 Gold’s digital audio is said to be 20-bit, though that quality may only apply to the output from the EMU-8000, not the digital audio DSP.

Strictly opinion

So much for vaunted “SB Compatibility” that clone cards would advertise – even the whole SB family is not compatible with itself. Only the DSP revisions are backwards compatible, and OPL3 is backwards compatible with _single_ OPL2, and the whole family supports half duplex SB-MIDI. So the most compatible thing to do is use the 8-bit PCM/ADPCM mono auto-init DMA method of playing sounds (compatible with T2/T3/T4 and T6 as well as clones), use a OPL2 at 0x388 (compatible with all SB cards as well as AdLib), and use the old SB-MIDI non-UART mode for sending MIDI data to an external module only. This is a very limited feature set and basically represents what was available in T2/T3. But every time Creative added new features to their hardware, in later hardware they would remove support for the previous generation’s new features, so the features of T3 and T6 happen to be the most widely supported features of the SB family.

All of the AWE cards’ hardware were backwards steps from the very first AWE32, except arguably the AWE64 Gold. The Gold uses proprietary RAM, has no CSP and no 26-pin upgrade connector, and requires PnP support in the OS. However, the AWE32 cannot output normal audio via SPDIF and has only 18-bit SPDIF support at best. Unless top SPDIF support is the only objective, an original AWE32 is a more flexible card than any AWE64.

Relevant files

  • sbmpu.exe: Fix for MPU-401 support on SB16 for certain (esp. Lucasarts) games; not a TSR, modifies an undocumented mixer register
  • sbalib.exe: SB-SOUND.COM driver for old AdLib games
  • cspu.exe: Advanced Signal Processing upgrade

Links

One Response to “Notes on programming Creative Sound Blaster series ISA cards”

  1. Adrian says:

    Sorry I screwed up when trying to post a comment a few minutes ago… The AWE64 Whitepaper pdf from uni-duisburg is not reachable, do you have it on your drive?

Leave a Reply