Skip to content

Audio beta

New, hand-written section - see the note on the cheat sheet.

Like most PS2 peripherals, the sound chip (SPU2) is IOP-side hardware

  • there's no direct EE-to-SPU2 path. Every audio package in this SDK is either an IOP driver that actually touches SPU2 registers, or an EE-side client that reaches one over SIF (see EE, IOP, and SIF).

The real layering

This SDK carries two genuinely separate register-level SPU2 drivers, and everything else builds on one of them:

core/libsd  ─────┐                     core/libspu2 ─────┐
                 │                                        │
             world/sdr                            world/libsnd2 (MIDI/sequencer)
      (RPC wrapper, IOP)                                  │
                                              world/rspu2drv (RPC, links BOTH
                                               libsnd2 AND libspu2)
  • libsd and libspu2 (both core) are independent, register-level SPU2 drivers - direct hardware access, no more primitive path exists for either. They aren't two versions of the same thing; they're two separate implementations that happen to both exist in this codebase's history.
  • libsnd2 (world) is a MIDI/sequencer layer built on libspu2.
  • rspu2drv (world) is an RPC-exposed driver that statically links both libsnd2 and libspu2 - the most layered of the group.
  • sdr (world) is an RPC wrapper around libsd specifically (its own IOP binary is literally named sdrdrv.irx).
  • ps2snd (core) is the EE-side RPC client matching whichever of these IOP drivers is actually running - the thing your EE code actually calls.
  • ahx (core) is a separate EE-side RPC client, for the IOP's AHX audio-codec driver specifically (a compressed audio format, distinct from the general SPU2 drivers above).

audsrv: the easy path, deliberately outside this stack

audsrv (standalone repo, not sdk-core/sdk-world) is a higher-level playback API - queue a sound, play it - and is by far the easiest way to get audio into a homebrew project. It's kept as its own repo rather than a sdk-core package because it's LGPL-2, the one license this SDK's core tier doesn't allow (see Packages's license policy) - not because it's lower quality or unmaintained.

libmad (world) decodes MP3 - pair it with audsrv (or one of the lower-level drivers above) for playback rather than expecting it to produce sound on its own; it only turns compressed audio into raw PCM samples.

Picking a layer

For almost any real game, audsrv is the right starting point - it's the API built for "I have a sound effect / a music track, play it," without needing to understand SPU2 voices, batches, or RPC plumbing directly. Reach for libsd/libspu2/ps2snd directly only if audsrv genuinely can't do what you need (bespoke DSP effects, direct voice-level control) - that's a much larger jump in complexity.

See also

  • EE, IOP, and SIF - why "EE client + IOP driver" is the shape of almost every package pair here
  • Packages - the core/world license split