fix(audioout2): keep each port's grain when ports share a buffer #8098
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8098"
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-19T21:36:55Z.
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
Replaces #7719, which GitHub does not allow to reopen after the open PR limit closed it. Same branch and commit; the discussion is there.
Imported from boykopovar/AnyPS5. Originally posted by LuisAguilarDev on 2026-10-19T21:39:19Z.
@johandavidcm thanks im glad it helps the sound of other games im reopening this PR
Imported from boykopovar/AnyPS5. Originally posted by johandavidcm on 2026-10-21T14:16:46Z.
Retested on current
mainwith Yakuza 0 Director's Cut (PPSA31327, #6722).Setup:
main80565c594merged with this PR's headc1929ab9b, with no conflicts.APS5_TRACE_AUDIOOUT2=1.Result:
mix peakis non-zero in 72 of the 98 one-second summaries. The first seconds of boot are silent.b7fc3d324), every summary readmix peak 0.000. I did not rerun that today.