fix(audio): a stereo menu sound plays whole on the controller, not its right side on the TV #2728

Merged
HumanBean merged 2 commits from llun/Longshot:fix-2725-speaker-prefetch-channels into main 2026-11-28 18:53:56 +00:00
Member

Summary

With a DualSense on a cable, the game sends some sounds to the controller's own speaker. Menu sounds are one of them, and their default is "Controller only". On main, most menu chimes then come out of the PC's right speaker (or the right headphone side) alone. This happens on any output, 7.1 included: the title screen's Continue, cycling the Start menu's tabs, and so on. Nothing is wrong with the 7.1 output or its channel order.

The cause is the controller speaker's sound classes. A stereo sound plays as two mono voices, one per channel. Each wave buffer the game queues gets its class from the BWAV whose channel starts there. The lookup took a channel's start from +0x30 of the BWAV's channel table, but +0x30 is where the channel's samples sit in the whole wave. The game plays from the wave in the archive in memory, which +0x34 names. The two agree for every channel of a short sound. Most of the game's longer stereo sounds are prefetch waves, though: their archive holds only the first part of each channel, and the rest is streamed. There the two agree for the first channel alone. So a menu chime's left channel was classed and went to the controller only, while its right channel went unclassed and stayed in the TV's mix. In the game's interface archive, 35 of its stereo and surround waves are like this; so are the ocarina's 24 stereo waves, and 4 of Navi's.

This reads +0x34 in both places that take a channel's start: the search behind a wave buffer (audio_source_find_back, host/audio_source.h) and the channels kept from a header once found (known_channels, host/audio_source.c).

To see it on main: a DualSense on a cable, the Controller speaker page at its defaults, Continue at the title screen, then cycle the Start menu's tabs. The chimes are heard from the right side only.

Fixes #2725. The reporter has since said the problem was the DualSense one (their log shows a cabled DualSense Edge with its speaker playing). Longshot#2233 (menu sounds on one headphone side only, gone with Menu sounds at Off or Controller + TV) looks like the same cause: this should fix its first half, but it isn't closed here. Its second half, a global opt-out, is a separate request.

Read first: BWAV_CHANNEL_SAMPLES in host/audio_source.h.

Testing

Tested: Windows 11 Pro (26300), RTX 5080, against the shared base of main @ 22d0d200 (dev.py pack / rt, rt --empty for main), through the queue (--mode shared).

With a DualSense on USB (its speaker on its own stream; the Controller speaker page at its defaults; a stereo PC output), main and this PR played the same scripted run through the control bridge, from the repository's kokiri-start save: Continue at the title screen, the Start menu opened, its tabs cycled three times each way, closed. HOS_AUDIO_DUMP recorded what the PC's output played, and HOS_AUDIO_SOURCE_TRACE=1 logged the classes.

  • Main: each sound was classed on one voice of its stereo pair. The PC's output had 23 stretches where the right channel ran at least 9 dB over the left, 4.06 s in all. The long ones fell on the title screen's presses (1.2 s, 0.3 s, 0.2 s) and on the Start menu's open and tab chimes (0.8 s, 0.6 s): the chimes' right halves, left on the TV. Over the whole run the left channel was 2.6 dB below the right.
  • This PR: both voices of each stereo pair were classed, and all six of the six-channel pick-up. The PC's output had 16 such stretches, 0.58 s in all, each 20 to 100 ms during play (the world's own sounds panned right), and none on the title screen or in the Start menu. Left and right were within 0.5 dB.

By ear, the same DualSense with headphones on a USB DAC (a FiiO Q series), main and then this PR, the same run with longer pauses: on main the menu chimes came from the controller and from the headphones' right side too; with this PR only from the controller, and everything else played as expected (the game's music and world in the headphones, the chimes and the other classed sounds on the pad, with no crackle).

Before that, with no DualSense yet (without one the speaker's route never opens, so the class lookup never runs), a local build (not pushed) forced the route on and could switch between main's offset (+0x30) and this one (+0x34). It showed the same on the game's own sounds. The same scripted run was played on each side through the control bridge, from the repository's kokiri-start save, with HOS_AUDIO_SOURCE_TRACE=1: Continue at the title screen, Start menu open, its tabs cycled three times each way, closed.

  • Main's offset: each sound's class was logged on one voice. That's the title screen's chimes on voice 6 while 7 played their right channel; the Start menu's on 15 or 17; a pick-up's six-channel sound on voice 6 alone.
  • This PR's offset: the same sounds were classed on both voices of each stereo pair (6/7, 7/8, 18/19), and on all six voices of the six-channel one (6 to 11). The one sound left on a single voice is mono in its archive.
  • This PR's build as it is, the same scripted run: the title screen, Continue into play, the Start menu and its tabs, then quit with stop: close work done. Audio opened as before (stereo device), nothing classed (no DualSense).
  • The user's saves and options were backed up first and are byte-identical after the runs (diff -rq).

Checks: tests/test_audio_source.py and tests/test_audio_source_load.py fail on main @ 22d0d200 at the prefetch wave's second channel and pass here. Each was checked against main's offset again: the load test fails with +0x30 and passes with +0x34. Both also pass on Linux (Ubuntu 24.04 under WSL, gcc, the first one with ASan and UBSan); the load check compiles host/audio_source.c there. The other audio and pad speaker checks pass. mise run test (with the build's llvm-mingw clang): 632 passed, 209 failed, 47 skipped. The same 209 fail on main @ 22d0d200 with the same tools: most need gcc, g++ or glslang, which this PC lacks. None fails only here. CI's "Third-party parts and guide screenshots" job fails on this head on scripts/check_guide_screenshots.py --review-sources. It fails the same way on main @ 22d0d200: the same 14 reviewed sources of settings-graphics.png (game/game.h, gpu/vk/vk_menu.cpp and others) no longer match their recorded hashes. This PR changes none of them. Longshot#2724 recaptures that image at 22d0d200 and passes the check, so after it merges, a rebase here passes too.

Still to test:

  • The reporter's setup (Windows, a 7.1 output, Speaker layout 5.1, a DualSense on a cable), on a build with this PR: Continue at the title screen, then cycle the Start menu's tabs, expecting the chimes from the controller only, none from the PC's speakers (by hand, the reporter)
  • Linux, a DualSense on a cable, the Controller speaker page at its defaults, on a build with this PR: Continue at the title screen, cycle the Start menu's tabs, and play a few ocarina notes. Expect the menu chimes from the controller only ("Controller only"), and the ocarina from both the controller and the PC ("Controller + TV"). The lookup reads the game's memory through Linux's own readable-memory path, and this PC (Windows) has no Linux with USB (by hand, a team member on Linux with a cabled DualSense)

Measurements

Verdict: a correctness fix with no change in cost: one table offset read in place of another, in the same searches. The before and after are the classes the game's own sounds got in the game.

Setup: Windows 11, RTX 5080, a DualSense on USB, stereo PC output; the same scripted run on each side (above); the classes logged by HOS_AUDIO_SOURCE_TRACE=1, the PC's output recorded by HOS_AUDIO_DUMP and read in 20 ms windows.

Before: main @ 22d0d200 After: this PR @ 0b701b22
Voices classed per stereo sound played (title screen, Start menu, a pick-up) 1 of 2 (1 of 6 for the six-channel one) 2 of 2 (6 of 6)
PC output: stretches with the right channel 9 dB or more over the left 23, 4.06 s (title screen and Start menu among them) 16, 0.58 s (none on the title screen or in the Start menu)
PC output: left against right over the run -2.6 dB -0.5 dB
tests/test_audio_source.py, tests/test_audio_source_load.py fail (second channel not found) pass

Risks

The class lookup runs only while a DualSense on a cable plays the controller speaker; nothing else changes. With it, the right channels of the game's longer stereo sounds now follow their class's choice: at "Controller only" (menu sounds, pick-ups, targeting) they leave the TV's mix, as their left channels already did. At either setting they now reach the pad too. Each channel is its own mono voice, so the pad gets the two channels added where it had the left alone: up to 6 dB louder there for a sound whose sides are alike. Main already does this for the short stereo sounds (both channels found, added on the pad), so the long ones now match them. The speaker's limiter is still after it. For a short wave, +0x34 equals +0x30, so its result is unchanged. A revert is enough to undo it. Nothing changes in saves, longshot_options.ini or the caches.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary With a DualSense on a cable, the game sends some sounds to the controller's own speaker. Menu sounds are one of them, and their default is "Controller only". On main, most menu chimes then come out of the PC's **right** speaker (or the right headphone side) alone. This happens on any output, 7.1 included: the title screen's Continue, cycling the Start menu's tabs, and so on. Nothing is wrong with the 7.1 output or its channel order. The cause is the controller speaker's sound classes. A stereo sound plays as two mono voices, one per channel. Each wave buffer the game queues gets its class from the BWAV whose channel starts there. The lookup took a channel's start from +0x30 of the BWAV's channel table, but +0x30 is where the channel's samples sit in the **whole** wave. The game plays from the wave in the archive in memory, which +0x34 names. The two agree for every channel of a short sound. Most of the game's longer stereo sounds are prefetch waves, though: their archive holds only the first part of each channel, and the rest is streamed. There the two agree for the first channel alone. So a menu chime's left channel was classed and went to the controller only, while its right channel went unclassed and stayed in the TV's mix. In the game's interface archive, 35 of its stereo and surround waves are like this; so are the ocarina's 24 stereo waves, and 4 of Navi's. This reads +0x34 in both places that take a channel's start: the search behind a wave buffer (`audio_source_find_back`, `host/audio_source.h`) and the channels kept from a header once found (`known_channels`, `host/audio_source.c`). To see it on main: a DualSense on a cable, the Controller speaker page at its defaults, Continue at the title screen, then cycle the Start menu's tabs. The chimes are heard from the right side only. Fixes #2725. The reporter has since said the problem was the DualSense one (their log shows a cabled DualSense Edge with its speaker playing). [Longshot#2233](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/2233) (menu sounds on one headphone side only, gone with Menu sounds at Off or Controller + TV) looks like the same cause: this should fix its first half, but it isn't closed here. Its second half, a global opt-out, is a separate request. Read first: `BWAV_CHANNEL_SAMPLES` in `host/audio_source.h`. ## Testing **Tested:** Windows 11 Pro (26300), RTX 5080, against the shared base of main @ 22d0d200 (`dev.py pack` / `rt`, `rt --empty` for main), through the queue (`--mode shared`). With a DualSense on USB (its speaker on its own stream; the Controller speaker page at its defaults; a stereo PC output), main and this PR played the same scripted run through the control bridge, from the repository's `kokiri-start` save: Continue at the title screen, the Start menu opened, its tabs cycled three times each way, closed. `HOS_AUDIO_DUMP` recorded what the PC's output played, and `HOS_AUDIO_SOURCE_TRACE=1` logged the classes. - Main: each sound was classed on one voice of its stereo pair. The PC's output had 23 stretches where the right channel ran at least 9 dB over the left, 4.06 s in all. The long ones fell on the title screen's presses (1.2 s, 0.3 s, 0.2 s) and on the Start menu's open and tab chimes (0.8 s, 0.6 s): the chimes' right halves, left on the TV. Over the whole run the left channel was 2.6 dB below the right. - This PR: both voices of each stereo pair were classed, and all six of the six-channel pick-up. The PC's output had 16 such stretches, 0.58 s in all, each 20 to 100 ms during play (the world's own sounds panned right), and none on the title screen or in the Start menu. Left and right were within 0.5 dB. By ear, the same DualSense with headphones on a USB DAC (a FiiO Q series), main and then this PR, the same run with longer pauses: on main the menu chimes came from the controller and from the headphones' right side too; with this PR only from the controller, and everything else played as expected (the game's music and world in the headphones, the chimes and the other classed sounds on the pad, with no crackle). Before that, with no DualSense yet (without one the speaker's route never opens, so the class lookup never runs), a local build (not pushed) forced the route on and could switch between main's offset (+0x30) and this one (+0x34). It showed the same on the game's own sounds. The same scripted run was played on each side through the control bridge, from the repository's `kokiri-start` save, with `HOS_AUDIO_SOURCE_TRACE=1`: Continue at the title screen, Start menu open, its tabs cycled three times each way, closed. - Main's offset: each sound's class was logged on **one** voice. That's the title screen's chimes on voice 6 while 7 played their right channel; the Start menu's on 15 or 17; a pick-up's six-channel sound on voice 6 alone. - This PR's offset: the same sounds were classed on **both** voices of each stereo pair (6/7, 7/8, 18/19), and on all six voices of the six-channel one (6 to 11). The one sound left on a single voice is mono in its archive. - This PR's build as it is, the same scripted run: the title screen, Continue into play, the Start menu and its tabs, then quit with `stop: close work done`. Audio opened as before (stereo device), nothing classed (no DualSense). - The user's saves and options were backed up first and are byte-identical after the runs (`diff -rq`). Checks: `tests/test_audio_source.py` and `tests/test_audio_source_load.py` fail on main @ 22d0d200 at the prefetch wave's second channel and pass here. Each was checked against main's offset again: the load test fails with +0x30 and passes with +0x34. Both also pass on Linux (Ubuntu 24.04 under WSL, gcc, the first one with ASan and UBSan); the load check compiles `host/audio_source.c` there. The other audio and pad speaker checks pass. `mise run test` (with the build's llvm-mingw clang): 632 passed, 209 failed, 47 skipped. The same 209 fail on main @ 22d0d200 with the same tools: most need gcc, g++ or glslang, which this PC lacks. None fails only here. CI's "Third-party parts and guide screenshots" job fails on this head on `scripts/check_guide_screenshots.py --review-sources`. It fails the same way on main @ 22d0d200: the same 14 reviewed sources of `settings-graphics.png` (`game/game.h`, `gpu/vk/vk_menu.cpp` and others) no longer match their recorded hashes. This PR changes none of them. [Longshot#2724](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2724) recaptures that image at 22d0d200 and passes the check, so after it merges, a rebase here passes too. **Still to test:** - The reporter's setup (Windows, a 7.1 output, Speaker layout 5.1, a DualSense on a cable), on a build with this PR: Continue at the title screen, then cycle the Start menu's tabs, expecting the chimes from the controller only, none from the PC's speakers (by hand, the reporter) - Linux, a DualSense on a cable, the Controller speaker page at its defaults, on a build with this PR: Continue at the title screen, cycle the Start menu's tabs, and play a few ocarina notes. Expect the menu chimes from the controller only ("Controller only"), and the ocarina from both the controller and the PC ("Controller + TV"). The lookup reads the game's memory through Linux's own readable-memory path, and this PC (Windows) has no Linux with USB (by hand, a team member on Linux with a cabled DualSense) ## Measurements **Verdict:** a correctness fix with no change in cost: one table offset read in place of another, in the same searches. The before and after are the classes the game's own sounds got in the game. Setup: Windows 11, RTX 5080, a DualSense on USB, stereo PC output; the same scripted run on each side (above); the classes logged by `HOS_AUDIO_SOURCE_TRACE=1`, the PC's output recorded by `HOS_AUDIO_DUMP` and read in 20 ms windows. | | Before: main @ 22d0d200 | After: this PR @ 0b701b22 | |---|---|---| | Voices classed per stereo sound played (title screen, Start menu, a pick-up) | 1 of 2 (1 of 6 for the six-channel one) | 2 of 2 (6 of 6) | | PC output: stretches with the right channel 9 dB or more over the left | 23, 4.06 s (title screen and Start menu among them) | 16, 0.58 s (none on the title screen or in the Start menu) | | PC output: left against right over the run | -2.6 dB | -0.5 dB | | `tests/test_audio_source.py`, `tests/test_audio_source_load.py` | fail (second channel not found) | pass | ## Risks The class lookup runs only while a DualSense on a cable plays the controller speaker; nothing else changes. With it, the right channels of the game's longer stereo sounds now follow their class's choice: at "Controller only" (menu sounds, pick-ups, targeting) they leave the TV's mix, as their left channels already did. At either setting they now reach the pad too. Each channel is its own mono voice, so the pad gets the two channels added where it had the left alone: up to 6 dB louder there for a sound whose sides are alike. Main already does this for the short stereo sounds (both channels found, added on the pad), so the long ones now match them. The speaker's limiter is still after it. For a short wave, +0x34 equals +0x30, so its result is unchanged. A revert is enough to undo it. Nothing changes in saves, `longshot_options.ini` or the caches. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Most of the game's stereo menu sounds, and the ocarina's, are prefetch waves in their archives: each channel's
first samples, the rest streamed. A channel's +0x30 names where its samples are in the whole wave, its +0x34 where
they are in the archive in memory, which is what the game plays from. The class lookup reads +0x30, so only the first
channel (where the two agree) is found. Fails on main: the second channel is not classed.

Refs #2725

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(audio): a stereo menu sound plays whole on the controller, not its right side on the TV
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Failing after 12s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 11s
PR description / Title and description (pull_request_target) Successful in 6s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m44s
CI / Website build and checks (pull_request) Failing after 50s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Failing after 11m27s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Failing after 11m46s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 15m2s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 25m8s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 39m46s
0b701b22dc
The controller speaker's classes found a wave buffer's asset by the channel offset at +0x30 of the BWAV's channel
table. That is where the channel's samples are in the whole wave; the game plays from the wave in its archive, at
+0x34. The two agree for every channel of a short sound, but most of the game's longer stereo sounds (the menu's, the
ocarina's) are prefetch waves, and there they agree for the first channel alone. So a menu sound's left channel was
classed and played on the controller only (Menu sounds' default, "Controller only"), while its right channel went
unclassed and stayed in the TV's mix: the chime out of the right speaker alone, on any output.

Both the search and the channels kept from a found header now read +0x34.

Fixes #2725

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11 Pro 26300, RTX 5080, against main's base 22d0d200 through the queue. No DualSense here, so a local build (not pushed) forced the speaker's route on and switched between main's offset and this one. The same scripted run on each side (kokiri-start save: Continue at the title screen, the Start menu's tabs cycled both ways, HOS_AUDIO_SOURCE_TRACE=1): main's classed one voice of each stereo pair (the left), this PR's classed both, and all six of a six-channel pick-up. This PR's own build played the same run (title, Continue, Start menu, quit) with audio as before and a clean close. Still to test: the sound itself on a cabled DualSense, by hand.

Tested in game: Windows 11 Pro 26300, RTX 5080, against main's base 22d0d200 through the queue. No DualSense here, so a local build (not pushed) forced the speaker's route on and switched between main's offset and this one. The same scripted run on each side (kokiri-start save: Continue at the title screen, the Start menu's tabs cycled both ways, HOS_AUDIO_SOURCE_TRACE=1): main's classed one voice of each stereo pair (the left), this PR's classed both, and all six of a six-channel pick-up. This PR's own build played the same run (title, Continue, Start menu, quit) with audio as before and a clean close. Still to test: the sound itself on a cabled DualSense, by hand.
Author
Member

Tested on a real DualSense (USB, its own speaker stream, the Controller speaker page at its defaults, stereo PC output): main and this PR played the same scripted run (kokiri-start: Continue at the title screen, the Start menu's tabs cycled both ways) with HOS_AUDIO_DUMP recording the PC's output. Main left the chimes' right halves on the PC: 23 stretches with the right channel 9 dB or more over the left, 4.06 s, the long ones on the title screen's presses and the Start menu's chimes. This PR: 16 short ones (0.58 s, the world's own sounds during play), none on the title screen or in the Start menu; both voices of every stereo sound classed. Testing, Still to test (the reporter's 7.1 setup, a listen for the pad's loudness) and Measurements updated.

Tested on a real DualSense (USB, its own speaker stream, the Controller speaker page at its defaults, stereo PC output): main and this PR played the same scripted run (kokiri-start: Continue at the title screen, the Start menu's tabs cycled both ways) with HOS_AUDIO_DUMP recording the PC's output. Main left the chimes' right halves on the PC: 23 stretches with the right channel 9 dB or more over the left, 4.06 s, the long ones on the title screen's presses and the Start menu's chimes. This PR: 16 short ones (0.58 s, the world's own sounds during play), none on the title screen or in the Start menu; both voices of every stereo sound classed. Testing, Still to test (the reporter's 7.1 setup, a listen for the pad's loudness) and Measurements updated.
Author
Member

Listened to by ear with the DualSense and headphones on a USB DAC, main and then this PR, the same scripted run with longer pauses: on main the menu chimes came from the controller and from the headphones' right side too; with this PR only from the controller, and everything else played as expected. Tested updated; the pad loudness check is off Still to test, which keeps the reporter's 7.1 setup.

Listened to by ear with the DualSense and headphones on a USB DAC, main and then this PR, the same scripted run with longer pauses: on main the menu chimes came from the controller and from the headphones' right side too; with this PR only from the controller, and everything else played as expected. Tested updated; the pad loudness check is off Still to test, which keeps the reporter's 7.1 setup.
Author
Member

The reporter has since said the problem was the DualSense one, which matches the cause here. Summary notes it; Still to test is now the reporter checking a build with this PR on their own 7.1 setup.

The reporter has since said the problem was the DualSense one, which matches the cause here. Summary notes it; Still to test is now the reporter checking a build with this PR on their own 7.1 setup.
Author
Member

Summary's line on the reporter: only what they said (it was the DualSense issue), with what their log shows kept apart.

Summary's line on the reporter: only what they said (it was the DualSense issue), with what their log shows kept apart.
Author
Member
@review
BeanBot left a comment

Recommendation: Request changes. The Windows DualSense run shows that the menu chimes now route together to the controller. The reporter’s 7.1 setup and an in-game Linux controller run remain to be checked before merge. (It stands on L3: The check CI / Third-party parts and guide screenshots (pull_request) fails on this head and passes on the base branch: Failing after 12s.)

The change looks up channel starts using their offsets in the in-memory prefetch wave, so both sides of longer stereo sounds follow their controller-speaker setting. It changes two offset reads without adding a switch or a new search.

Blocking (1): must change before merging.

  1. L3: The check CI / Third-party parts and guide screenshots (pull_request) fails on this head and passes on the base branch: Failing after 12s.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L1: The reporter’s 7.1 setup is still awaiting the promised check. When: With a wired DualSense and the reporter’s 7.1 output and 5.1 speaker layout, the changed routing has not yet been heard in the reported failing setup. Do: Have the reporter test Continue and the Start menu tabs on this build and record whether the chimes play only on the controller.
  • L2 host/audio_source.h:147: The changed lookup has not been exercised in the game with a wired DualSense on Linux. (more on the line) Do: Run the menu and a longer classed sound with a wired DualSense on Linux, checking controller-only and controller-plus-TV routing.

@fix can do L3.

Checks: Still running: 7 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes. On Windows with a wired DualSense, the reported run classed both voices of each stereo pair instead of one; right-heavy stretches on the PC output fell from 4.06 seconds to 0.58 seconds, with none remaining in the tested menus. The author also heard the menu chimes only on the controller after the change.

Other systems: The lookup runs when a wired DualSense speaker route is active, independently of GPU vendor. It can change routing for other classed prefetch sounds, including ocarina and pick-up sounds; the Windows run covered a six-channel pick-up, but an in-game Linux run and the reporter’s 7.1 setup remain untested. Saves, build tools, and the renderer interface are unchanged.

Switches: None added, changed, or removed.

Reviewed: 0b701b22dc against 22d0d20098: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, both commits, the full diff and all four changed files. Read the wave-buffer caller and relevant mixer routing; skimmed other controller-speaker call sites. docs/review-checklist.md and the sibling Tooling AGENTS.md were absent. No generated files or recorded runs were changed.; nothing run (a code review).

Checked and fine:

  • The added fixtures distinguish the two channel offsets and exercise both the search and cached-channel lookup.
  • The changed channel-table reads are bounded by the existing BWAV header validation.
  • The commits include AI-assistance trailers; no game-derived output, generated files, or third-party files are added.
  • The audio lock serializes the cached channel lookup, and table readiness is published with interlocked operations.

Testing: Read-only review; no builds, tests, scripts, or game runs were executed. The author reports both new checks passing on Windows and Linux, and an in-game Windows DualSense comparison. CI has a head-only failure and several checks still running; the supplied CI result is left to the bot.

Overlaps and merge order: Not checked; the network is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The Windows DualSense run shows that the menu chimes now route together to the controller. The reporter’s 7.1 setup and an in-game Linux controller run remain to be checked before merge. (It stands on L3: The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head and passes on the base branch: Failing after 12s.) The change looks up channel starts using their offsets in the in-memory prefetch wave, so both sides of longer stereo sounds follow their controller-speaker setting. It changes two offset reads without adding a switch or a new search. **Blocking (1)**: must change before merging. 1. **L3**: The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head and passes on the base branch: Failing after 12s. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L1**: The reporter’s 7.1 setup is still awaiting the promised check. *When:* With a wired DualSense and the reporter’s 7.1 output and 5.1 speaker layout, the changed routing has not yet been heard in the reported failing setup. **Do:** Have the reporter test Continue and the Start menu tabs on this build and record whether the chimes play only on the controller. - **L2** `host/audio_source.h:147`: The changed lookup has not been exercised in the game with a wired DualSense on Linux. (more on the line) **Do:** Run the menu and a longer classed sound with a wired DualSense on Linux, checking controller-only and controller-plus-TV routing. `@fix` can do L3. **Checks:** Still running: 7 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. On Windows with a wired DualSense, the reported run classed both voices of each stereo pair instead of one; right-heavy stretches on the PC output fell from 4.06 seconds to 0.58 seconds, with none remaining in the tested menus. The author also heard the menu chimes only on the controller after the change. **Other systems:** The lookup runs when a wired DualSense speaker route is active, independently of GPU vendor. It can change routing for other classed prefetch sounds, including ocarina and pick-up sounds; the Windows run covered a six-channel pick-up, but an in-game Linux run and the reporter’s 7.1 setup remain untested. Saves, build tools, and the renderer interface are unchanged. **Switches:** None added, changed, or removed. **Reviewed:** 0b701b22dcf0 against 22d0d20098d6: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, both commits, the full diff and all four changed files. Read the wave-buffer caller and relevant mixer routing; skimmed other controller-speaker call sites. docs/review-checklist.md and the sibling Tooling AGENTS.md were absent. No generated files or recorded runs were changed.; nothing run (a code review). **Checked and fine:** - The added fixtures distinguish the two channel offsets and exercise both the search and cached-channel lookup. - The changed channel-table reads are bounded by the existing BWAV header validation. - The commits include AI-assistance trailers; no game-derived output, generated files, or third-party files are added. - The audio lock serializes the cached channel lookup, and table readiness is published with interlocked operations. **Testing:** Read-only review; no builds, tests, scripts, or game runs were executed. The author reports both new checks passing on Windows and Linux, and an in-game Windows DualSense comparison. CI has a head-only failure and several checks still running; the supplied CI result is left to the bot. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -140,3 +145,3 @@
const unsigned channels = audio_source_u16(b + BWAV_CHANNELS);
for (unsigned ch = 0; ch < channels; ch++)
if (audio_source_u32(b + BWAV_HEADER + ch * BWAV_CHANNEL + BWAV_CHANNEL_DATA) == back) {
if (audio_source_u32(b + BWAV_HEADER + ch * BWAV_CHANNEL + BWAV_CHANNEL_SAMPLES) == back) {
Member

L2 (should fix): The changed lookup has not been exercised in the game with a wired DualSense on Linux.

When: Linux uses a different readable-memory path for this lookup, while the reported Linux checks use a synthetic archive rather than the live controller route.

Do: Run the menu and a longer classed sound with a wired DualSense on Linux, checking controller-only and controller-plus-TV routing.

**L2** (should fix): The changed lookup has not been exercised in the game with a wired DualSense on Linux. *When:* Linux uses a different readable-memory path for this lookup, while the reported Linux checks use a synthetic archive rather than the live controller route. **Do:** Run the menu and a longer classed sound with a wired DualSense on Linux, checking controller-only and controller-plus-TV routing.
Author
Member
@fix
Member

Nothing needed changing: the review's items are already done.

Not done

  • Guide screenshot check: The supplied log omits the 14 affected filenames. The manifest, checker, screenshot inputs, and recorded UI sources are unchanged from base 22d0d200, so the reported base/head difference cannot be explained from this checkout. The full REVIEW REQUIRED lines are needed to identify and review the failing inputs. No checks were run.

For the author (no edit does these)

  • L1: The reporter’s 7.1 setup is still awaiting the promised check. When: With a wired DualSense and the reporter’s 7.1 output and 5.1 speaker layout, the changed routing has not yet been heard in the reported failing setup. Do: Have the reporter test Continue and the Start menu tabs on this build and record whether the chimes play only on the controller.
  • L2 host/audio_source.h:147: The changed lookup has not been exercised in the game with a wired DualSense on Linux. When: Linux uses a different readable-memory path for this lookup, while the reported Linux checks use a synthetic archive rather than the live controller route. Do: Run the menu and a longer classed sound with a wired DualSense on Linux, checking controller-only and controller-plus-TV routing.

Nothing was pushed.


Automated fix by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

Nothing needed changing: the review's items are already done. **Not done** - **Guide screenshot check**: The supplied log omits the 14 affected filenames. The manifest, checker, screenshot inputs, and recorded UI sources are unchanged from base 22d0d200, so the reported base/head difference cannot be explained from this checkout. The full REVIEW REQUIRED lines are needed to identify and review the failing inputs. No checks were run. **For the author** (no edit does these) - **L1**: The reporter’s 7.1 setup is still awaiting the promised check. *When:* With a wired DualSense and the reporter’s 7.1 output and 5.1 speaker layout, the changed routing has not yet been heard in the reported failing setup. **Do:** Have the reporter test Continue and the Start menu tabs on this build and record whether the chimes play only on the controller. - **L2** `host/audio_source.h:147`: The changed lookup has not been exercised in the game with a wired DualSense on Linux. *When:* Linux uses a different readable-memory path for this lookup, while the reported Linux checks use a synthetic archive rather than the live controller route. **Do:** Run the menu and a longer classed sound with a wired DualSense on Linux, checking controller-only and controller-plus-TV routing. Nothing was pushed. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
Author
Member

Replies to the review:

  • L3, the guide screenshot check: this check fails on main too, not only on this head. I ran the job's step (scripts/check_guide_screenshots.py --review-sources) on a clean LF export of main @ 22d0d200 and of this head. Both print the same 14 REVIEW REQUIRED lines, all for settings-graphics.png: game/game.h, gpu/render/rx_nvn.h, gpu/vk/display_modes.h, gpu/vk/menu/controller.cpp, gpu/vk/menu/output.cpp, gpu/vk/menu_i18n.h, gpu/vk/vk_api.h, gpu/vk/vk_dlss.h, gpu/vk/vk_menu.cpp, gpu/vk/vk_menu.h, gpu/vk/vk_menu_i18n.cpp, gpu/vk/vk_paths.h, gpu/vk/vk_texture.h and host/hos_wide_size.h, each "changed since reviewed revision". This PR changes none of them (only host/audio_source.c, host/audio_source.h and two tests). The "passes on main" was against an older result: main's own CI run for 22d0d200 hasn't run yet (every job pending). The guide's README asks for a human review of the pictured UI, never an automatic hash refresh, so it isn't something this audio fix should stamp. Longshot#2724 already recaptures settings-graphics.png at 22d0d200, and the check passes on its head (d1472268). Once it merges I'll rebase this one and the job should pass. Testing names this.
  • L1, the reporter's 7.1 setup: kept under Still to test, run by hand by the reporter on a build with this PR.
  • L2, Linux with a cabled DualSense: added under Still to test: by hand, a team member on Linux with a cabled DualSense, checking both "Controller only" (the menu chimes) and "Controller + TV" (the ocarina). This PC is Windows, and its WSL has no USB passthrough for the pad.

No code changed and main hasn't moved (22d0d200), so nothing was pushed. The checks were run again here: test_audio_source.py and test_audio_source_load.py pass; check_third_party.py (with and without --base) passes.

Replies to the review: - **L3, the guide screenshot check:** this check fails on main too, not only on this head. I ran the job's step (`scripts/check_guide_screenshots.py --review-sources`) on a clean LF export of main @ 22d0d200 and of this head. Both print the same 14 `REVIEW REQUIRED` lines, all for `settings-graphics.png`: `game/game.h`, `gpu/render/rx_nvn.h`, `gpu/vk/display_modes.h`, `gpu/vk/menu/controller.cpp`, `gpu/vk/menu/output.cpp`, `gpu/vk/menu_i18n.h`, `gpu/vk/vk_api.h`, `gpu/vk/vk_dlss.h`, `gpu/vk/vk_menu.cpp`, `gpu/vk/vk_menu.h`, `gpu/vk/vk_menu_i18n.cpp`, `gpu/vk/vk_paths.h`, `gpu/vk/vk_texture.h` and `host/hos_wide_size.h`, each "changed since reviewed revision". This PR changes none of them (only `host/audio_source.c`, `host/audio_source.h` and two tests). The "passes on main" was against an older result: main's own CI run for 22d0d200 hasn't run yet (every job pending). The guide's README asks for a human review of the pictured UI, never an automatic hash refresh, so it isn't something this audio fix should stamp. [Longshot#2724](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2724) already recaptures `settings-graphics.png` at 22d0d200, and the check passes on its head (d1472268). Once it merges I'll rebase this one and the job should pass. Testing names this. - **L1, the reporter's 7.1 setup:** kept under Still to test, run by hand by the reporter on a build with this PR. - **L2, Linux with a cabled DualSense:** added under Still to test: by hand, a team member on Linux with a cabled DualSense, checking both "Controller only" (the menu chimes) and "Controller + TV" (the ocarina). This PC is Windows, and its WSL has no USB passthrough for the pad. No code changed and main hasn't moved (22d0d200), so nothing was pushed. The checks were run again here: `test_audio_source.py` and `test_audio_source_load.py` pass; `check_third_party.py` (with and without `--base`) passes.
HumanBean deleted branch fix-2725-speaker-prefetch-channels 2026-11-28 18:53:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2728
No description provided.