Commit Graph
11 Commits
Author SHA1 Message Date
Adrià 393db570ee Merge pull request #12587 from EagleBearerYS/fix/audiodec-m4aac-extension-modes
feat(libSceAudiodec): decode M4AAC with non-delay output enabled
2026-10-29 21:18:54 +01:00
Yunus Shaikh b3b6178347 feat(libSceAudiodec): decode M4AAC with non-delay output enabled
The 28- and 32-byte M4AAC parameter blocks carry two fields at offsets
24 and 28 whose range errors fpPS4 names
SCE_AUDIODEC_ERROR_M4AAC_INVALID_ENABLE_NONDELAY_OUTPUT (0x807F0305) and
SCE_AUDIODEC_ERROR_M4AAC_INVALID_SURROUND_CHANNEL_INTERLEAVE_ORDER
(0x807F0306). shadPS4's AJM AAC decoder outputs every decoded frame from
the first one on when non-delay output is enabled, which is what the
decoder here does, so a decoder created with non-delay output 1 is
accepted and decodes as before. Surround channel interleave orders 1
and 2 still throw, now naming the order: no source says which order
each value selects. Name both errors and test that every access unit
yields its frame from the first one with non-delay output enabled.
2026-10-28 16:03:59 +00:00
al3w0f205 dbb3e716c0 test(libSceAudiodec): cover null ctrl and member pointers in sceAudiodecCreateDecoder and sceAudiodecDecode 2026-10-28 07:57:55 -05:00
PrivacyOnion bd13b15189 test(libSceAudiodec): cover invalid codec types and handle bounds in GuestAudiodec 2026-10-27 10:43:56 +01:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
boykopovar 8de11f73ee fix(audiodec): validate aac sizes and extended mode ranges 2026-10-21 21:53:27 +03:00
orezraeyandClaude Opus 5.5 bf89bd31e6 fix(libSceAudiodec): reject the PCM word sizes a PS5 rejects
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 20:38:01 -03:00
RickandClaude Opus 5.5 bb95e44e9c fix(libSceAudiodec): decode HE-AAC as the console does
ui_enable_heaac was ignored and FFmpeg applied Parametric Stereo, so an
HE-AAC v2 stream decoded to 48 kHz stereo whatever the flag: 2048
samples in 2 channels per frame, and ERROR_INVALID_PCM_SIZE for a PCM
buffer sized for the console's output. The console returns the 24 kHz
mono core with HE-AAC disabled, and SBR output at 48 kHz in one channel
with it enabled.

AAC access units now reach FFmpeg without their ADTS header, with an
AudioSpecificConfig built from the header or from the raw parameters.
With HE-AAC disabled it signals SBR as absent. With HE-AAC enabled SBR
stays implicit, and a mono stream that FFmpeg decodes to two channels
is reopened with SBR present and Parametric Stereo absent. The new test
decodes fdk-aac HE-AAC v2 and HE-AAC stereo streams, ADTS and raw, with
HE-AAC on and off; it aborts on main.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-13 17:41:48 +02:00
7647710248 test(audiodec): cover the raw M4AAC configuration search with a 5.1 stream
A raw 5.1 LC frame decodes as 6 channels with a maximum of 6 and of 8,
which is only reached by moving past the mono/stereo configuration. The
configuration search is listed under unknown function info, together with
a mono raw stream being reported as 2 channels.

Co-authored-by: Dextroid17 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 17:29:50 +02:00
PacukaandClaude Opus 5.5 7b722253a4 fix(audiodec): take the M4AAC raw channel layout from the stream
For a raw M4AAC stream the maximum channel count was written into the
AudioSpecificConfig as the channel configuration. The maximum only bounds
the stream: The Smurfs Dreams creates its decoder with 8 channels at most
and sends stereo, so FFmpeg refused configuration 8 (reserved) and a
stereo stream under configuration 6 or 7 decodes no frame. The decoder
now starts from the mono/stereo configuration and on the first access
unit that it cannot decode moves on to the configurations with more
channels, up to the maximum, keeping the first one that decodes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 17:29:46 +02:00
Adrià FranchandClaude 569c2ec56c feat(libSceAudiodec): decode MP3, M4AAC and ATRAC9
All six exports are implemented: MP3 and AAC (ADTS or raw blocks) are
decoded with the bundled FFmpeg and ATRAC9 with LibAtrac9, one unit per
call, into interleaved S16 or float PCM, with the libSceAudiodec
validation and error codes. libSceAudiodec.native is built from the same
sources.

Co-Authored-By: Claude <[email protected]>
2026-10-02 09:22:59 +02:00