fix(audioout2): keep each port's grain when ports share a buffer #7719
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7719"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by LuisAguilarDev on 2026-10-19T02:46:53Z.
What
Dragon Ball Xenoverse 2 (PPSA08587) plays no sound. It fills one PCM buffer and hands it to each of its three AudioOut2 ports in turn (
sceAudioOut2PortSetAttributes, attribute 0), rewriting the buffer between the sets, then advances the context. The grain is read from the buffer only when it is captured (atsceAudioOut2ContextAdvance, or at push without an advance), so every port gets the contents written last and the earlier ports play the last port's data, here silence.Each set now also copies the grain from the buffer. Once another port of the same context is given the same buffer, the grains already queued with it, and its repeat, play that copy instead of the buffer's later contents. A buffer no other port is given is still read when the grain is captured, as before. The queued-buffer and repeat rules are unchanged. The
sceAudioOut2PortSetAttributesentry indocs/dev/debt/libSceAudioOut.mddescribes the copy; the console behaviour for a buffer shared by several ports is not documented.Tested
TestBufferReusedAcrossPortsKeepsEachPortsGraininaudio_out2_port_buffers, with and withoutsceAudioOut2ContextAdvance. Without theAudioOut2Port.cppchange,audio_out2_port_buffersaborts in its first case (without an advance), so currentmainstill plays the last port's contents on every port.audio_out*tests pass;audio_out2_port_buffersin 2.5 s.tools/check_conventions.py --base upstream/mainandgit diff --checkpass.main(before #6216 and #6474): the mix peak was 0.000 in 82 of 82 seconds before; with this change it carries audio (peak 0.24-0.52) in 63 of 82 seconds, and the game is audible.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T02:47:10Z.
Thank you for your contribution! Authors with no pull requests merged into
maincan have 1 open pull request at a time, authors with at least 1 merged can have 20, and from 20 merged there is no limit. This PR has been automatically closed and labeled "open PR limit" because that limit was reached. This is not a judgment of the quality of your changes: reopen it once one of your open pull requests is merged or closed.Imported from boykopovar/AnyPS5. Originally posted by johandavidcm on 2026-10-19T14:06:23Z.
@LuisAguilarDev Yakuza 0 Director's Cut (PPSA31327, #6722) has the same pattern and is silent on
main;8d1fc2b30brings its sound back. Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, RTX 4070 (617.42), onmain40393b0f9with #6572 and #7381 (the title needs both to get past its first cutscene).sceAudioOut2ContextAdvanceandsceAudioOut2ContextPush, about 188 times per second.APS5_TRACE_AUDIOOUT2reportsmix peak 0.000in every second, and a local probe at capture found all 3072 floats of the shared buffer zero atAdvancein 30 of 30 samples.mix peakis 0.003 to 0.173 in 27 of 42 seconds (the first 9, the logos, are silent) and the menus are audible and smooth. The opening cutscene's audio is choppy, but the push rate stays at 186-188/s with 0 primes and 0 dropped, so that looks separate: the title runs at a few FPS there.ctest -R '^audio_out': 17 of 17 pass on that tree.The bot closed this only for the open-PR limit, and #6592 has merged since, so it can be reopened now; it unblocks sound for PPSA31327 too.
AI-assisted: yes
Pull request closed