Repository navigation
fix(audioout): play every AudioOut2 port buffer set between pushes, one per grain - #2536
Conversation
…ne per grain A port kept only the last PCM buffer set before a push and played it again at every later push without a new one. PPSA12544 sets one grain of a ring buffer per call on its object port, often two or three between pushes and then none for a few, so all but the last of each burst were dropped and the stale grain repeated: a buzz on loud sounds and after a sound stopped. Buffers set between pushes are now queued and played in order, at most 16 queued. A push without a new buffer repeats the last one only for a port that has always been given the same buffer (rewritten in place, as the timing tests do); a port whose buffers move on plays silence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes. |
|
Checked on the PR merged onto |
|
Thanks for merging. A correction to my description: in PPSA12544, port 3 is type 6, which is
🤖 Generated with Claude Code |
What
An AudioOut2 port kept one PCM pointer: each
sceAudioOut2PortSetAttributeswith attribute 0 overwrote it, and every push mixed whatever it pointed to. Two things went wrong when a title does not set exactly one buffer per push:PPSA12544 (Hollow Knight: Silksong) feeds its gameplay sound through an object port (type 6, created in game). Each set points at the next grain of a 64-grain ring buffer (the pointer advances by exactly 256 frames, 2048 bytes, and wraps at 128 KiB). The sets arrive in bursts: often two or three between pushes, then none for one to four pushes. So most grains were lost, and the stale one was replayed 187.5 times a second. Players hear a harsh buzz on loud sounds and after a sound ends: the needle falling in the opening sequence, and fights.
This change:
audio_out2_timingrelies on this: it points once and changes the contents between pushes.Tested
Windows 11, WinLibs GCC 15.2, RTX 3060 Laptop.
New
audio_out2_port_buffers(SDL disk driver, likeaudio_out2_port_layouts), four cases:It fails on current
mainand passes with this change.All seven
audio_out*tests pass, includingaudio_out2_timing.tools/check_conventions.py --base upstream/mainpasses.PPSA12544, measured on the final mix written to disk.
maindoes not run the title on its own, so this ran on a local branch with the Silksong PRs (fix(agc): defer shaders that cannot be prepared at registration to their first use #1836, fix(agc): leave the primitive restart index out of an indexed draw's vertex range #1968, fix(agc): read zero for vertex attributes behind a null V# #1969, feat(relinker): add --module-dir for modules loaded at run time #846, fix(agc): store GPU results over CPU-stamped bytes the CPU left unchanged #1599, fix(agc): treat other-shaped views of a depth surface's memory as reused memory #1495) and the same queue behind a switch.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code