The SGI Indy (IP24) and Indigo2 (IP22/IP26/IP28) audio subsystem uses two Crystal Semiconductor CS4216 16-bit stereo Multimedia Audio Codecs (Codec A and Codec B) connected to the HAL2 ASIC, paired with an external 8-bit Multiplying DAC (MDAC) for speaker and headphone volume control.
-
No
$I^2C$ or Host Microprocessor Bus (Mode 3,PB/SB = 1): Although the CS4216 supports a parallel microprocessor port (PB/SB = 0) and a serial command port (CCLK/CDIN/CDOUT), the Indy and Indigo2 audio section hardwires the codecs to Serial Mode 3 Slave (SM3-Slave):PB/SB = 1(serial control),CM0 = 1, CM1 = 1(Mode 3),MS/SL = 0(Slave). All codec control and status words travel in-band inside the 64-bit time-division multiplexed (TDM) serial audio frame between HAL2 and the CS4216 (SDINandSDOUT). -
Clocking is Driven by HAL2, Not by the Codec: In
SM3-Slavemode, the CS4216'sCLKIN(master oversampling clock,$256 \times F_s$ ),SCLK(serial bit clock,$64 \times F_s$ ), andSSYNC(frame sync,$1 \times F_s$ ) pins are all inputs driven by HAL2's Bresenham clock generators (BRES1–BRES3). Two crystal oscillators on the board (24.576 MHz=$512 \times 48,\text{kHz}$ and22.5792 MHz=$512 \times 44.1,\text{kHz}$ ) plus the recovered AES receiver clock feed HAL2, which synthesizes the codec clocks. -
Two-Stage Output Volume Architecture:
-
Line Out is driven directly by the CS4216 DAC outputs. The CS4216 has
an internal 5-bit digital attenuator (
LA4:0andRA4:0in Control Word 1,$1.5,\text{dB}$ per step from$0.0,\text{dB}$ to$-46.5,\text{dB}$ ) and aMUTEbit (Control Word 0 bit 10). Under IRIX (a2_dd.o), Line Out has a fixed$0.0,\text{dB}$ gain range and leavesLA = 0,RA = 0,MUTE = 0. -
Headphone and Internal Speaker Out pass through an external 8-bit
Multiplying DAC (MDAC) mapped directly on HPC3 PBUS PIO Channel 2 at
0x1FBD8800(VOLUME_RIGHT) and0x1FBD8804(VOLUME_LEFT). The IP22/IP28 PROM startup chime, the IRIX kernel audio driver (a2_dd.o), the front-panel volume buttons, and NetBSD (haltwo) all control output volume through these two 8-bit registers.
-
Line Out is driven directly by the CS4216 DAC outputs. The CS4216 has
an internal 5-bit digital attenuator (
Each sample period (SCLK cycles divided into eight
8-bit time slots (Slot 1 through Slot 8) following the rising edge of
SSYNC:
| Bits | Time Slot |
SDIN (HAL2 |
SDOUT (CS4216 ADC + Status |
|---|---|---|---|
63:48 |
Slots 1–2 | Left DAC PCM (16-bit signed, MSB first) | Left ADC PCM (16-bit signed, MSB first) |
47:40 |
Slot 3 | Low 8 bits of 24-bit Left PCM (ignored by 16-bit CS4216) |
0x00 (stuffing bits) |
39:32 |
Slot 4 |
Control Word 0 upper byte (IDR0[15:8]) |
Status Word upper byte (ER3:0, REV3:0) |
31:16 |
Slots 5–6 | Right DAC PCM (16-bit signed, MSB first) | Right ADC PCM (16-bit signed, MSB first) |
15:8 |
Slot 7 |
Control Word 0 lower byte (IDR0[7:0]) |
Status Word lower byte (ADV, LCL, RCL) |
7:0 |
Slot 8 |
Control Word 1 (IDR1) |
0x00 (stuffing bits) |
HAL2 packs the 28-bit CS4216 control payload across two 16-bit indirect data
registers (IDR0 and IDR1) committed via HAL2_CODECA_CTRL2_W (0x1408) or
HAL2_CODECB_CTRL2_W (0x1508), and transmits those control bits in every
serial frame alongside the DMA audio samples.
| Bits | Field | Description |
|---|---|---|
15:11 |
0 |
Reserved (written as 0) |
10 |
MUTE |
DAC Output Mute: 1 = mute both Left and Right DAC outputs; 0 = normal operation |
9:8 |
ISL1:0 (ISR1:0) |
ADC Input Mux Select (Left and Right tied together in HAL2):0 = Line 11 = Line 2 / Synth (Indigo2 MAUI synthesizer feed)2 = Line 33 = Line 4 / Microphone |
7:4 |
LG3:0 |
Left ADC Input Gain: 4-bit unsigned (0..15), |
3:0 |
RG3:0 |
Right ADC Input Gain: 4-bit unsigned (0..15), |
| Bits | Field | Description |
|---|---|---|
11:7 |
LA4:0 |
Left DAC Output Attenuation: 5-bit unsigned (0..31), |
6:2 |
RA4:0 |
Right DAC Output Attenuation: 5-bit unsigned (0..31), |
1 |
DO2 |
Digital Output Pin 2 (controls external microphone preamp gain):1 = 0 = |
0 |
DO1 |
Digital Output Pin 1 (controls microphone phantom bias):1 = Microphone bias off (Line input)0 = Microphone bias on |
Common DO2:DO1 (IDR1[1:0]) combinations used by IRIX (a2_dd.o) and ARCS
diagnostics (a2diags.c):
-
0x03(DO2=1, DO1=1): Line input,$1\times$ preamp, mic bias off. -
0x01(DO2=0, DO1=1): Microphone input,$1\times$ preamp ($0$ to$+22.5,\text{dB}$ viaLG/RG). -
0x00(DO2=0, DO1=0): Microphone input with$+20,\text{dB}$ ($10\times$ ) analog preamp enabled (used by IRIX when requested input gain exceeds$+20.0,\text{dB}$ , giving$+20.0,\text{dB}$ to$+42.5,\text{dB}$ total input gain).
When bit 7 (0x0080) of HAL2_CODECB_CTRL1_W (0x1504) is set, HAL2 replaces
every second 32-bit DMA word on the Codec B record channel with the CS4216
non-audio status word captured from SDOUT Slots 4 and 7:
| Bits (32-bit DMA word) | Symbol | Description |
|---|---|---|
31:28 |
HAL2_NAB_ERROR (ER3:0) |
CS4216 framing/clock error code (0 = no error, 1 = SSYNC early, 2 = SSYNC late, 3 = CLKIN/SSYNC ratio error) |
27:24 |
HAL2_NAB_REVISION (REV3:0) |
CS4216 silicon revision (0x1 = Revision B/C) |
3 |
HAL2_NAB_VALID (ADV) |
1 = ADC data valid (calibration complete, not muted) |
2 |
HAL2_NAB_LEFT_CLIP (LCL) |
1 = Left ADC clipping detected |
1 |
HAL2_NAB_RIGHT_CLIP (RCL) |
1 = Right ADC clipping detected |
The two CS4216 codecs on the board are wired asymmetrically in normal operation and combined in 4-channel mode:
| Mode | ISR bit 2 (CODEC_MODE) |
Codec A Role | Codec B Role |
|---|---|---|---|
| Indigo / Stereo Mode (default) | 0 |
DAC (Analog Output: Line Out + Headphone/Speaker Out via MDAC) | ADC (Analog Input: Line In / Mic In / Synth In) |
| Quad / 4-Channel Mode | 1 |
Codec 1 DAC + ADC (Front Left/Right Out + Input pair 1) | Codec 2 DAC + ADC (Rear Left/Right Out + Input pair 2) |
In 4-channel mode (CODEC_MODE = 1), both CS4216 chips share the same serial
frame sync, so IRIX switches the analog input device from BRES1 (cg1) to
BRES2 (cg2, the analog output clock generator) to keep both codecs
phase-locked to a single sample rate.
Physical addresses on HPC3 PBUS PIO Channel 2:
| Physical Address | HPC3 Offset | Name | Description |
|---|---|---|---|
0x1FBD8800 |
0x58800 |
VOLUME_RIGHT |
8-bit unsigned Right Headphone/Speaker volume (0x00 = muted, 0xFF = maximum) |
0x1FBD8804 |
0x58804 |
VOLUME_LEFT |
8-bit unsigned Left Headphone/Speaker volume (0x00 = muted, 0xFF = maximum) |
The MDAC attenuates the analog signal linearly with the 8-bit register value
The linear gain is relative to full scale (
-
$V = 0$ :$-\infty,\text{dB}$ (completely muted). -
$V = 1$ :$-47.6,\text{dB}$ ($-48.13,\text{dB}$ below$V = 255$ ). -
$V = 64$ (0x40):$-11.5,\text{dB}$ (IRIX default speaker volume at driver init). -
$V = 240$ (0xF0):$0.0,\text{dB}$ nominal unity reference in IRIXAL_GAIN. -
$V = 255$ (0xFF):$+0.53,\text{dB}$ maximum output.
In IRIX (a2_dd.o):
- Setting
AL_GAINorAL_MUTEon the speaker/headphone interface (or pressing the front-panel volume/mute buttons, which invokehal2_volumectrlfrom the IP22/IP24 volume button interrupt handler) sets a target0..255MDAC level (0when muted) and marksdezipper_active = 1. - On each
hal2_update_subsystick,dezipper_output_attensteps the current left and right register values toward the target using a 256-entry exponential step table (zippertab) and writes the updated bytes to0x1FBD8804(VOLUME_LEFT) and0x1FBD8800(VOLUME_RIGHT) to prevent audible clicks ("zipper noise").