Files
2026-10-20 17:55:03 -03:00

7.6 KiB

libSceAudio3d technical debt

Silent stubs

  • libSceAudio3d (libSceAudio3d) - sceAudio3dObjectSetAttributes validates the port, the reserved object and the attribute array (an object id that was never reserved returns the invalid-object error, while shadPS4 returns success for it; neither is measured on a console), treating the reset-state attribute as valid with a null value and requiring a value for the others, but the identifiers and the value of each are not interpreted, so an object has no samples, no gain and no position: the ids of the PCM, GAIN and POSITION attributes and the POSITION layout are unknown (the aerolib NID list gives the names only, the Orbital IDA type database the signatures only and shadPS4's values are PS4). sceAudio3dPortSetAttribute accepts the late reverb level and the downmix spread attributes and ignores them, and sceAudio3dPortFlush drops the frames queued by sceAudio3dPortAdvance instead of mixing and submitting them to an output

Functional

  • libSceAudio3d bed path (libSceAudio3d) - bed PCM is mixed and played: sceAudio3dBedWrite and sceAudio3dBedWrite2 queue a bed, bounded by queue_depth and NOT_READY when full, sceAudio3dPortAdvance consumes one and mixes it into a stereo frame with a linear-balance pan and a 5.1/7.1 downmix, and an advance with no bed queued mixes silence (Mixer.hpp) and queues the frame, and sceAudio3dPortPush opens a type-126 AudioOut port on first use and submits the queued frames to it. The explicit sceAudio3dAudioOutOpen, sceAudio3dAudioOutOutput and sceAudio3dAudioOutOutputs exports queue their blocks and the port drains them. The attribute enum values and the panning model are unverified

Unknown function info

  • sceAudio3dPortOpen (libSceAudio3d) - buffer modes 0 and 1 (also selected by the 0x10 and 0x18 parameter sizes) and 3 beds depend on an SDK version check in the module (prosper) and throw. A repeated sceAudio3dInitialize (NOT_READY in shadPS4, 0 in prosper) and sceAudio3dPortAdvance on a full queue (NOT_READY in shadPS4, unhandled in KytyPS5) throw too
  • sceAudio3dPortGetAttributesSupported (libSceAudio3d) - the supported list (late reverb level, downmix spread radius, downmix spread height aware) is inferred from the attributes sceAudio3dPortSetAttribute accepts; its order and the count written when the caller capacity is smaller are unverified. shadPS4 returns object attributes (PCM, gain...) instead, prosper and KytyPS5 have no body
  • sceAudio3dObjectReserve (libSceAudio3d) - object ids, the max_objects limit and the checks of sceAudio3dObjectReserve and sceAudio3dObjectUnreserve follow shadPS4 (PS4), the only reference with a body: ids count up from 1 per port, skipping 0, 0xFFFFFFFF and ids in use, and a failed reserve writes 0xFFFFFFFF
  • sceAudio3dStrError (libSceAudio3d) - unknown signature
  • sceAudio3dPortOpenEx (libSceAudio3d) - unknown signature
  • sceAudio3dPortCreate (libSceAudio3d) - unknown signature
  • sceAudio3dPortDestroy (libSceAudio3d) - unknown signature
  • sceAudio3dPortGetStatus (libSceAudio3d) - unknown signature
  • sceAudio3dReportRegisterHandler (libSceAudio3d) - unknown signature
  • sceAudio3dReportUnregisterHandler (libSceAudio3d) - unknown signature
  • sceAudio3dGetSpeakerArrayMemorySize (libSceAudio3d) - unknown signature
  • sceAudio3dCreateSpeakerArray (libSceAudio3d) - unknown signature
  • sceAudio3dDeleteSpeakerArray (libSceAudio3d) - unknown signature
  • sceAudio3dGetSpeakerArrayMixCoefficients (libSceAudio3d) - unknown signature
  • sceAudio3dGetSpeakerArrayMixCoefficients2 (libSceAudio3d) - unknown signature
  • Audio3d bed downmix coefficients (libSceAudio3d) - the centre and the surrounds fold into stereo with a 0.7071 gain and the LFE channel is dropped, which follows shadPS4 (PS4): its DOWNMIX_CENTER and DOWNMIX_SURROUND are 0.7071 and its DOWNMIX_LFE is 0, so the if constexpr that adds the LFE is compiled out. prosper disagrees on the LFE only: it folds it into both sides with a 0.5 gain, in its AudioOut2 main bed path, which is not an Audio3d path. KytyPS5 has no Audio3d mixing at all. The absolute level is unmeasured: fpPS4 scales the front by 1 + 3/sqrt(2) instead of 1
  • Audio3d bed channel order (libSceAudio3d) - the buffer is read as L, R, C, LFE, Ls, Rs, Lrs, Rrs, the standard order, which three references agree on: shadPS4 reads the front, centre, LFE and surround samples at those indices, prosper documents FL, FR, FC, LFE and then surround pairs, and fpPS4 names them _FL=0 _FR=1 _FC=2 _LF=3 _SL=4 _SR=5 _BL=6 _BR=7. fpPS4's STD layout swaps the side and back pairs, which this library does not model
  • sceAudio3dAudioOutOutput (libSceAudio3d) - the return is the number of frames per channel in the queued block, which follows KytyPS5 and prosper, whose sceAudioOutOutput returns the grain, and this project's own sceAudioOutOutput, which returns the port's samplesNum (the buffer length in frames). shadPS4 returns the total samples instead (len * channels) and fpPS4 returns 0; no console measurement settles it
  • sceAudio3dPortAdvance buffer mode (libSceAudio3d) - a mode other than 2 returns NOT_SUPPORTED (0x80EA0008), the value shadPS4 uses for it and the one prosper reads from the PS5 module's own error table, where 0x80EA0008 is what the per-port calls return for a buffer mode they do not support. shadPS4 and prosper refuse only mode 0 in sceAudio3dPortAdvance and modes 0 and 1 in sceAudio3dPortPush, while KytyPS5 requires mode 2 at sceAudio3dPortOpen and halts otherwise, so this library refuses every other mode at the open and the check here is unreachable. 0x80EA0005 is OUT_OF_MEMORY, not NOT_SUPPORTED
  • sceAudio3dPortAdvance on a full queue (libSceAudio3d) - a full queue returns NOT_READY (0x80EA0007) instead of throwing, which follows shadPS4, the only reference with a body: it returns ORBIS_AUDIO3D_ERROR_NOT_READY when the mixed queue is at the port's depth. KytyPS5 halts instead and prosper has no queue at all