mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-21 16:12:47 -05:00
7.6 KiB
7.6 KiB
libSceAudio3d technical debt
Silent stubs
- libSceAudio3d (libSceAudio3d) -
sceAudio3dObjectSetAttributesvalidates 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 thePCM,GAINandPOSITIONattributes and thePOSITIONlayout are unknown (the aerolib NID list gives the names only, the Orbital IDA type database the signatures only and shadPS4's values are PS4).sceAudio3dPortSetAttributeaccepts the late reverb level and the downmix spread attributes and ignores them, andsceAudio3dPortFlushdrops the frames queued bysceAudio3dPortAdvanceinstead of mixing and submitting them to an output
Functional
- libSceAudio3d bed path (libSceAudio3d) - bed PCM is mixed and played:
sceAudio3dBedWriteandsceAudio3dBedWrite2queue a bed, bounded byqueue_depthandNOT_READYwhen full,sceAudio3dPortAdvanceconsumes 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, andsceAudio3dPortPushopens a type-126 AudioOut port on first use and submits the queued frames to it. The explicitsceAudio3dAudioOutOpen,sceAudio3dAudioOutOutputandsceAudio3dAudioOutOutputsexports 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_READYin shadPS4, 0 in prosper) andsceAudio3dPortAdvanceon a full queue (NOT_READYin 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
sceAudio3dPortSetAttributeaccepts; 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_objectslimit and the checks ofsceAudio3dObjectReserveandsceAudio3dObjectUnreservefollow 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_CENTERandDOWNMIX_SURROUNDare 0.7071 and itsDOWNMIX_LFEis 0, so theif constexprthat 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'sSTDlayout 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
sceAudioOutOutputreturns the grain, and this project's ownsceAudioOutOutput, which returns the port'ssamplesNum(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 insceAudio3dPortAdvanceand modes 0 and 1 insceAudio3dPortPush, while KytyPS5 requires mode 2 atsceAudio3dPortOpenand halts otherwise, so this library refuses every other mode at the open and the check here is unreachable. 0x80EA0005 isOUT_OF_MEMORY, notNOT_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 returnsORBIS_AUDIO3D_ERROR_NOT_READYwhen the mixed queue is at the port's depth. KytyPS5 halts instead and prosper has no queue at all