OpenTPW

AUDIO-038: out-of-range loop output recreation#

Status and boundary#

PR #553 now contains a bounded loop-only correction, following independent static review of the native stop/restart contract. It does not retire AUDIO-038. Finite one-shot restart/expiry, sentence selected-descriptor timing, initial submission admission and the broader host group-enable model remain residuals. Held-chain child playback and sentence scheduling are unchanged.

The implementation retains AudioVoice as the public logical Stop/move handle, but releases its per-output cursor when a catalogue loop leaves range. A later admitted tick creates a new output cursor at the selected source's beginning. Logical serial, selected PCM, parameter table and explicit-stop state survive independently of the output. A released loop does not mix, duck other channels, finish, or emit a segment-completion callback.

Native evidence#

Static addresses below refer to sp20_nocd/tp.exe, SHA-256 5472f97b5eb28f58b5a49f3a15f6f66adffa6b2625a623f503202c9696d1b805. No executable execution or original-media capture is claimed.

Sentences and held children are distinct#

Sample-backed sentence tick 0x6BDF50 reuses 0x6BC410, but refill callback 0x6BDE00 may already have replaced the placeholder's selected sample before the previous output audibly finishes. Recreating the selected descriptor therefore does not justify either “always replay the audible segment” or “always consume the prefetched segment.” Mapping the existing early-prefetch extension requires a separate controlled selection/refill fixture.

Held-chain root tick 0x6BDAE0 -> 0x6BDB50 directly walks locally linked children. Creation 0x6BDBB0 -> 0x6B72F0 -> 0x6C3DE0 does not insert those children into the manager pool. Both child vtables 0x70A970 and 0x70A9E0 override sample setup to 0x6C3AE0, without the callback-owner setup of 0x6BC410. Root range exclusion prevents further child ticks/spawns, not a recursive output stop. Explicit stop 0x6BD9B0 is the separate cascade. Existing children continue playing out; they are not extra pool entries.

Implementation guardrails#

Synthetic acceptance and validation#

AudioLoopRangeTests uses synthetic PCM, fake catalogs, explicit mixer ticks and injected clocks. It covers fresh output phase and identity, owner retention, idempotence, unchanged sample choice, ordered volume/pitch/delay draws, simultaneous return order, any-distance/flat/zero-range exceptions, explicit/channel stop, twelve-slot and rank-zero admission, suspended-owner exclusion, placed parameter updates, held fade termination/group gain, released-speech ducking, and held-child cursor preservation. The prior pitch test is updated to distinguish retained logical owner from released output. The raw-mixer spatial test is explicitly scoped as raw mixer behavior.

Local validation is limited to source review, whitespace checks and Python documentation/register validators. Local .NET execution was not attempted because of the existing execution restriction. Runtime acceptance requires successful focused/full test execution in the authorized exact-head CI and independent frozen-source review. No passing runtime result is claimed in this proposal.

Remaining work#

  1. Finite one-shots: retain original expiry base, apply old-delay admission followed by new-delay expiry recheck, and preserve late-start rejection before enabling restart.

  2. Sentences: test selected S before refill versus selected T after refill, independent of the audible-buffer boundary, before changing early-prefetch mapping.

  3. Initial submission and general host group-enable parity remain outside this loop-return slice. Current host zero-gain behavior is preserved.

  4. Exact codec/device buffering has not been captured from the original. Synthetic fresh-source tests are not an acoustic cross-device parity claim.

Do not publish original media or private game data in fixtures or commits. Keep the residual annotation and review/CI gates visible.

Update, October 28, 2026 (round 10 package G)#

Source: docs/proposals/audio-038-trace-out-of-range-voice-resumption.md in the project repository.