Manatee · Dreamcast audio & sound driver, explained
The hardware · and how Manatee uses it

The DSP and effects

Reverb, echo and chorus on the Dreamcast come from a small programmable signal processor inside the AICA. It runs one short program per output sample, reading the voices' effect sends and using a slice of sound RAM as its delay memory.

What the DSP is

Inputs 16 mix buses sum of voice sends 2 external inputs CD audio DSP core 128-step program, every sample Microprogram 128 instructions Coefficients 128 multipliers Working registers temporary values Address table 64 delay-tap offsets all loaded by the ARM from an effect program Delay ring buffer in sound RAM 16-128 KB 16 outputs effect returns Mixer level + pan per output → stereo
Figure 1. The DSP between the voices and the mixer. The dry signal of every voice bypasses all of this and goes straight to the mixer.

The DSP is not a general-purpose CPU: it has no branches. It runs the same 128-step program once for every output sample. Each step can read an input bus, multiply by a coefficient, accumulate, read from or write to delay memory, or write one of the 16 outputs. Its delay memory is a ring buffer in sound RAM whose base pointer moves by one every sample; an entry in the program's address table is therefore a fixed delay in samples, a "tap" into the past. Values are stored in delay memory in a compact floating-point format; in that format the all-zero pattern is not silence, which is why Manatee clears the buffer with a special value (0x60006000, two floating-point zeros).

How that makes reverb

A room reverb is built from delays: several feedback delay lines (combs) of different, unrelated lengths produce a dense tail of echoes, and all-pass stages smear them into a smooth wash. On the AICA each delay line is a pair of taps in the ring buffer, feedback amounts and filtering are coefficients, and the whole network fits in the 128 steps. Longer rooms need more delay memory, which is why each program states the ring-buffer size it requires (16, 32, 64 or 128 KB).

Effect banks in Manatee

Manatee treats DSP programs as data, downloaded by the SH-4 like any other sound bank:

FX program bank

A list of complete DSP programs. Each has a name, the ring-buffer size it needs, its coefficients, address table and 128-step microprogram. Selecting one loads it into the DSP.

FX output bank

A list of "output sets": for each of the 16 DSP outputs, a level and a pan. This is how the stereo image of the reverb return is set.

FX work area

Not data at all: just an address and a size in sound RAM that the SH-4 sets aside for the delay ring buffer. The driver refuses programs that need more than it provides.

The driver also carries a built-in program named "e-reverb" (a 128 KB reverb) and a built-in output set (outputs 0 and 1 hard left and right), used until the game downloads its own. Soul Calibur ships three reverbs in its initial data, named outside, inside and BGM (which one plays when is decided by game code on the SH-4, not traced here).

Switching programs without a click

Replacing a running DSP program instantly would produce a burst of garbage from half-updated delay lines. Manatee does it in two phases:

  1. Select (on the command)The requested program is validated: the bank must carry the right tag, version and end marker, the program number must exist, and the work area must be large enough. Errors are reported to the SH-4 through the driver error word. If it passes, the program is queued.
  2. Load (on the next 4 ms tick)The DSP output mixer is faded out step by step, the DSP's registers are cleared, the ring buffer is filled with floating-point silence, the coefficients, address table and microprogram are copied in one burst, the ring-buffer register is pointed at the work area, and the outputs are faded back in to their previous levels.

What the game can control

ControlHowEffect
Effect programhost command (sdSndSetFxPrg), or MIDI CC 79 on port 7load a program from the FX program bank; value 0 of the CC switches the DSP off
Clear effecthost command (sdSndClearFxPrg)fade out and silence the DSP
Output sethost command (sdSndSetFxOut)apply an output set: level and pan for all 16 returns
Output offsetshost command (sdSndSetFxOutPrm), MIDI CC 77/78 on port 7adjust one return's pan or level
Positional panhost command (sdQsndSetPos), MIDI CC 80for programs built with "pan slots": write equal-power-style pan coefficients into the program so a sound can be placed around the listener
How much reverbper port: FX level command; per MIDI channel: CC 91; per sample: the bank's send levelthe effect-send level of each voice
Which input busper MIDI channel: CC 76; per one-shot/stream: the "FX channel" commandwhich of the 16 DSP buses the voice feeds
CD audio"GD-DA" volume/pan commandslevel and pan of the two external inputs
Why port 7?

The DSP output and program controllers (CC 77-79) only work on MIDI port 7, the same port the driver assigns to its external MIDI input. That fits a development workflow: a sound designer connected a sequencer or editor to the AICA's MIDI port and tweaked reverb settings live.