Repository navigation
Recover host audio after accelerated execution and presentation underruns - #769
Conversation
mstan
left a comment
There was a problem hiding this comment.
Found and repaired a new-stream recovery defect. The gate could remain active after the audio bridge's underrun counter reset, even though the new stream had never underrun. The previous reset check started from an already inactive gate and did not cover that transition.
The strengthened actual catch-up test fails before repair on both Windows and Linux. Disarming when the counter moves backwards fixes it; catch-up/refill and PCM-preserving resume suites now pass on both platforms. Pushed 03aab1a to this branch with the exact reviewed86942b3e lease. No target-buffer, guest clock, SPU or mixer policy changed.
I also checked the consuming Tomba PR#55: its fresh default is ON, so the engine API opt-in does not require the title's ordinary player to enable a correctness repair manually. The compatible combined review gate is still underway. Existing owner Dwarf Village/audio acceptance is retained; no repeated visible game handoff or new physical speaker-latency claim.
mstan
left a comment
There was a problem hiding this comment.
Pushed the stream-reset recovery fix at 03aab1a. The old reset test began inactive; the strengthened actual test starts with active catch-up and reproduces fresh-stream trimming after underrun counters reset. Resetting that state repairs the bug. Catch-up and PCM-preserving sink-resume tests pass on Windows and Linux, with failing original results retained.
The combined Release runtime at bb0d6de builds and passes 16/16 focused tests. I checked TombaRecomp #55: fresh Audio Sync is ON, saved choices are preserved, and the owner accepted the relevant EU1 audio check. This is host-sink recovery, with guest/SPU timing preserved; no broad new campaign or universal performance claim. Ready from this review.
…-sync-runtime Recover host audio after accelerated execution and presentation underruns
Recover host audio after accelerated execution and presentation stalls
Accelerated BIOS boot/manual fast-forward enqueue PCM faster than wall playback;
a display stall can also empty the ring and then leave a delayed burst when the
unchanged frame pacer catches up. Reuse the existing advance-and-discard sink,
re-prime a depleted ring without deleting queued PCM, and sink catch-up only
after a real underrun plus one fully late frame. Recovery now first permits the
queue to refill its target; only subsequent catch-up excess is discarded.
No guest-clock, SPU simulation,
HQ mixer or video-buffer changes. Policy API is region-independent and inactive
until the title opts in; configured OFF buffering remains intact.
Prior controlled measurements: BIOS cursor median KEYON-to-host PCM 211 -> 76 ms;
after mode switches ring fill 176–214 -> 72–75 ms at the 80 ms target. These are
host measurements, not HDMI/eARC speaker latency. Owner accepted windowed and
exclusive-fullscreen EU1, fast-forward and area transitions in the personal
implementation. The fresh official-source builds are qualified separately.
Tests: assertion-enabled catch-up and PCM-preserving resume tests pass. Long
mode switches can still cause short silence/suppressed sounds during recovery.
No continuous trimming or area-based reset. Netplay/foreign pacing exclusions
remain. Other platforms need their ordinary build/listening checks.
Independent of the renderer PR. The Tomba audio-mod PR consumes the new API.
Fresh official-source Windows candidates were rebuilt separately for USA, EU1 Rev1, EU2 Rev1 and Japan. Existing owner acceptance concerns the reference implementation and short tested sections, not an entire campaign. No private extensions are included.
Confirmed Dwarf Village recovery correction
The previous recovery could discard newly generated PCM while the ring was still
empty, prolonging starvation. The follow-up snapshots fill and target under the
audio lock and permits discard only once that target reserve is present. There
are no room IDs, widescreen-dependent switches or guest timing changes.
The owner manually retested EU1 Dwarf Village with Audio Sync ON and Frame
Interpolation OFF and confirmed that the previously reported stuttering no longer
occurred. This acceptance covers the tested section, not a full campaign or
all-region certification.
Regression checks rerun successfully: catch-up/refill policy, PCM-preserving sink
resume, Audio Sync activation/legacy settings, and regional catalog staging.
Audio Sync Fix remains version 1.0.1. The TombaRecomp mod PR #55 does not need
a code change for this correction.