Skip to content

fix(ajm): accept Opus mapping family 255 for a mono stream - #5075

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
SandstromPL:fix/ajm-opus-mono-family-255
Oct 14, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
SandstromPL:fix/ajm-opus-mono-family-255

Conversation

@SandstromPL

@SandstromPL SandstromPL commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What

@poonasor found this on NHL 27's (PPSA34063) integration branch (#4275, stop 13) and accepted it for a mono stream in poonasor/AnyPS5@3b35621bb. This carries that change onto the mapping-family code from #3831.

The title initializes a mono 48 kHz Opus decoder with 1, 48000, 255. On that branch, which predates #3831, it stopped with ... nonzero third parameter word; with the change it went on to the later stops in that table. #3831 reads the third word as the mapping family and refuses anything above 1, so main refuses the same call with sceAjmBatchJobInitialize (Opus mapping family other than 0 or 1) not implemented.

Family 255 is now accepted for one channel and decoded as a single mono stream, the same as family 0. RFC 7845 section 5.1.1 defines a family-255 stream's layout through the stream count, coupled stream count and channel mapping in its own header, and AJM's 12-byte initialize parameters carry none of them. So family 255 with more channels still throws, and the debt entry records the mono reading as assumed.

Tested

Ubuntu 24.04, GCC 13.3, full build (Release):

  • guest_ajm gains TestOpusMonoFamily255:

    • A 1, 48000, 0 and a 1, 48000, 255 instance decode the same three Opus packets. They must give identical PCM, the expected consumed and written sizes and decoded-sample totals, and the test tone's peak.
    • 2, 48000, 255 and 1, 48000, 2 must still be refused.

    On main it aborts with the error above. It passes here, 5 runs out of 5. Two mutants fail it: one accepts every family for mono, the other accepts 255 for every channel count.

  • Built at cac4e9688; the AJM sources, the test and the debt file are identical on current main.

  • NHL 27 was not rerun. Nothing past start-up has been run on main, and earlier stops in NHL 27 (PPSA34063) on Windows / AMD RX 6700 XT: reaches match loading, ~1.3 FPS #4275 are still open there (for example stop 12, fix(libkernel): keep a finished Windows thread's stack until it is joined or detached #4563).

  • tools/check_conventions.py from main passes with this title and body.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA34063 NHL 27 (PPSA34063) on Windows / AMD RX 6700 XT: reaches match loading, ~1.3 FPS #4275 (stop 13, seen on the integration branch; not yet reached on main)
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code); I reviewed and tested every line

🤖 Generated with Claude Code

Co-authored-by: poonasor <12569806+poonasor@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5647 docs/dev/debt/libSceAjm.native.md L9-10

@oneandonlydean oneandonlydean self-assigned this Oct 14, 2026
@oneandonlydean
oneandonlydean merged commit d8888df into boykopovar:main Oct 14, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants