At a match start the load's disc reads are charged a PS2 drive's time: the EE gained ~2.8 s in 0.24 s of the PC's.
The engine made those 2.8 s at once (mostly dropped), then TMB's frame pacer held the EE back to pay the debt (EE/PC
0.48 for 5 s), so the sound was made at half speed: 270 underruns, ~4 s of silence in bursts.
- snd989::Engine::lead: added to P = (EE - reset) / 8 + G (0 unless set).
- SndDriver::realTimeClock / syncClock: before each command, write or bring-up, P is kept within -4 / +25 ms of a
line on the host's steady clock (never below the engine's clock); more than 32 ms behind, the line moves instead
(the sound resumes, no skip).
- FreeHost (real time with sound): a watcher thread raises a flag when no frame ended for 25 ms; the watchdog's next
look on the game thread, between out-calls (never inside a 989SND command or SIF call), brings the engine up and
hands the samples to onAudio. The next frame end takes the rest; nothing is made twice.
- libraries.md 15.13e.
tmb --audio-stats, ch1p to frame 6700: 9 underruns (54 ms) against 625 (5.9 s); dropped 1,899 frames (boot) against
12,906. Pinned boot and match1p MATCH; free 1P and story records byte-identical (not real time: unchanged).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
boot and match1p --pinned still MATCH; sound records equal on 1,659 / 3,000 and 3,926 / 16,000 frames (silence, both movies, the title's first music frames). Notes: docs/phase4-m3-notes.md, libraries.md 15.13d.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Read from the module on the disc: the RPC reply buffer (the "last result" rule),
the play dispatch by sound type, the type 2 single instance, the handler pools
and generations, the 240 Hz tick, KeyOn/KeyOff once a tick, and the voice end:
256 silent ticks after the mixer reports ENVX 0 (the +1.166 s of the lifetime
model: 989SND's pitch 1216 for 0xe8310/3, 1.849 s + 255 ticks = 2.912-2.920 s,
against the log's 2.9002-2.9169 s). sceSdNote2Pitch from LIBSD.IRX. What stays
open is the fork's mixer under libsd (ENVX at KeyOn, at a sample's end, release
times), which decides voice stealing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The native lifetime of a one-shot sound: its longest tone in the note's key
range, the sample at its pitch and the play's pitch bend (the tone's bend
range), plus 1.166 s (settled on match1p's two natural ends). It now gives
every pinned liveness decision of match1p but the 6 voice steals (570 wrong
before); the handler model gives 372 of the 778 pinned handles (302 before).
bozo-run --snd-log-replies off: the driver answers every reply from its
models in a pinned run. Boot matches fully native that way; match1p does not
(first divergence #17541429: the shell's slot generations), so the default
stays on. libraries.md 15.5, 15.8, 15.10, 15.11: the rules found, the
records that settled them, and what is still unexplained.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
SIF (sif): RPC bind and call with the reference's client and server-data words,
CheckStat, the SIF registers, module loading (ids only), reboot and sync, the
IOP heap (16-byte blocks, first fit, from 0x7fe60), SIF DMA ids.
989SND (snd), the IOP side of RPC service 0x123456: command batches (0x4a) and
direct calls decoded, the reply (-1, results, -1, a command with no result
leaving the driver's last one), banks loaded by sector from the disc image and
placed in IOP memory as the reference did, master volumes, reverb, stops,
streams, the movie buffer, handles and their liveness where it is certain. What
the reference's IOP time decided (one-shot sounds' lifetimes, the handler slots
they free) a pinned run takes from the log's reply (Function::logReply,
Pin::logWord); free mode has native models. The driver follows the 989SND calls
of port overrides answered from the log, and sends what should play to a
SoundSink for the future mixer.
boot and match1p --pinned: every frame and record, 0 divergences; sif 7,212 /
245,108 calls native; 989SND 3,591 / 119,225 replies native, 1 / 3,294 pinned.
Co-Authored-By: Claude Opus 5.5 <[email protected]>