Skip to content

EN Audio

drew.po28@gmail.com edited this page Jun 25, 2026 · 7 revisions

Audio

Menu path: Audio · Boards: all (SAA1099, MIDI and General Sound are RP2350 only) · Requires: —

Overview

Everything that makes sound: the beeper, the AY-3-8912 PSG (with stereo panning and TurboSound), the SAA1099, Covox and SounDrive PCM DACs, General Sound, MIDI out, plus the audio output driver (how the mixed signal leaves the board: PWM / I2S / external AY / HDMI / PCM5122) and a software Volume Boost.

The set of rows depends on the board:

  • RP2350: AY-3-8912 · AY Stereo · TurboSound · Covox · SounDrive · SAA1099 · MIDI · (General Sound — only when PSRAM is present) · Audio Driver · Volume Boost
  • RP2040: AY-3-8912 · AY Stereo · TurboSound · Covox · SounDrive · Audio Driver · Volume Boost (no SAA1099 / MIDI / General Sound — not enough pins/resources)

The master Volume control is not in this menu — it lives at the top of the main settings menu (and on the Vol +/- hotkeys). This page covers the sound sources and the output driver.

Menu structure

Audio
├── AY-3-8912 ON/OFF ▸   On / Off
├── AY-3-8912 Stereo ▸   ABC / ACB / Mono
├── TurboSound ▸         OFF / NedoPC / old-TC / BOTH
├── Covox ▸              NONE / #FB / #DD
├── SounDrive ▸          Auto (Profi only) / On / Off
├── SAA1099 ON/OFF ▸     On / Off                 (RP2350)
├── MIDI ▸               OFF / AY / ShamaZX / Software / GM.DLS Wavetable  (RP2350)
│   └── Synth Preset ▸   GM / Piano / Chiptune / Strings / Rock / Organ / Music Box / Synth  (Software only)
├── General Sound ▸      Mode On/Off + Clock      (RP2350, only if PSRAM present)
│   └── Clock ▸          12 / 13 / 14 / 20 / 24 MHz
├── Audio Driver ▸       Auto / PWM / i2s / AY-3-8910 / HDMI [ / PCM5122 ]
└── Volume Boost ▸       +0 / +4 / +8 / +12 / +16 / +32 / +64

Options

Item Values Default Description
AY-3-8912 ON/OFF On / Off On The AY-3-8912 PSG (128K / Pentagon / +2). Toggling applies immediately (ESPectrum::AY_emu)
AY-3-8912 Stereo ABC / ACB / Mono ABC Stereo panning of the three AY channels. ABC and ACB are the two standard channel layouts; Mono centres all three
TurboSound OFF / NedoPC / old-TC / BOTH BOTH (RP2350) · OFF (RP2040) A second AY chip (6 channels total) — TurboSound. NedoPC and old-TC are the two addressing schemes; BOTH answers either
Covox NONE / #FB / #DD NONE 8-bit Covox DAC on a port — for games/demos that stream PCM samples. Choose the port the software writes to (#FB or #DD)
SounDrive Auto (Profi only) / On / Off Auto 4-channel 8-bit DAC (Covox-family) at ports #0F/#1F/#3F (left), #4F/#5F (right), #FB (both). Auto enables it only on Profi (Profi CP/M titles stream PCM there)
SAA1099 ON/OFF (RP2350) On / Off Off The Philips SAA1099 (stereo: 6 tone channels + noise + envelopes). Turning it on disables Timex graphics (with a notice) because they conflict
MIDI (RP2350) OFF / AY / ShamaZX / Software / GM.DLS Wavetable OFF See MIDI. AY/ShamaZX = MIDI out on the UART TX pin; Software = built-in procedural synth (preset list); GM.DLS Wavetable = GM wavetable from a gm_bank.bin on SD
MIDI › Synth Preset GM / Piano / Chiptune / Strings / Rock / Organ / Music Box / Synth GM Instrument preset for the Software soft-synth only (not GM.DLS)
General Sound (RP2350) Mode On/Off + Clock Off The General Sound sample card — a second Z80 with 2 MB of sample RAM. Only listed when PSRAM is available. Toggling Mode or changing Clock reboots (OSD_DLG_APPLYREBOOT)
General Sound › Clock 12 / 13 / 14 / 20 / 24 MHz 13 MHz GS Z80 clock. Reboots on change
Audio Driver Auto / PWM / i2s / AY-3-8910 / HDMI / PCM5122 Auto How the mixed audio leaves the board (see below). Changing it reboots
Volume Boost +0 … +64 +0 Software gain added on top of the master Volume (Config::audio_boost). For quiet material; high values can clip

⚠️ MIDI vs. real tape-in (Murmulator boards). On boards where the MIDI TX pin and the WAV-load (real sound-in) pin are the same GPIO, enabling MIDI = AY/ShamaZX while Real sound-in is on pops a conflict warning — only one can use the pin.

Sound sources

Beeper

The 1-bit ZX-Spectrum beeper (port #FE, bit 4) is always emulated and mixed into the output — there is no menu toggle for it.

AY-3-8912 (PSG)

The AY-3-8912 programmable sound generator used by 128K / +2 / Pentagon machines: three square-wave tone channels, a noise generator and per-channel envelopes. The emulation is verified; stereo panning is ABC / ACB / Mono (the AY Stereo row). With TurboSound a second AY is added for 6 channels in total.

SAA1099 (RP2350)

The Philips SAA1099 stereo sound chip — 6 tone channels, a noise generator and two envelope generators. The implementation is based on stripwax/SAASound and verified against a real SAA1099P. Enabling it disables Timex graphics (they share resources). Mixing-model details are in the project CLAUDE.md.

Covox / SounDrive (PCM DACs)

Two ways to play raw PCM samples:

  • Covox — a single 8-bit DAC on one port (#FB or #DD), the classic mono Covox.
  • SounDrive — a 4-channel 8-bit DAC (left on #0F/#1F/#3F, right on #4F/#5F, both on #FB). Auto turns it on for Profi only, since Profi CP/M software streams PCM to those ports.

General Sound (RP2350, PSRAM only)

The General Sound card emulation: a dedicated second Z80 (running on core1) with 2 MB of sample RAM, used by demos and trackers for sample playback. It is only offered when the board has PSRAM — preferably butter PSRAM (XIP, fast); plain SPI PSRAM is a slow best-effort fallback (~30× slower, may glitch on MOD playback). The Mode toggle and the Clock (12/13/14/20/24 MHz) both require a reboot to apply. Enabling GS while esxDOS DivIDE is active is blocked (the bus ports overlap).

MIDI (RP2350)

MIDI modes: AY (bit-banged AY-to-MIDI) and ShamaZX send MIDI out the board's UART TX pin; Software is a built-in procedural soft-synth (with the Synth Preset list); GM.DLS Wavetable plays a real GM sound bank from a user-supplied gm_bank.bin on SD. RP2040 has no MIDI. Full details, the GM.DLS bank workflow and wiring: MIDI.

Audio Driver — how sound leaves the board

The mixed signal can be emitted several ways. Changing the driver reboots the board.

Driver What it is
Auto Pick automatically: probe for a PCM5122 DAC over I2C, else detect the I2S link pins, else fall back to PWM
PWM Drive the audio GPIOs directly as PWM (no external DAC). The simplest output
i2s Feed an external I2S DAC on the board's I2S pins
AY-3-8910 Output to a real external AY-3-8910 / 74HC595 chain (the PWM_175 / serial-595 path)
HDMI Embed audio in the HDMI stream (RP2350 + HDMI video builds only; hidden on VGA/RP2040)
PCM5122 The on-board PCM5122 I2S DAC (shown only on ZERO2 / Waveshare PiZero builds — see PCM5122 DAC)

The audio pins themselves (I2S DATA/BCK/LCK, PWM left/right, beeper, 74HC595 latch/clock/ data) are triple-aliased on most boards onto the same GPIOs — see the board pin tables. On startup an audio pin is yielded to ZiFi if the network UART has claimed it.

Wiring / schematic

The audio output pins (I2S / PWM / 74HC595) and the PCM5122 / HDMI pins for each board are in Boards & pinout. External I2S DAC details: PCM5122 DAC. MIDI wiring: MIDI.

How to test

Image Feature What it checks Expected result
any 128K AY tune AY-3-8912 / Stereo PSG + ABC/ACB panning Three channels, stereo separation audible
a TurboSound (TS/PT3) tune TurboSound Second AY (6 ch) Six-channel playback
a Covox/SounDrive demo Covox / SounDrive PCM streaming Sampled audio plays

Full list: Test images.

Settings storage

All audio settings are persisted to NVS via Config::save() and restored on boot:

Setting NVS key Values Default
AY-3-8912 on 48K AY48 Yes / No (NVS: true/false) Yes
AY stereo ayConfig 0 ABC
1 ACB
2 Mono
ABC (0)
TurboSound turbosound 0 OFF
1 NedoPC
2 old-TC
3 BOTH
BOTH (3) on RP2350; OFF (0) on RP2040
Covox port covox 0 NONE
1 #FB
2 #DD
NONE (0)
SounDrive soundrive 0 Off
1 On
2 Auto (Profi only)
Auto (2)
SAA1099 SAA1099 Yes / No (NVS: true/false) No
MIDI midi 0 OFF
1 AY
2 ShamaZX
3 Software
4 GM.DLS Wavetable
OFF (0)
MIDI synth preset midipreset 0 GM
1 Piano
2 Chiptune
3 Strings
4 Rock
5 Organ
6 Music Box
7 Synth
GM (0)
General Sound gs_enabled 0 OFF
1 ON
OFF (0)
GS clock gs_clock 0 12 MHz
1 13 MHz
2 14 MHz
3 20 MHz
4 24 MHz
13 MHz (1)
Audio driver audio_driver auto
pwm
i2s
ay
hdmi
pcm5122
auto
Volume boost AudBoost +0
+4
+8
+12
+16
+32
+64
+0
Master volume AudVolume −16 … 0 (0 = loudest) 0

(In-memory the boost/volume fields are audio_boost / aud_volume; the NVS keys are AudBoost / AudVolume.)

Links

Clone this wiki locally