feat(libSceAudiodec.native): read the Ajm ids with sceAudiodecGetAjmContext #13719
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13719"
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 zaryabzip on 2026-10-31T02:32:34Z.
What
sceAudiodecGetAjmContext(const void* context, uint32_t* ajmi, uint32_t* ajm)gets a body. It follows @BunnyFl's firmware 13.42 run oflibSceAudiodec.native.sprx, done under an emulator with imports stubbed, not on a console:0x807F0002and writes nothing.*ajmiand the one at offset 4 to*ajm, each only when its output isn't null, and the call returns 0.sceAudiodecInitializefilled the context: aftersceAudiodecTerminateit returns the old values.So the call is a plain read, and it's exact for any context, including ones this project's
sceAudiodecInitialize(still a stub) never filled.On the console only
libSceAudiodec.nativeexports this call andsceAudiodecUnregisterCodec;libSceAudiodecexports neither. Both used to sit inlibSceAudiodec/Export.cpp, which is built into both libraries, so they move intolibSceAudiodec.native/Export.cpp(second commit, after review).sceAudiodecUnregisterCodeckeeps throwing: the same run settles its arguments and local checks, but every accepted type ends in an Ajm service call whose result it returns. Both debt entries move tolibSceAudiodec.native.mdand record what the run found. libSceAudiodec.native goes from 0 to 1 of 16. libSceAudiodec loses the two exports and is now 6 of 6.Two tests:
GuestAudiodecAjmContext.cpp, linked tolibSceAudiodec.native, covers a null context (both outputs left untouched), the two ids read from offsets 0 and 4, each null output skipped, and the context left unchanged. It resolves the export at runtime through a function type that matches the new declaration, so it builds onmainand aborts there at the first call.GuestAudiodecStandardExports.cpp, linked tolibSceAudiodec, checks that the library is loaded and exportssceAudiodecInitLibrary, but exports neither moved call. Onmainit fails atsceAudiodecGetAjmContext.Tested
Windows 11 (WinLibs MinGW-w64 GCC 15.2.0 UCRT r7, CMake 4.3.1, Ninja 1.13.2) and Ubuntu 24.04 on WSL2 (GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1), both with the head
91999d11d5merged intomain0cc02f7cde.Export.cppfiles, every includer of bothinclude/Api.hppheaders, and each header compiled on its own build with no warnings.ctest -R guest_audiodec:guest_audiodec,guest_audiodec_ajm_contextandguest_audiodec_standard_exportspass on both hosts, each 3 of 3 on--repeat until-fail:3.objdump -pon Windows,nm -Don Linux, patched and unpatched):libSceAudiodec.prxhas neithersceAudiodecGetAjmContext(GkEWCZ1JH-k) norsceAudiodecUnregisterCodec(BwHzGZkW0Y4), andlibSceAudiodec.native.prxhas both.mainwith only the new test files and theirCMakeLists.txtblocks:guest_audiodec_ajm_contextbuilds and then aborts withsceAudiodecGetAjmContext not implementedon both hosts.guest_audiodec_standard_exportsbuilds and then fails withsceAudiodecGetAjmContext is exported by libSceAudiodecon both hosts.tools/check_conventions.pypasses, andtools/pr_overlap.pyreported no overlap for the first commit.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T02:36:02Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The implementation returns success from the standard
libSceAudiodectarget even though the PR's firmware report says this export exists only inlibSceAudiodec.native.What I ran
Reviewed head
8f941d036405ffeb2733456f20c765abc3b40e07, based onmain0cc02f7cde69941f651819b1f7a80f7aa722a08b; the exact-head merge preview was clean. Environment: Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0. No local compilation or C++ tests were run.Results
add_test_executableandadd_test(NAME guest_audiodec_ajm_context ...)in the changed CMake file.main; no declared dependencies.report,intake,eligibility,conventions,labels, andlibrary-portabilitypassed.windowswas pending. Linux, relinker, ASAN, register-context, and write-watch jobs were skipped by workflow selection.main; I did not reproduce these runs.Unedited output from checks
git diff --checkproduced no output and exited 0. Convention check:ABI audit:
The test-quality heuristic's output:
The aggregate precheck could not run those two workspace-only helper scripts inside its isolated PR checkout:
Negative control
mainmain's throwing stubFindings
Blocking
The implementation is in
core/libs/prx/libSceAudiodec/Export.cpp. The sharedAudiodecLibrary.cmakecompiles that file into bothlibSceAudiodecandlibSceAudiodec.native; the native target also adds its separate nativeExport.cpp. The new test explicitly loadslibSceAudiodec.prx, so it verifies that the standard library now returns success. However, the PR's firmware report and updated debt entry say this measured export exists only inlibSceAudiodec.native.sprx. As written, the standard target returns successful behavior for a symbol the PR says the console does not export from that module.Please keep the measured implementation in the native module only and test that native export. Also verify the standard module does not gain successful behavior for this symbol.
Non-blocking
The reported firmware observation was made under an emulator with imports stubbed, not on physical PS5 hardware. The PR identifies that limitation; I have not independently verified console behavior.
Sources
Export.cppfor each target, atmain0cc02f7main0cc02f7and native target declaration8f941d0Not verified
No local compile, C++ test run, physical-console run, or independent firmware emulation. Windows CI was still running; the workflow skipped Linux and relinker-related jobs.
To get this to a good state
Move the implementation and its test to the native-only export path, preserve the standard module's console-appropriate behavior, and verify both module surfaces. I will rerun the same relevant checks on the new head.