Skip to content

feat(opus): implement 48 kHz libSceOpusDec - #1823

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
Mouhand-Kaddo:feat/sce-opus-dec
Oct 9, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
Mouhand-Kaddo:feat/sce-opus-dec

Conversation

@Mouhand-Kaddo

Copy link
Copy Markdown
Contributor

What

Add the six libSceOpusDec exports required by ProsperoRadio in #1578. Reuse FFmpeg for persistent 48 kHz mono/stereo decoders with interleaved signed-16 PCM. Decode returns bytes and checks byte capacity before consuming a packet.

The ABI and 640-byte opaque state size follow public PS5 decoder research. Other sample rates, packet loss concealment and unsupported lifecycle/error paths throw. Firmware error codes and exact PCM equivalence remain unverified and are recorded in TechnicalDebt.

Tested

Linux x86-64. guest_opus_dec passes real consecutive packets, byte counts, amplitude, mono output, decoder persistence, independent contexts, capacity canaries and lifecycle checks. Standalone ASan/UBSan passes. Existing AJM, JPEG and PNG decoder tests also pass.

A local consumer compiled for FreeBSD against ps5-payload-sdk v0.43 headers passes through the patched NID exports. It checks 32-bit contexts, PCM byte counts and output guards. SDK tooling is outside the repository. No PS5 or Windows execution was performed.

The released ProsperoRadio 01.000.010 binary previously stopped at missing libSceOpusDec.prx. With this module it reaches the next missing library, libSceOpusCeltDec.prx. All six OpusDec imports resolve. This does not make the title run.

Independent code review passes both standards and spec, with no actionable findings.

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 permitted namespace endings
  • Unsupported paths throw and known gaps are listed in TechnicalDebt
  • No investigation notes, images or SDK tooling added to the repository
  • Reuses existing bundled dependencies
  • Behaviour applies to any caller of the supported API subset
  • Depends on: none
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 8, 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
#1924 docs/dev/TechnicalDebt.md L244
#2072 docs/dev/TechnicalDebt.md L244

Decode raw mono and stereo packets for missing system-library imports. Add behavioral tests and document unverified firmware semantics.
@popcoder565

Copy link
Copy Markdown
Contributor

Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head bb3ac21c, merged onto main d70b899 in one build with 38 other PRs that had no Windows run. The current head 4c7e8232 is a rebase with the same Opus files.

No title was run.

🤖 Addressed by Claude Code

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked against the cited DECODING.md (signatures, 640-byte state, byte capacity rounded down to even): matches. Local build + ctest on top of main: guest_opus_dec passes (518/518). Decoded the test packets with libopus independently: 960 samples each, peaks 938/1041/1035/1035, consistent with the test bounds. Unverified parameters throw and are recorded in TechnicalDebt. Windows result from @popcoder565 noted. Merging once CI is green.

@adriadam10
adriadam10 merged commit 73ba24a into boykopovar:main Oct 9, 2026
5 of 7 checks passed
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Progress report (d70b899 → 4c7e823)

📈 System libraries: 84.72% (+0.03%, +6 implemented functions)

✅ 6 implemented
Library Name
libSceOpusDec sceOpusDecCreateEx
libSceOpusDec sceOpusDecDecode
libSceOpusDec sceOpusDecDestroy
libSceOpusDec sceOpusDecGetSize
libSceOpusDec sceOpusDecInitialize
libSceOpusDec sceOpusDecTerminate

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.

3 participants