Skip to content

Trace audio-renderer mix windows around a silent scene - #1661

Open
nufegia wants to merge 1 commit into
seedds:mainfrom
nufegia:contrib/ocarina-opening-audio
Open

nufegia wants to merge 1 commit into
seedds:mainfrom
nufegia:contrib/ocarina-opening-audio

Conversation

@nufegia

@nufegia nufegia commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The default audio renderer mix counters aggregate about a minute. That made it hard to tell whether a particular shot in the Ocarina of Time opening received a silent mix or whether the host audio device ran out of samples.

With DM_AUDREN_TRACE set, each renderer now logs a timestamp and counts for every 200 renders (about one second). The counts distinguish nonzero mixes, all-zero mixes and renders without a captured mix. The trace records counts and timings. The existing default counters and playback behavior are unchanged.

Related to #1501. On the M1 Pro test below, the Ganondorf horseback shot fell inside a digitally silent mix span. Waveform matching located the corresponding sound about 35.5 seconds before the image. AudioOut reported zero underruns in 70,000 callbacks. A separate experiment with #1331 and #1379 reduced the extended silence but left about four seconds of audio delay at a sampled horseback shot. The synchronization bug remains open.

Checked

  • Built the Mac host from c8bfa161 plus this change. The audren-layout, audren-work and audio-device targets and the documentation and environment-switch tests passed.
  • Ocarina of Time (0400486024DEC000, v131072), M1 Pro 16 GB, macOS 27.2, Xcode 27.2. The live diagnostic was checked using matching libraries from the older 4861fb03 partial build and the experimental NDVE bypass. All 205 consecutive windows accounted for all 200 renders. The audio-renderer source before this change was identical at both revisions.
  • Super Mario Bros. Wonder (010015100B514000) quick regression passed on the same M1 Pro. Compared c8bfa161b670 with 4d7d5bed2e6a on the same 65-second opening route. Both runs reached the frame target (3,449 and 3,510 frames). Both reported 59.3 fps, all 16,268 shaders built in both, and the PR introduced no new error types. This is the available local game with a smoke route that uses the same audio renderer.
  • GitHub CI passed host/CPU graphics tests, sanitizers, coverage, the Mac/iOS build check and the unsigned synthetic iOS app. Two checks failed; their baseline attribution is documented below.

CI follow-up (2026-11-08)

The reviewed head remains 4d7d5bed2e6a, based on c8bfa161; this follow-up changes no source code, does not rebase onto newer main, and does not claim all-green CI.

  • clang-tidy: the PR run and the upstream run on c8bfa161 have identical sequences of 38 error messages, including the terminal failure message. Both report dm/host/hle_audren.c: 0 findings. The failed ratchet is inherited from the base, not a new diagnostic in the modified audio source.
  • Tool tests: the CI job fails in SeenShaders.test_shader_watch_counts_the_list (ShaderWatch constructor signature mismatch) and the six graphics/derived variants of XcodePipelineTests.test_prepare_preserves_upstream_options_and_graphics_paths (missing fixture RomFS.img). Running exactly those two test methods locally on clean c8bfa161 and on 4d7d5bed reproduces the same seven errors. The affected tests and packer source are unchanged by this PR.

Reproduction of the inherited tool failures (run at each revision with the project's Python environment):

DM_GAME=0400486024DEC000 python -m unittest \
  dm.tools.tests.test_nsp_mac_app.SeenShaders.test_shader_watch_counts_the_list \
  dm.ios.tests.test_xcode_workflow.XcodePipelineTests.test_prepare_preserves_upstream_options_and_graphics_paths

No additional game regression was run for this follow-up. The report below is the existing quick regression on the exact PR head; it does not represent a new run or broader game coverage. The audio/video synchronization defect remains outside this diagnostic change.

Docs

  • Updated the audio reference and environment switch list. Regenerated the symptom index and checked the docs.
  • The change and this PR contain no game files, keys or extracted assets.
Existing quick regression report on the PR head

regress.py check (quick): PASS

Baseline origin/main c8bfa16, candidate HEAD 4d7d5be; Apple M1 Pro, macOS 27.2, Xcode 27.2; 1128.2 s

game status shaders (base → cand) newly failing newly building changed MSL interface (new / known) boot fps p50 frame p99 ms peak MB prepare s new RED
Super Mario Bros. Wonder 010015100B514000 PASS 16268/16268 → 16268/16268 0 0 0 0 / 0 ok 59.3 → 59.3 26.06 → 25.77 2152 → 2181 None → None 0

Super Mario Bros. Wonder 010015100B514000: PASS

  • screenshots (s: dHash bits / RGB diff / baseline noise): 50: 4/1.41/0, 58: 1/0.87/0
  • baseline: exit None, first frame 2.9 s, max frame 3449, reached True, prepare None s, fps 59.3, p50/p99 15.08/26.06 ms, peak 2152 MB
  • candidate: exit None, first frame 2.1 s, max frame 3510, reached True, prepare None s, fps 59.3, p50/p99 15.11/25.77 ms, peak 2181 MB
  • time: chain 996.5 s, smoke 131.5 s

The default mix counters aggregate about a minute, which made it hard to match the silent opening shots in Ocarina of Time to renderer output. DM_AUDREN_TRACE now timestamps each 200-render window and separates nonzero output, all-zero output and renders without a captured mix. The usual counters are unchanged.

The Mac host built, the audio layout, work-buffer and device tests passed, and a run of Ocarina of Time produced 205 consecutive windows whose three counters accounted for every render.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant