Commit Graph
153 Commits
Author SHA1 Message Date
Adrià 01069f4d2b Merge pull request #12954 from hugodearaujo/fix/audioout2-blocking-push
fix(libSceAudioOut): return from a blocking AudioOut2 push once the queue has room
2026-10-30 15:45:36 +01:00
Adrià a36ff7f47e Merge pull request #12584 from Biologisten/fix/audio-pad-speaker-mute
feat(audio): add controller speaker fallback override
2026-10-30 07:12:28 +01:00
hugodearaujo 56fd9eac87 Merge main into fix/audioout2-blocking-push
# Conflicts:
#	core/libs/prx/libSceAudioOut/src/AudioOut2Context.cpp
2026-10-30 03:03:08 -03:00
Adrià 4628011bc8 Merge pull request #12727 from XairRrR/fix-audioout-context-handles
fix(libSceAudioOut): reject AudioOut2 context handles that are not live contexts
2026-10-30 05:51:47 +01:00
hugodearaujo 2aca989548 test(libSceAudioOut): hold a blocking push on a test clock until playback frees a slot
A device-less context can run its queue model on a clock the test sets. With the clock frozen, a blocking push that fills the queue is seen still waiting with its grain queued and not counted, and returns once the test plays one grain; a blocking push that meets a queue filled by non-blocking pushes does not queue past the depth.
2026-10-29 22:14:23 -03:00
Adrià 7a225bb303 Merge pull request #12686 from MarcZX10/feat/pad-rumble-intensity
feat(libSceVideoOut): add ANYPS5_RUMBLE to scale or turn off host controller vibration
2026-10-29 23:46:17 +01:00
Dean 85ae67061d Merge pull request #12856 from slopgobblercobbler/fix/audioout-param-buffer-validation
fix(libSceAudioOut): validate open format parameter and virtual port buffer boundaries
2026-10-30 10:18:42 +13:00
Dean af4e595327 Merge pull request #11762 from oneandonlydean/salvage/small-exports-9541
feat(prx): declare 34 PS5 JSON, AudioOut, AudioIn and Sdma exports
2026-10-30 08:13:52 +13:00
hugodearaujo 7a75ea95b3 docs(libSceAudioOut): record the blocking push wait as inferred from PPSA02530
The wait is described in the debt file instead of in code comments.
2026-10-29 13:29:53 -03:00
hugodearaujo 42beeaa468 fix(libSceAudioOut): return from a blocking AudioOut2 push once the queue has room
A blocking sceAudioOut2ContextPush waited only before queueing its grain, so the push that filled the queue returned at once. PRAGMATA's Wwise feeds its context from a thread that pushes and then wakes the renderer; the renderer sees a full queue, sleeps, and is woken again only by the game's next RenderAudio, so the mix advanced four grains per game frame. A blocking push now also waits after queueing until a grain finishes, bounded by the existing 200 ms limit.
2026-10-29 12:39:32 -03:00
slopgobblercobbler 120b2036a5 fix(libSceAudioOut): validate open format parameter and virtual port buffer boundaries 2026-10-29 14:27:50 +01:00
XairRrR 03decdabe0 fix(libSceAudioOut): reject AudioOut2 context handles that are not live contexts
An AudioOut2 context handle was the host pointer itself, and every
sceAudioOut2Context* call and sceAudioOut2PortCreate only rejected 0. A
second sceAudioOut2ContextDestroy of the same handle deleted the context
twice, Push, Advance, GetQueueLevel and SetAttributes on a destroyed
context used freed memory, and PortCreate accepted any nonzero value and
kept it as the port's context, so the next PCM attribute on that port read
the grain size through it.

Live contexts are now kept in a set: ContextCreate adds the context,
ContextDestroy removes it before releasing it, and the other context calls
and PortCreate return SCE_AUDIO_OUT2_ERROR_INVALID_HANDLE for a handle that
is not in the set. The queue level test that passed a stack object as a
handle now uses a created context with its device closed.

AI-assisted: yes
2026-10-29 06:38:00 +01:00
Biologisten 80df59b666 test(audio): isolate AudioOut2 tests from APS5_PAD_SPEAKER_FALLBACK_DB
CreateContext() reads the variable, so a value exported in the developer's shell reached the AudioOut2 tests: garbage aborted seven of the sixty audio tests and -15 broke the unity fold in audio_out2_port_layouts. Every test that creates a context now unsets the variable at the start of main(), and the tests that exercise it set it themselves.

Throws() now takes the exception type it expects, so the two port checks still require std::invalid_argument while the environment check requires std::runtime_error. The rejection error keeps the original pointer to the value, so a value with leading whitespace is reported verbatim and the test checks the name=value prefix.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
2026-10-29 05:46:33 +01:00
MarcZX10 38a08d2d43 feat(libSceAudioOut): apply ANYPS5_RUMBLE to AudioOut2 vibration ports on a controller sound card
The AudioOut2 mixer queues the pad mix on the controller sound card unscaled. Pass the rumble percentage to the actuator write so 0 plays silence and the default is unchanged. The fallback that turns the same mix into motor rumble when no sound card plays it is scaled once, later, by the pad output.
2026-10-29 02:06:36 +00:00
MarcZX10 705163bd27 feat(libSceAudioOut): apply ANYPS5_RUMBLE to legacy vibration ports on a controller sound card
The legacy AudioOut vibration port queues its PCM on the controller sound card unscaled. Pass the rumble percentage to the actuator write so 0 plays silence and the default is unchanged.
2026-10-29 02:06:36 +00:00
MarcZX10 1bb8e8b2fd feat(libSceAudioOut): add an actuator percentage to AudioOut2WritePadFrames
Vibration ports that play on a controller sound card write their PCM to the actuator channels with no way to reduce it. Add a trailing percentage parameter, defaulting to 100 which writes the same samples as before, that scales only the two actuator channels and writes silence at 0. The controller speaker channels are never scaled.
2026-10-29 02:06:36 +00:00
Biologisten 315050d000 fix(audio): reject invalid APS5_PAD_SPEAKER_FALLBACK_DB values and read the gain once
A set-but-invalid value, including an empty one, a non-finite number, a
number outside -60 to 0 or trailing text, stops the title with an error
naming the variable and the value instead of silently keeping 0 dB. The
gain is parsed once when the AudioOut2 context is created, kept in the
context and passed to the mix loop, so the audio thread never reads the
environment.

The one-read rule is pinned end to end: a play that changes the variable
to a value that would stop the title after the context was created keeps
the parsed fold and never re-reads the environment.
2026-10-29 00:16:16 +01:00
Biologisten 84b5542fdc feat(audio): add controller speaker fallback override
Add APS5_PAD_SPEAKER_FALLBACK_DB for AudioOut2 controller-speaker ports
folded into the main mix when no controller speaker is present. The
default 0 dB keeps the existing unity mix; mute removes the fallback
copy so a title's own main-port copy is heard instead.
2026-10-29 00:16:16 +01:00
SeaSunPTandClaude Opus 5.5 9f6c3527ed fix(libSceAudioOut): refuse system debug state and chat calls before sceAudioOut2Initialize
#9838 read sceAudioOut2SetSystemDebugState in PS5 firmware 3.20 and 4.03:
it returns 0x80268006 (not initialized) before sceAudioOut2Initialize,
ahead of its pointer, id and size checks. The debt entry for
sceAudioOut2EnableChat and sceAudioOut2DisableChat records the same
0x80268006 before AudioOut2 initialization. Both were left out while
AudioOut2 initialization was not tracked; AudioOut2IsInitialized_nid_no_patch
now tracks it, so all three return 0x80268006 first and change no state.
The two debt entries drop the closed gap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 12:56:22 +00:00
Dean Galvin d64880a5a4 Merge branch 'main' into salvage/small-exports-9541
# Conflicts:
#	docs/dev/debt/libSceAudioOut.md
2026-10-28 22:38:37 +13:00
Dean c2d14b444c Merge pull request #11918 from kyon-eth/feat/audioout2-1360-inventory
feat(libSceAudioOut): declare 11 additional exports
2026-10-28 22:30:28 +13:00
Dean a1f5ae4e8b Merge pull request #11244 from SeaSunPT/fix/audioout2-mastering-not-initialized
fix(libSceAudioOut): refuse sceAudioOut2Mastering calls before sceAudioOut2Initialize
2026-10-28 13:02:46 +13:00
Dean 091967e234 Merge pull request #11055 from JJenkx/fix/audioout2-device-queue-poll
fix(audioout2): poll device queues without the callback mutex
2026-10-28 13:02:30 +13:00
Dean 6c48f35a95 Merge pull request #8098 from LuisAguilarDev/fix/audioout2-silent-ports
fix(audioout2): keep each port's grain when ports share a buffer
2026-10-28 12:59:20 +13:00
Dean 7461dd1ed3 Merge pull request #10532 from LeandroLP23/fix/audioout-skip-open-without-output-devices
fix(libSceAudioOut): skip the default open only when Windows reports no default output endpoint
2026-10-28 02:31:48 +13:00
Kyon fadf15081d feat(libSceAudioOut): declare 11 additional exports 2026-10-27 12:31:40 +00:00
xdCloudy 278754be7c feat(prx): declare 27 PS5 JSON and AudioOut exports 2026-10-27 19:57:19 +13:00
Dean 38cda53b52 Merge pull request #11160 from p3n1cillin/claude/audioout-padspk-volume
fix(libSceAudioOut): declare sceAudioOutSetPadSpkVolume as PSBox calls it
2026-10-27 14:05:56 +13:00
Dean fc7e583e6e Merge pull request #11035 from orezraey/fix/libsceaudioout-repeated-init-measured-ps5
fix(libSceAudioOut): fail a repeated sceAudioOut2Initialize and sceAudioOutInit as measured on a PS5
2026-10-27 09:16:48 +13:00
SeaSunPTandClaude Opus 5.5 d736ea814e Merge branch 'main' into fix/audioout2-mastering-not-initialized
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 15:34:06 +00:00
SeaSunPTandClaude Opus 5.5 4128be2f60 fix(libSceAudioOut): refuse sceAudioOut2Mastering calls before sceAudioOut2Initialize
The PS5 module read for #9027 returns 0x80268006 from sceAudioOut2MasteringInit,
sceAudioOut2MasteringInitEx, sceAudioOut2MasteringTerm,
sceAudioOut2MasteringGetState and sceAudioOut2MasteringSetParam before
sceAudioOut2Initialize. #9027 left the check out because AudioOut2
initialization was not tracked; AudioOut2IsInitialized_nid_no_patch now
tracks it, so each of these returns 0x80268006 first, before its own
mastering-state and argument checks, and changes no state. The debt entry
drops the closed gap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 22:07:11 +00:00
Dean Galvin 91039afff1 Merge branch 'main' into feat/audioout-set-main-output 2026-10-26 09:57:37 +13:00
p3nicillinandClaude Opus 5.5 6d4247f45f fix(libSceAudioOut): declare sceAudioOutSetPadSpkVolume as PSBox calls it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 20:12:50 +00:00
JJenkx c75ef9f48d fix(audioout2): publish queue changes when producer scopes exit 2026-10-25 10:52:42 -04:00
orezraeyandClaude Opus 5.5 9925a9e401 fix(libSceAudioOut): fail a repeated sceAudioOut2Initialize and sceAudioOutInit as measured on a PS5
On PS5 firmware 13.60 a second sceAudioOut2Initialize returns 0x80268004,
also after sceAudioOutInit, and a second sceAudioOutInit returns
0x8026000e. sceAudioOutInit after sceAudioOut2Initialize still returns 0.
sceAudioOut2InitializeEx and sceAudioOut2LoInit keep returning 0; their
repeats were not measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 11:36:01 -03:00
JJenkx fef6f77622 fix(audioout2): poll device queue levels without the callback mutex 2026-10-25 10:34:14 -04:00
LeandroLP23andClaude Opus 5.5 e63a51c93a fix(libSceAudioOut): confirm the missing WASAPI endpoint before skipping the open
SDL's WASAPI enumeration drops failures silently: EnumAudioEndpoints or
GetCount errors leave the list empty, and a device whose metadata lookup
fails is left out, so an empty list does not prove there is no default
endpoint. The skip now also requires IMMDeviceEnumerator's
GetDefaultAudioEndpoint(eRender, eConsole), the call SDL's default open
makes, to return ERROR_NOT_FOUND. The probe runs only when the wasapi list
is empty.

audio_out_default_open gains wasapi_zero_default (empty WASAPI list, the
probe finds an endpoint, the default is opened) and checks that the probe
runs only for an empty WASAPI list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 10:50:38 +01:00
LeandroLP23andClaude Opus 5.5 41b8afb060 fix(libSceAudioOut): skip the default open only when WASAPI reports no endpoint
SDL documents that a default open can succeed when SDL_GetNumAudioDevices
returns zero, for instance ALSA whose default PCM works without device
hints. The shortcut now applies only to the wasapi driver, which
enumerates active render endpoints synchronously when the subsystem
starts; with none, its default open has no endpoint to use and fails after
SDL's 8 s retry.

audio_out_default_open runs AudioOut.cpp against a stubbed SDL in four
modes: zero devices on alsa with a working default, zero on wasapi, a
positive count and an unknown count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 10:17:11 +01:00
LeandroLP23andClaude Opus 5.5 cb92e51d72 fix(libSceAudioOut): skip the SDL device open when no output device exists
With no audio endpoint, SDL's WASAPI backend retries the default device
for 8 s before it fails. Every port open paid that before falling back
to virtual pacing. Ask SDL for the output device count first and take
the virtual path at once when it is zero.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 10:11:15 +01:00
boykopovar 2a99f02f25 fix(sdk): reconcile declarations after main rebase 2026-10-24 23:17:50 +03:00
boykopovar 35cf8d56cd refactor(sdk): add canonical headers for core libraries 2026-10-24 23:17:37 +03:00
Dean 1c6e10f170 Merge pull request #8693 from JAB-dev/fix/audioout2-speaker-info-errors
fix(libSceAudioOut): report not-initialized, null-pointer and flag errors from sceAudioOut2GetSpeakerInfo
2026-10-25 07:32:15 +13:00
JAB-dev 032b4ff6da Merge remote-tracking branch 'origin/main' into HEAD 2026-10-24 18:01:59 +02:00
Adrià 87666fc5d6 Merge pull request #8525 from MarrasFederico/feat/audio-out-mastering
feat(libSceAudioOut): answer the legacy mastering calls without a mastering stage
2026-10-24 14:21:12 +02:00
Adrià FranchandClaude Sonnet 5.5 de28243d26 fix(libSceAudioOut): clear sceAudioOutGetSystemState reserved fields
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 20:31:12 +02:00
Benjamin Cortez b0b7198b7a feat(libSceAudioOut): implement sceAudioOutGetSystemState 2026-10-23 20:31:12 +02:00
Dean 19d0005a47 Merge pull request #9027 from hypermoist/fix/audioout2-mastering-state
fix(libSceAudioOut): track mastering initialization as the console does
2026-10-24 00:54:34 +13:00
Dean 98aef0f7fa Merge pull request #9023 from hypermoist/fix/audioout-info-calls
fix(libSceAudioOut): return what the firmware returns from three info calls
2026-10-24 00:54:12 +13:00
JAB-devandClaude Sonnet 5.5 a5c3bb0933 fix(libSceAudioOut): sceAudioOutInit initializes AudioOut2 as the firmware does
In PS5 firmware 3.20 and 4.03 sceAudioOutInit calls sceAudioOut2Initialize, which sets the flag that sceAudioOut2GetSpeakerInfo tests before anything else. A title that only calls sceAudioOutInit got 0x80268006 here. The flag moves next to sceAudioOutInit so the test targets that build only AudioOut.cpp still link.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 12:36:41 +02:00
JAB-devandClaude Sonnet 5.5 1c335b6ea9 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into fix/audioout2-speaker-info-errors
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 12:33:19 +02:00