fix(audioout): play every AudioOut2 port buffer set between pushes, one per grain #2536
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2536"
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 orbz22 on 2026-10-10T02:12:52Z.
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 (#1836, #1968, #1969, #846, #1599, #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
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T02:13:02Z.
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.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T09:17:17Z.
Checked on the PR merged onto
main: libSceAudioOut builds and all 7audio_out*tests pass (includingaudio_out2_timing);audio_out2_port_buffersaborts without the source change and passes with it. The inferred queue/repeat behaviour is recorded under Unknown function info in TechnicalDebt; merging.Imported from boykopovar/AnyPS5. Originally posted by orbz22 on 2026-10-10T15:33:32Z.
Thanks for merging. A correction to my description: in PPSA12544, port 3 is type 6, which is
AUDIO_OUT2_PORT_TYPE_PAD_VIBRATIONinAudioOut2PadMix.hpp. It is not an object port. The buffers on it are the DualSense haptics waveform, not gameplay sound.main(be403084, plus #846 for the plugins) that port is dropped in this case. In a 250 s run through the opening and into Moss Grotto, only the main port (type 0) is mixed, and nothing reaches full scale: the peak is 0.35 after the master gain.🤖 Generated with Claude Code