Repository navigation
feat(libSceAudiodecCpu): wrap Blu-ray LPCM output past the module's 0x43800-byte buffer - #17649
Merged
oneandonlydean merged 1 commit intoNov 12, 2026
Conversation
…x43800-byte buffer Firmware 13.42 does not refuse a stereo frame whose decoded PCM exceeds 276,480 bytes: it succeeds, writes the full decoded byte count to the caller's buffer and to ui_pcm_size and the BSI info, and repeats the samples from the start from sample 69,120 on (BunnyFl, PR 10042 comments, 145 to 255 frames at 48 kHz 16-bit). Decode that way instead of throwing: the sample loop reads input sample index modulo the output capacity in samples for every stereo rate and both widths, and the PCM-buffer refusal stays, so the full write only reaches buffers the caller declared large enough. A second wrap is unreachable: the 0x43800-byte input cap bounds 16-bit output at exactly two wraps' worth of samples and 24-bit at less. Tests: new TestDecodeWrap decodes 143, 144, 145 and 255 stereo frames at 48 kHz 16-bit through both exports and one 24-bit frame, checking the full sample sweep against the pattern, the sizes, the BSI info and canaries beyond the written range; the 145- and 255-frame cases are the measured configurations. A negative control with the wrap removed aborts in the new test.
Contributor
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
Contributor
Author
|
Manual overlap re-check after the PR 17691 shares these files only because it deletes them: it has 7,279 changed files with 1,445,257 deletions and 0 additions — a tree-wide deletion, not an implementation of anything in this area. It does not implement the LPCM output wrap or touch |
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implement the Blu-ray LPCM output wrap the firmware 13.42 measurement recorded instead of throwing: when a stereo frame decodes to more than the module's 0x43800-byte (69,120-float) output capacity, the decode still succeeds, writes the full decoded byte count to the caller's PCM buffer, reports it in
ui_pcm_sizeand the BSI info, and every sample from 69,120 on repeats the sample 69,120 earlier. The sample loop reads its input index modulo the output capacity in samples, for every stereo rate and both sample widths. The PCM-buffer refusal stays, so the full write only reaches buffers the caller declared large enough; a second wrap is unreachable because the 0x43800-byte input cap bounds the decoded output at 138,240 samples.Tested
macOS 26 (Apple Silicon), AppleClang, Release
BUILD_TESTING=ON:guest_audiodec_cpupasses. The newTestDecodeWrapcovers 143, 144 and 145 frames (the 145-frame case is the measured configuration: 139,200 bytes in, 278,400 out) and 255 frames (the measured upper end, 489,600 bytes out) at 48 kHz 16-bit through both exports, plus one 24-bit case, checking the full sample sweep against the repetition, the sizes, the BSI info and canaries beyond the written range; a negative control with the wrap removed aborts the test.python3 tools/check_conventions.py --base origin/mainpassed. The focused test needed a local uncommitted#include <thread>inRunReport.cppto build on this host, already open as #16795. No console or title run; the behavior is the 13.42 measurement.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)