audioControl Driver

Last updated: · In development
Where things stand
Stage 7C3C3 played a complete 150.75-second mono music track from SD on real KS3 hardware. Two alternating RAM buffers kept the Build 54 DMA path fed to the final 43-byte block. Build 48 remains the AY/PT3/AYFX baseline. The next experiment at this checkpoint is Stage 7D1, stereo PCM from RAM.
Dated checkpoints from the project record. Older entries describe what was known at the time; wording-only revisions have been combined.
Stage 7C3C3 · A complete music track from SD
Original recorded entry date.
- The original stereo MP3 ran for approximately 150.753 seconds. Its conversion, FULLTUNE.RAW, contains 2,412,043 bytes of headerless unsigned 8-bit mono PCM at 16 kHz. Silence is $80. The player streamed it from SD through alternating RAM buffers into single-shot ZXN DMA and the DAC.
- The track occupied 201 complete 12,000-byte blocks and one final 43-byte block. The helper used the positive short read as the final DMA transfer length, played those 43 bytes without padding and stopped at end of file. That made 202 transfers and approximately 150.7527 seconds of audio.
- KS3 listening result at 50 Hz and 60 Hz under the project’s test convention: “Played perfectly all the way through.” No gaps, skips, repeated passages, corruption, speed changes or early ending were reported. There was some hiss. The stereo recording had been mixed down to mono for this test.
Stage 7C3C2 · Eight consecutive blocks from one open file
Original recorded entry date.
- The SD file held eight 12,000-byte tones at 500, 700, 900, 1100, 1300, 1500, 1700 and 1900 Hz. The helper opened the file once, primed buffer A and played it while filling B. When B became active, A became the next read destination.
- Seven sequential SD refills finished while the partner buffer played. The eight tones played cleanly on KS3 at 50 Hz and 60 Hz under the project’s test convention. This extended a single timed read into sustained streaming from one file.
Stage 7C3C1 · An SD read inside the playback window
Original recorded entry date.
- A 500 Hz tone played from buffer A. A 1 kHz file, opened before playback, supplied 12,000 bytes to inactive buffer B. Each buffer held 0.75 seconds, and the helper switched on the DMA end-of-block signal.
- The file error was 0. The read count returned low byte 224 and high byte 46, which together equal 12,000 bytes. Late-refill count was 0. Both tones were clean and centred on headphones at 50 Hz and 60 Hz on KS3.
Stage 7C3B · Headphone recheck of the rising tones
Original recorded entry date.
- Repeating the six RAM tones through headphones produced clean pitches at the same speed in 50 Hz and 60 Hz. The apparent right-to-left movement heard on speakers on 17 November disappeared. Both channels stayed centred.
- The test kept the DAC destination fixed. The difference between listening on speakers and headphones points to frequency-dependent speaker or room localisation. No pan commands were present in the sequence.
Stage 7C3B · Refill from RAM during playback
Original recorded entry date.
- Six ascending 12,000-byte chunks used 500, 700, 900, 1100, 1300 and 1500 Hz. While DMA played one bank, the CPU copied the next chunk into the inactive bank through separate source and destination windows. The active $C000 mapping stayed intact.
- At both 50 Hz and 60 Hz the KS3 played all six tones cleanly at the expected pitch, speed and duration. The routing stayed fixed at centre, although the pitches seemed to move from right to left across the speakers. That observation led to the separate headphone check recorded on 20 November.
Stage 7C3A · Handoff between two preloaded banks
Original recorded entry date.
- Two independent RAM buffers each held 12,000 unsigned 8-bit mono samples at 16 kHz. A contained 500 Hz and B contained 1 kHz. Each ran for 0.75 seconds. Hearing A, B, A, B made both a repeat and a missed handoff obvious.
- The Build 54 path kept the active source at $C000 through MMU6/MMU7. Single-shot ZXN DMA used WR5 $82. The helper polled real end-of-block status, mapped the next bank and started a new transfer. This avoided BASIC delays and automatic restart. The sequence was clean on physical KS3 at both refresh rates.
Stage 7 / Build 54: clean PCM and stereo routing
Original recorded entry date.
- Build 54 restored clean real-hardware DAC playback through ZXN DMA: unsigned 8-bit mono linear PCM at 16 kHz, $80 silence, source $C000 and a 12,000-byte transfer lasting about 0.75 seconds.
- Single-shot WR5 $82 replaced the corrupted auto-restart $A2 approach. The persistent MMU4 source experiment was also rejected.
- A DAC-only 1 kHz tone confirmed strong left, centre and right routing (keys 1, 2 and 3). All DAC channels are silenced to $80 before the chosen destination is fed.
- AY/PT3/AYFX remains intact. Build 48 is the AY reference; Build 54 is an experimental DAC reference, with no claim of full 50/60 Hz DAC regression acceptance. Buffered single-shot PCM is next; continuous playback and SD streaming are unfinished.
Stage 6B / Build 48: AY backend foundation accepted
Original recorded entry date.
- Game-loaded music/effects and resource switching passed hardware checks at 50 Hz and 60 Hz.
- Build 48 added playback identity, capabilities and selection before initialisation; AY was the working backend at this checkpoint. Music, effects, position and distance regression checks passed.
- The development package was organised around that accepted AY baseline. Isolated DAC research was the next stage.
AY positioning and runtime resource switching proven
Original recorded entry date.
- Stage 4B established matched AY left/centre/right placement and near/middle/far attenuation at both video rates. Extra intermediate AY positions were rejected for this design.
- Build 44 preserved the character of four PT3 tunes by bypassing blanket volume remapping and proved clean tune switching. Build 45 proved selectable AYFX collections.
- Dynamic music lowering remained unfinished. Stage 5C game-loaded resources were awaiting a corrected hardware test.
Ship-event integration added to the plan
Original recorded entry date.
- Future BASIC examples would map firing, hits and resource events from shipControl to audio requests.
- The proposed integration retained audioControl’s playback and priority ownership. It did not replace the tested audio foundation or complete shipControl integration.
V1 baseline retained; spatial scope defined
Original recorded entry date.
- V1.0 was identified as the proven baseline, with V2 timing work established.
- Music/effects balance became the next practical task. Horizontal sampled positioning and optional stereo expansion were placed in V2, with above/below perception reserved for V3.
Consistent music timing at 50 Hz and 60 Hz
Original recorded entry date.
- The V2 foundation preserved music/effects behaviour and achieved consistent real-world playback speed in both video modes.
- A deliberately silent event was clarified in the test wording; it was not a playback failure. More ambitious sound features remained separate work.
PT3 and AYFX playback foundation recorded
Original recorded entry date.
- The progress page recorded simultaneous PT3 music and AYFX effects in HT2B build 8, with hardware playback reported on 21 September.
- The initial layout used AY0 for PT3, reserved AY1 and used AY2 for effects with a 50 Hz service callback. The wider event and priority controller still needed development.
Development Stories: the decisions and lessons behind the work ↗