Commit Graph
86 Commits
Author SHA1 Message Date
Adrià FranchandClaude Sonnet 5.5 827df2d907 fix(libSceAudioOut): lock the per-port output mutex in sceAudioOutSysClose
main replaced g_outputMutex with g_outputMutexes[], so the Sys close no longer compiled. Mirror sceAudioOutExClose: range-check the handle, lock its mutex.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 18:52:46 +02:00
primesoul-web 5dd106ef20 test(libs): assert the GameUpdate null-label error and pin the mastering states layout
guest_gameupdate still asserted the throw that sceGameUpdateGetAddcontLatestVersion
no longer raises for a null entitlement label since it answers 0x80412803, so the
test aborts; it now asserts the error, the same change #5919 makes. The mastering
states layout is pinned with compile-time size checks for the descriptors, the
compressor and limiter states and both states structs, as #6380 suggested.
2026-10-18 18:52:36 +02:00
primesoul-web 3f03bc0e24 feat(libs): finish the CesCs conversions and the AudioOut, AudioIn and GameUpdate exports
libSceCesCs goes to 17 of 17: three-byte EUC-JP JIS X 0212 (0x8F)
characters convert through a table read from the Unicode consortium's
JIS0212.TXT, both directions, so sceCesEucJpToUcs2, the MbcsStrTo*
and *Get*Len forms and the context conversions accept them, and a
character with cells in both JIS X 0208 and JIS X 0212 still encodes
to the two-byte form. sceCesRefersUcsProfileCp1250 returns a profile
with the Windows-1250 table of Microsoft's bestfit1250.txt, accepted
by the SBC and context conversions.

The AudioOut HDMI bitstream Sys family follows the Ex ports: SysOpen
opens a port only for mode 5, the TrueHD MAT route EVO-PLAYER-PS5
reads from the firmware 12.70 mode tables, paced at 192 kHz with no
host device; SysConfigureOutput accepts the observed HDMI MAT switch;
SysClose closes a Sys port. sceAudioOut2MasteringGetState fills the
states by states id with the descriptors KytyPS5 declares, SetParam
answers a null parameter with the mastering invalid-API-parameter
error, Set3DLatency follows KytyPS5's output validation (0x80268001
above 2, any user), SetSystemDebugState records the debug state id,
and GetSpeakerArrayCoefficients returns the front pair KytyPS5 and
prosper both return.

sceAudioInOpen accepts param 0x10 as float mono like KytyPS5; HqOpen
answers a longer grain or a lower rate with the invalid-size and
invalid-frequency errors; AsyncOpen also accepts the 384-sample grain
SharpProspero documents. sceGameUpdateGetAddcontLatestVersion answers
a null entitlement label with 0x80412803, as prosper does.
2026-10-18 18:52:36 +02:00
Dean fc7b7e33b5 Merge pull request #6199 from valenciana-nc/fix/audioout-size-overflow
fix(libSceAudioOut): check the audio buffer size for 32-bit overflow
2026-10-18 12:57:10 +13:00
Dean 532f3e7b89 Merge pull request #6216 from eljackjoestar-cmd/fix/audioout2-completed-grain-backlog
fix(audio): retain completed AudioOut2 grains until pushed
2026-10-18 02:06:50 +13:00
Dean f7d51cb885 Merge pull request #6474 from fdfawef324/claude/audioout2-grain-backlog
fix(libSceAudioOut): count completed AudioOut2 grains in the queue level
2026-10-18 02:05:38 +13:00
Leonardo Baldazzi 742aeb4211 fix(avplayer): preserve caller-paced delivery in no-sync mode 2026-10-16 22:35:36 +02:00
Leonardo Baldazzi bd9d10b4ce fix: correct audio-video playback timing and sync 2026-10-16 22:35:30 +02:00
fdfawef324andClaude Opus 5.5 2321f1ac7f fix(libSceAudioOut): count completed AudioOut2 grains in the queue level
sceAudioOut2ContextGetQueueLevel left out the grains that
sceAudioOut2ContextAdvance completed and no push had consumed yet. While
pushes filled the 40 ms cushion the level stayed at 0, so a title that
renders as many grains as the level leaves room for and pushes them on
another thread rendered a full queue again after each push. PPSA23226's
Wwise sink does that and stopped once more than 16 completed grains
awaited a push.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 12:36:14 -04:00
Adrià ab808e9d88 Merge pull request #5558 from JJenkx/fix/audio-output-conversion-state
fix(audioout): preserve conversion state across output blocks
2026-10-15 13:38:36 +02:00
eljackjoestar-cmd 6575aa217d fix(audio): retain completed AudioOut2 grains until pushed 2026-10-15 13:06:45 +04:00
valenciana-nc 0aa3b87448 fix(libSceAudioOut): check the audio buffer size for 32-bit overflow
prepareBuffer and queueAudio computed frames * channels * bytesPerSample
in 32-bit arithmetic. A large samplesNum from sceAudioOutOpen (which
only rejects len == 0) wraps the product, so buf.resize allocates a
truncated buffer while the mixing loops write frames * channels samples
past it. Compute the size in 64 bits and throw past INT32_MAX, which
also keeps the downstream int casts well-defined.
2026-10-15 02:36:05 +00:00
toxinexx e7219e4bc4 fix(libSceAudioOut): park guest audio calls at exit before the port tables are destroyed
The library registered no shutdown callback, so a guest mixer thread kept calling sceAudioOut2ContextPush while exit ran the static destructors and mixed from the freed port table (#5864). Exports that read the port tables or output audio now hold a guard: once exit starts they park the thread with LibcAwaitExit_nid_postfix, and the shutdown callback waits for the calls already inside. A push waiting for a grain from sceAudioOut2ContextAdvance also wakes on the shutdown token, so the callback does not wait for an advance that is parked.
2026-10-14 20:43:01 +02:00
Adrià 706ad6c20c Merge pull request #5198 from eljackjoestar-cmd/codex/audioout2-advance-grains
fix(audio): preserve completed AudioOut2 grains across threads
2026-10-14 20:22:51 +02:00
Adrià fe1ccd79b7 Merge pull request #4778 from xXPBSXx/fix/audioout2-port-state-channels-v2
fix(libSceAudioOut): report the port's channel count from sceAudioOut2PortGetState
2026-10-14 19:32:58 +02:00
eljackjoestar-cmd bb4ec482d2 fix(audio): preserve completed AudioOut2 grains across threads 2026-10-14 19:18:32 +04:00
p3nicillinandClaude Opus 5.5 a08310bdc4 feat(libSceAudioOut): open HDMI bitstream ports with sceAudioOutExOpen
Surround Sound Studio (PPSA99051) opens an Ex port for IEC 61937 bursts
when a clip is played. Follow the disassembly and console log in
sainsaji/PS5-Audio-Passthrough-Research: ExOpen refuses modes outside
mask 0x61F with 0x80260015 and opens an S16 stereo port of 256 frames at
48 kHz or 1024 frames at 192 kHz; ExConfigureOutput refuses a nonzero
first argument with 0x80268009 and returns 0 for the documented modes
and targets; ExClose returns 0. The host has no HDMI bitstream output,
so an Ex port has no device and drops its bursts at its own rate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 14:28:48 +01:00
Joel Fernandes dcfabcc579 feat(pad): bridge controller audio haptics to motor rumble 2026-10-14 13:45:00 +02:00
Dean 21da4061be Merge pull request #5413 from mariusyo07/feat/audioout2-disable-chat
feat(libSceAudioOut): implement sceAudioOut2DisableChat
2026-10-14 22:38:41 +13:00
JJenkx 079164e84c chore: resolve current upstream integration conflicts 2026-10-13 23:13:50 -04:00
Dean 6d032559c3 Merge pull request #4789 from PrintOrb/fix/audioout-shared-sdl-init
fix(audioout): serialize SDL audio initialization for Dark Forces
2026-10-14 15:35:56 +13:00
JJenkx b9beb1fb1a Merge commit '30f961266ade83b41d5c9de7dec1393e7fcecfb7' into fix/audio-output-conversion-state 2026-10-13 18:59:57 -04:00
mrfelek af33c8a1e5 feat(libSceAudioOut): implement sceAudioOut2DisableChat 2026-10-13 21:19:10 +02:00
Adrià FranchandClaude 76075edd38 test(libSceAudioOut): define TestEnableChat; drop stale EnableChat unknown-signature line
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-13 15:06:32 +02:00
screammandClaude Fable 5.1 50cd318bb8 feat(libSceAudioOut): implement sceAudioOut2EnableChat
Palworld (PPSA23126, #2648) stops at start-up on the export, imported by
its bundled libdiscord_partner_sdk.prx:

    FAIL: unresolved ELF import oiOi7vgPfAY from libSceAudioOut.prx

PPSA28416 imports it from its bundled party-ps5-shipping.prx as well. The
call itself has not been observed yet.

SharpProspero (5dfdb4b0, Interop/Audio/AudioOut2.cs:460-464) declares
`int sceAudioOut2EnableChat()`, "Allows chat audio alongside the
application's own", and the ps5-payload-dev SDK stub (f5d40f02,
sce_stubs/libSceAudioOut.c:62) exports it as well. There is no context or
handle to validate. The host mixes no chat audio and AudioOut2 has no chat
port, so the call records that chat audio is allowed (traced once with
APS5_TRACE_AUDIOOUT2) and returns 0. Whether the console fails it without
a chat session or when repeated is recorded in technical debt, and the
PPSA28416 "signature unknown" entry is dropped.

NID oiOi7vgPfAY matches tools/nid_names.py and the shadPS4 aerolib list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-13 15:06:27 +02:00
lorkydey 87ee82410b feat(audioout2): report supported user attributes 2026-10-13 10:24:04 +02:00
xXPBSXxandClaude Sonnet 5.5 72fae20877 fix(libSceAudioOut): report the port's channel count from sceAudioOut2PortGetState
sceAudioOut2PortGetState returned the two channels of the host output for
every port. It now reports the channel count of the port's data format and
clears the rest of the state, so the reserved fields no longer keep the
caller's stack contents. The speaker info and system state calls are
unchanged; a new test covers all three, since none had one.

The channel count follows SharpEmu, another emulator; no console
measurement exists, recorded in TechnicalDebt.md. ASTRO BOT and ASTRO's
PLAYROOM reportedly stop on an assertion that depends on the reported
state (#4317); which field matters is not isolated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 09:38:48 +02:00
Adrià 9ba9ac1c8b Merge pull request #4834 from GoodTimeclubs/feat/exports-ppsa01317
feat(exports): export the calls PPSA01317 imports
2026-10-13 09:33:36 +02:00
Adrià 6c87f76b57 Merge pull request #4753 from p3n1cillin/claude/audio-out-ex-monitor-info
feat(libSceAudioOut): list no audio descriptors in sceAudioOutExGetMonitorInfo
2026-10-13 09:26:42 +02:00
JJenkx 41112152dc fix(audioout): preserve conversion state across output blocks 2026-10-12 20:56:44 -04:00
8a7e1195d4 feat(exports): export the calls PPSA01317 imports
Gran Turismo 7 (PPSA01317) fails to load on unresolved imports and on
two needed libraries that AnyPS5 does not build (#4782).

- sceAppContentDownloadDataFormat empties /download0, as
  sceAppContentTemporaryDataFormat does for /temp0.
- sceNpAuthSetTimeout returns REQUEST_NOT_FOUND for an unknown request
  like the other request calls, and OK otherwise; no request reaches the
  network the timeouts would bound.
- sceNpWebApi2PushEventSetHandleTimeout throws for an unknown library
  context, like sceNpWebApi2GetMemoryPoolStats, and returns OK
  otherwise; push event handles are not tracked and nothing waits on
  one offline.
- sceSslDisableVerifyOption, sceSslGetAlpnSelected, sceSslSetAlpn,
  sceSslSetMinSslVersion, sceAudioOutDeviceIdOpen and the unnamed
  libScePsml NIDs xNZM9Y5lf-M and lcZD9tJraAw are declared without
  parameters and throw; their signatures are unknown.
- libSceUsbStorage and libSceUsbStorageDialog exist with no exports,
  like libSceXml: the title lists both as needed but imports nothing
  from them.

Each assumption is recorded in the library's technical debt file.

Co-authored-by: dawid-swiecicki <8942606+dawid-swiecicki@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:11:29 +02:00
Adrià FranchandClaude 91bad2fce5 test(libSceAudioOut): drop sceAudioOutExGetMonitorInfo from the not-implemented test
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-12 23:19:02 +02:00
p3nicillinandClaude Opus 5.5 e284717ebe feat(libSceAudioOut): list no audio descriptors in sceAudioOutExGetMonitorInfo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 23:19:02 +02:00
PrintOrb 5031432db0 test(audioout): detect overlapping backend initialization 2026-10-12 16:04:06 -05:00
PrintOrb c35572ec18 fix(audioout): serialize shared SDL audio initialization 2026-10-12 15:54:46 -05:00
MarcZX100 cf25df9a62 test(cmake): serialize load-sensitive Windows tests 2026-10-12 18:46:19 +00:00
screammandClaude Fable 5.1 f51180973e feat(libSceAudioOut): implement sceAudioOutSysGetHdmiMonitorInfo
Surround Sound Studio (PPSA99051), catalog build on main a11c8f7f with
the flat-interpolation fix, stops 16 s in, before its first frame
(orishamir, #3581 comment 6109839314):

    sceAudioOutSysGetHdmiMonitorInfo not implemented

The call takes (type, out, size); out must be non-null, size exactly
0x180 and type 1 (HDMI) or 0x10 (sainsaji/PS5-Audio-Passthrough-Research
c3be9c2a, docs/FINDINGS.md section 3 and AGENTS.md:25, firmware 12.70).
Titles read the monitor name at +0x0B, the descriptor count at +0x94 and
8-byte descriptors from +0x98 (same, FINDINGS.md hardware log item 1 and
sample-app/src/platform/ps5/bitstream_out.cpp:92-128).

Audio reaches the host through SDL as PCM and there is no EDID, so type 1
with a 0x180-byte buffer reports a sink without a name or descriptors:
the buffer is zeroed and 0 is returned. Surround Sound Studio's
Passthrough page then lists no formats; EVO Player's code treats an empty
list like a negative return. A null buffer returns 0x80260004, as the
other AudioOut calls do. Type 0x10, other types and other sizes throw:
their results and error codes are not known.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 19:45:00 +03:00
husari.orozco 6ad5c61f1a build: route system dependency include paths and pin the shader cache to package versions 2026-10-11 10:18:23 +02:00
Dean af08c417eb Merge pull request #2887 from babyhuey/feat/libsceaudioout-sys-hdmi-monitor-info
feat(libSceAudioOut): export the sceAudioOutSys HDMI output functions
2026-10-11 18:54:19 +13:00
Dean 94416bd6ad Merge pull request #2764 from Get-fix/fix/audioout-ex-exports
fix(audio): export the sceAudioOutEx bitstream port functions
2026-10-11 09:12:41 +13:00
Hannah Lyons 8da88ad3ac feat(libSceAudioOut): export the sceAudioOutSys HDMI output functions 2026-10-10 15:23:02 -04:00
Chad a73b4e3f6d feat(audioout): declare sceAudioOut2EnableChat
Imported by party-ps5-shipping.prx bundled with PPSA28416.
2026-10-10 12:43:28 -05:00
Get-fix f2b4bf3b5b fix(audio): export the sceAudioOutEx bitstream port functions
Jelly5 (PPSA99505) imports sceAudioOutExGetMonitorInfo (PhnNN0UEV6Y),
sceAudioOutExConfigureOutput (VcE+gXSwFXI), sceAudioOutExOpen
(6X6dp+07h4U) and sceAudioOutExClose (0TfjSulCV2A) from libSceAudioOut
and fails to load because no library exports them. It calls them only
for its optional HDMI bitstream output, and their signatures are
unconfirmed, so they are exported without an implementation and throw
if they are called, like sceSaveDataCancel.
2026-10-10 16:12:11 +03:00
Adrià 95fe14235a Merge pull request #2536 from orbz22/fix/audioout2-queue-port-buffers
fix(audioout): play every AudioOut2 port buffer set between pushes, one per grain
2026-10-10 11:17:19 +02:00
Aryan Sharma e548e594fa test(audioout): check pad ports in the main mix without a pad device
With SDL's disk driver no pad audio device is open, so AudioOut2MixPorts
runs with no pad output. A vibration port and a mono pad speaker port
are pushed together: only the speaker's data reaches the main mix, and
a vibration port alone leaves it silent.
2026-10-10 12:46:54 +05:30
Aryan Sharma 34d09b5460 fix(audioout): drop vibration ports when no pad audio device is open
Without a DualSense audio device every AudioOut2 port was mixed into the
main output, including PAD_VIBRATION ports. Their waveforms drive the
controller's actuators on the console and are never heard; mixed into
the speakers they made PPSA28997's combat about 20 dB louder than its
dialogue. Vibration ports are now left out in that case; pad speaker
ports still go to the main output.
2026-10-10 12:46:54 +05:30
Raihan Abdul MajidandClaude Opus 5.5 144e60f836 fix(audioout): play every AudioOut2 port buffer set between pushes, one per grain
A port kept only the last PCM buffer set before a push and played it again
at every later push without a new one. PPSA12544 sets one grain of a ring
buffer per call on its object port, often two or three between pushes and
then none for a few, so all but the last of each burst were dropped and the
stale grain repeated: a buzz on loud sounds and after a sound stopped.

Buffers set between pushes are now queued and played in order, at most 16
queued. A push without a new buffer repeats the last one only for a port
that has always been given the same buffer (rewritten in place, as the
timing tests do); a port whose buffers move on plays silence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 09:11:23 +07:00
popcoder565andClaude Opus 5.5 b2cde4a0f2 fix(audio): pace blocking audio calls with a high-resolution timer
On Windows, nanosleep and this_thread::sleep_for/sleep_until go
through winpthreads, which ends a wait on a 15.6 ms GetTickCount64
step. Blocking sceAudioOutOutput and sceAudioOut2ContextPush calls
returned in bursts about every 16 ms, a blocking sceAudio3dPortPush
ran at about 68 % of real time, and sceAudioInInput without a device
woke anywhere from 1 ms to 31 ms apart. They now sleep with
PreciseSleepUs or the new PreciseSleepUntil.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 01:31:57 +02:00
authurtabo-byte ce66d2688e fix(libSceAudioOut): allow state queries during output waits 2026-10-09 10:24:31 -07:00
Dean 2c3a386e29 Merge pull request #2075 from jdmagic/feat/audioout2-mastering-term
feat(libSceAudioOut): accept sceAudioOut2MasteringTerm
2026-10-09 22:42:37 +13:00