Skip to content

fix(oot): synchronize intro movies and protect stereo routing - #2170

Merged
ly05010419 merged 1 commit into
ly05010419:mainfrom
christianfurr:codex/oot-intro-audio-sync
Nov 14, 2026
Merged

ly05010419 merged 1 commit into
ly05010419:mainfrom
christianfurr:codex/oot-intro-audio-sync

Conversation

@christianfurr

Copy link
Copy Markdown
Contributor

At roughly 30 rendered FPS, OoT's 60 FPS AV1 movies fell progressively behind their normally playing music and narration. The original 154.234-second Kokiri movie advanced 154.050 seconds of picture timestamps in 300.282 seconds of elapsed time.

Anchor a movie clock at the first accepted picture and discard late presentation images while continuing to decode every AV1 packet. Handle the one-picture output pool OoT actually registers, preserve client-acquired buffer ownership and sync generations, reset the clock on flush, and retain one discarded image so a separate empty EOF packet cannot lose the final picture. Audio timing, game/physics timing and frame-rate settings are unchanged.

The original front-left voice repair is already upstream in df1e321d, after my fork. This PR preserves that implementation and extends its REV15/REV16 regression to reorder active voice records between requests, change gain and stop one voice while inactive ID-zero records remain present.

Validation on Apple M4 / 16 GB, native OoT update 131072:

  • Production queue code under AddressSanitizer and UndefinedBehaviorSanitizer: 19,577 checks, one/eight buffers, 24/30/60/120 FPS consumers, a 750 ms stall, EOF/final-image delivery, reset and held-buffer ownership.
  • Disabled-sync comparison: 3,877 checks, reproducing about 3.103 seconds of accumulated lag for a three-second source at 30 FPS.
  • GPU-enabled original opening, with mods and opening skip off: final trace advances 153.833 seconds of video in 153.844 seconds, maximum sampled drift 21.651 ms, then reaches the following 3D cutscene. This is timestamp progression sampled once per second, not a claim of zero output latency or 60 rendered FPS.
  • Production audio renderer: 52,373 checks.
  • A 28-second stereo capture overlap matches the independently decoded original title BWAV: correlation 0.999999842 left / 0.999999851 right, with unity gain and the source's natural balance. No balance compensation or mono conversion.
  • Native build and installed app pass; ad-hoc bundle verification uses codesign --verify --deep --strict. Player saves and shader data are unchanged.

Verification notes and commands. No game-derived audio, video, screenshots, shaders or saves are included. iOS playback was not tested.

@ly05010419
ly05010419 merged commit 2801fed into ly05010419:main Nov 14, 2026
1 of 4 checks passed

Copy link
Copy Markdown
Owner

已保留作者提交并合入 main,已推送:2801fed7。

本机直接执行生产影片队列代码的 ASan/UBSan 回归通过:同步开启 19,577 项、关闭对照 3,877 项,覆盖 1/8 缓冲、24/30/60/120 Hz 和卡顿。没有重做完整影片游玩或 iOS 真机验收;PR 中的实际影片对齐结果仍归于作者测试。谢谢贡献。

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.

2 participants