Repository navigation
fix(audioout2): keep each port's grain when ports share a buffer - #7719
LuisAguilarDev wants to merge 1 commit into
Conversation
A title can fill one buffer and hand it to several ports in turn before advancing the context. Reading the buffer only at push time gave every port the contents set last, so the earlier ports played silence. Each set now copies the grain, and a grain whose buffer is handed to another port afterwards plays its copy. Buffers no other port is given are still read at push time.
|
Thank you for your contribution! Authors with no pull requests merged into |
|
@LuisAguilarDev Yakuza 0 Director's Cut (PPSA31327, #6722) has the same pattern and is silent on
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 |
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 fix(audio): retain completed AudioOut2 grains until pushed #6216 and fix(libSceAudioOut): count completed AudioOut2 grains in the queue level #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