Skip to content

Fix doorway audio continuity and prepare v0.3.3 - #5

Merged
mstan merged 6 commits into
mainfrom
fix/door-audio-clock
Sep 11, 2026
Merged

Fix doorway audio continuity and prepare v0.3.3#5
mstan merged 6 commits into
mainfrom
fix/door-audio-clock

Conversation

@mstan

@mstan mstan commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Door loading could run the sound processor ahead of the frame-count clock, leaving subsequent frames without PCM, then speed up gameplay while repaying the timing debt. Adopt snesrecomp's extended-frame timing API and pace each completed iteration by its actual guest duration. Normal gameplay still drops excess wall-time debt, so Samus returns to normal speed after the door.

Fast loading work now waits for the audio consumer before overflowing the native sample ring, releasing the APU mutex during the bounded wait. If playback stalls, wait once and resume throttling only when the consumer progresses. Playback builds a small cushion after starvation. Linux pacing uses CLOCK_MONOTONIC so raw timer drift cannot make the guest fall behind the audio device. An independent SDL probe reproduced the test environment's raw-clock drift: about 4.75 seconds versus 5.00 seconds on the corrected system clock.

Add an F1 replay and CSV checker that require a real room transition and report missing/dropped output and post-exit speed. Buffer the optional trace to keep small filesystem writes from perturbing short measurements, and profile trace overhead. Prepare patch release v0.3.3 for Windows and Linux.

Validation:

  • Final Windows ZIP: three repeated F1 crossings, zero missing/dropped samples during and after each door, about 60.08 FPS after exit. Extracted into a clean directory with only the package DLLs on PATH.
  • Final Linux AppImage: three repeated F1 crossings through a clocked PulseAudio null sink under WSL, zero missing/dropped samples during and after each door, about 60.09 FPS after exit. A prior single crossing also passed through WSLg's RDP audio sink; the longer RDP run stopped receiving audio callbacks, so the repeated test uses an isolated sink to measure the game independently of RDP playback.
  • Each transition took about 2.95 seconds. Both Release configurations passed all six CTests; the AppImage state-location/config-preservation test and Windows portable archive audit passed.
  • Fault injection paused only the SDL audio device for two seconds: after the one bounded wait, gameplay continued at 60.10 FPS, playback resumed, and the following doorway passed with zero missing/dropped audio.
  • Earlier Windows production and Debug/TCP replays passed, and the owner confirmed the doorway fix before release integration.

Framework dependency: RetroPortingToolKit/snesrecomp#70 (merged to main). This game pins validated framework ancestor e2c75fd, which is included in that merge's history. The broader current-main upgrade exposed a separate legacy frame-driver compatibility failure, tracked as beads-8wg.6.7.

Fixes beads-8wg.6.5.

@mstan
mstan merged commit ddddf28 into main Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant