Files
AnyPS5/docs/dev/debt/libSceAudioIn.md
T
Federico Marras 323deb832a feat(audioin): implement sceAudioInGetGain and sceAudioInGetRerouteCount
Write the unattenuated linear gain 1.0f into *gain before checking the port handle in sceAudioInGetGain, and return 0 for open ports or SCE_AUDIO_IN_ERROR_INVALID_HANDLE (0x80260101) for closed or out-of-range handles in both sceAudioInGetGain and sceAudioInGetRerouteCount.
2026-10-19 18:57:12 +02:00

3.2 KiB

libSceAudioIn technical debt

Silent stubs

  • sceAudioInInit (libSceAudioIn) - returns 0 without library-wide setup, as sceAudioOutInit does; each sceAudioInOpen opens its own SDL capture device

Unknown function info

  • sceAudioInIsPadEmbeddedMic (libSceAudioIn) - name from its NID (X+4jdIS75P0); signature int32_t(int32_t handle) from the Ghost of Yotei (PPSA26344) call site in #2355; the result's meaning is unconfirmed, so it still throws rather than invent one

Functional

  • sceAudioInHqOpen, sceAudioInAsyncOpen (libSceAudioIn) open the same port as sceAudioInOpen, so sceAudioInInput, sceAudioInGetSilentState and sceAudioInClose accept their handles. The signatures agree across shadPS4, SharpProspero and KytyPS5. HqOpen is limited to 128 samples at 48 kHz, as KytyPS5 and SharpProspero describe the higher-quality path: a longer grain returns the invalid-size error and a lower rate the invalid-frequency error. AsyncOpen also accepts the 384-sample grain, the largest SharpProspero documents for the low-latency path, and returns the invalid-size error for every other size; the console's shorter average return interval of an async port's blocks is not modelled, so like a synchronous port sceAudioInInput paces one grain at a time. Param 0x10 opens a float mono port like 0x11, as KytyPS5 accepts both, while SharpProspero documents only 0x11. Host capture pacing and console behavior remain unverified.
  • sceAudioInGetGain, sceAudioInGetRerouteCount (libSceAudioIn) - signatures and semantics follow SharpProspero. sceAudioInGetGain writes the unattenuated linear gain 1.0f into *gain before validating handle, returning 0 for an open port and 0x80260101 (SCE_AUDIO_IN_ERROR_INVALID_HANDLE) otherwise; a null gain pointer throws because the console result is unverified, and host or system input attenuation is not modelled. sceAudioInGetRerouteCount returns 0 for an open port and 0x80260101 otherwise, as each port opens its SDL capture device once and capture-device hot-swapping is not modelled.