Repository navigation
feat(audio): add live mono audio for stereo output - #2860
Open
simonwjackson wants to merge 1 commit into
Open
simonwjackson wants to merge 1 commit into
simonwjackson wants to merge 1 commit into
Conversation
simonwjackson
force-pushed
the
feat-mono-audio
branch
from
November 12, 2026 17:55
5778b9b to
45e5e94
Compare
Average the final stereo channels into both ears with a widened sum. Off and 5.1 output remain unchanged. Use option 53 because main assigns 46 to Button prompts and 52 to Skip opening; neither API struct changes. Assisted-by: OpenAI GPT-6 Astra Co-Authored-By: OpenAI GPT-6 Astra <noreply@openai.com>
simonwjackson
force-pushed
the
feat-mono-audio
branch
from
November 12, 2026 18:45
45e5e94 to
13fa2b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Players who hear with one ear, or use one earbud, miss sounds that the game pans to the other side. This adds an opt-in Mono audio row that plays the average of the left and right channels in both ears (Game Accessibility Guidelines, hearing, intermediate).
What changed
host/nn_audio.caverages the final stereo PCM with a 32-bit sum, so full-scale samples cannot overflow. With the row Off every sample is untouched. 5.1 output is unchanged; the row's help says to choose Stereo.MkwVkHostnorMkwVkRendererchanges, soMKWVK_API_VERSIONstays at 20.tests/test_audio_mono.py, and one row indocs/tested-configurations.md.Run in the game
One 306-second run, standing on Link's house balcony in Kokiri Forest, from copied saves. RX 7900 XT, RADV (Mesa 26.2.3), Ryzen 5 7600X, 32 GB, NixOS 26.11 / Linux 7.2.7, headless Sway 1.12 + Xwayland. 2560x1440 output, FSR 3.1 from 1707x960, 1920x1080 window, frame generation 2x, compute mesh path, udmabuf on.
The row was switched Off → On → Off in the menu without a restart. The host's post-mix stereo PCM was captured at 48 kHz for 30 seconds in each state (
HOS_AUDIO=0, so nothing played on speakers):With the row On, both channels are equal in every captured frame and the output is not silent. Stereo separation returns when it is turned Off.
The fps values are from the log's
N presents, X fpslines. They do not prove an unchanged frame rate: On is 2.4% under the two Off medians, and the two Off medians differ from each other by 2.1%. The mix is one pass over each 240-frame audio block on the audio thread.The run used
ab25784con main8e6c15af(log linehookshot unknown (source ee840c7d): built from a source copy without Git metadata). The branch was then rebased onto newer main (now15d4ae8c), which moved the option ID from 52 to 53; that last revision has not been run in the game again.Checks
tests/test_audio_mono.pyfails on untouched main and passes here. It compiles the real mixing helper with warnings as errors and checks sample extremes, silence, Off identity, On → Off, unchanged 5.1, the live wiring, the Off default and that the option ID is unique.python -I -B tests/run_all.pyon the branch at main3abfa0a0: 484 passed, 2 failed, 20 skipped (Windows-only, or need the game). Both failures are the same on untouched main:test_readme_menu_rows.py(main's Skip opening row has no README line) andtest_linux_saves_move.py.15d4ae8c, the checks around the change pass: mono audio, option IDs, opening skip, menu translation, the README rows and the program-cache test. The full suite was not repeated after that rebase.Not tested
Windows, other GPUs, a 5.1 device (the no-change rule for 5.1 is covered by the test, not by a device), and listening by ear.