Commit Graph
27 Commits
Author SHA1 Message Date
Adrià 0da91ea5be Merge pull request #13658 from Gonic0/fix/audioout-host-gain-default-ctor
fix(libSceAudioOut): give HostGainRamp an implicit default constructor
2026-10-31 12:28:18 +01:00
Adrià b55fa1b387 Merge pull request #13223 from kyon-eth/feat/audio-out-320-exports
feat(libSceAudioOut): declare 33 callable exports
2026-10-30 23:57:31 +01:00
Nicolas GonzalezandClaude Opus 5.5 06c1bee072 fix(libSceAudioOut): give HostGainRamp an implicit default constructor
AudioOut.cpp resets a port with `port = Port{}`, which copy-list-initializes
its HostGainRamp member. With the default argument on the explicit
constructor, clang rejects that ("chosen constructor is explicit in
copy-initialization"), so libSceAudioOut does not build on macOS. The default
constructor is now separate and implicit; the one taking the ramp length
stays explicit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:47:47 -03:00
MarcZX10 14b0b4b5f2 refactor(libScePad): move the host volume headers from libSceAudioOut
libSceVideoOut reads and changes the shared host volume state, and linking libSceAudioOut for it puts a second shared library with its own static SDL2 into libSceVideoOut. Both libraries already link libScePad, so the headers that describe that state move there first; the include paths and guards follow.
2026-10-30 16:29:55 +01:00
MarcZX10 22cb1123a0 refactor(libSceAudioOut): give the host volume helpers C linkage
They are called across libraries like the other _nid_no_patch and _nid_postfix helpers, so their symbols must not depend on the C++ mangling of a particular compiler.
2026-10-30 16:29:55 +01:00
MarcZX10 31c54b6cb3 feat(libSceAudioOut): keep one shared host volume for the process
The state sits behind a mutex and publishes its gain through an atomic, so the audio threads read it without locking. HostVolumeConfigure replaces the state, parsing ANYPS5_VOLUME and ANYPS5_MUTE_ON_FOCUS_LOSS before changing anything, so an invalid value leaves it untouched and throws an error naming the variable.
2026-10-30 16:29:55 +01:00
MarcZX10 685ea93a0e feat(libSceAudioOut): word the one-line host volume feedback
The message gives the level, or says the volume is muted by the user or by the window losing focus, always with the level it returns to.
2026-10-30 16:29:55 +01:00
MarcZX10 2dbb988fae feat(libSceAudioOut): parse the host volume settings strictly
A flag is exactly 0 or 1 and a level a whole number from 0 to 100. Anything else, including an empty value, throws an error that names the variable and quotes the value.
2026-10-30 16:29:55 +01:00
MarcZX10 cd606d57a1 feat(libSceAudioOut): add a filter that leaves the title's buffer alone
HostGainFilter returns the title's own pointer when the ramp is at unity with a unity target, so the default path copies nothing and multiplies nothing. Otherwise it applies the ramp to a scratch copy, or in place when the data already is the scratch buffer, and never writes the title's memory.
2026-10-30 16:29:55 +01:00
MarcZX10 eed0017aa0 feat(libSceAudioOut): add the gain ramp for 32-bit float host audio
The float overload uses the same per-frame gain as the 16-bit one, converted exactly from the fixed-point value, and does not clamp. At unity with a unity target it touches nothing.
2026-10-30 16:29:55 +01:00
MarcZX10 9ba3f5d80a feat(libSceAudioOut): add a gain ramp for 16-bit host audio
HostGainRamp moves a 16.16 fixed-point gain toward its target by a constant step per frame, so the ramp is exact, continues across buffers and applies one gain to every channel of a frame. 16-bit samples are rounded and saturate. At unity with a unity target nothing is touched.
2026-10-30 16:29:55 +01:00
MarcZX10 7a95f2cefd feat(libSceAudioOut): derive the output gain from the host volume
The gain is a 16.16 fixed-point amplitude of the volume squared, so 100 is exactly unity and 0 is silence. Mute and focus mute force it to 0.
2026-10-30 16:29:55 +01:00
MarcZX10 4d7b8f0180 feat(libSceAudioOut): track window focus in the host volume
With the option on, a window without focus counts as muted and gaining focus ends it. The focus mute is derived from the focus and the option, so it never replaces the user's own mute. With the option off, focus changes change nothing.
2026-10-30 16:29:55 +01:00
MarcZX10 dc7fc6b108 feat(libSceAudioOut): let the host volume be set directly
SetVolume takes a value from 0 to 100 for an initial volume and refuses anything else.
2026-10-30 16:29:55 +01:00
MarcZX10 e2962efdb8 feat(libSceAudioOut): let a volume step end an explicit mute
Raising or lowering the volume while muted unmutes, so the step is audible. A step that cannot move the volume still reports a change when it unmutes.
2026-10-30 16:29:55 +01:00
MarcZX10 67cb5a3301 feat(libSceAudioOut): add a mute toggle to the host volume
The muted flag is separate from the volume, so unmuting brings back the volume that was set before.
2026-10-30 16:29:54 +01:00
MarcZX10 42a4f6b20d feat(libSceAudioOut): add the host volume state with fixed steps
HostVolume holds the host output volume from 0 to 100 and moves it in steps of 5 without leaving the range. A move that changes nothing returns false.
2026-10-30 16:29:54 +01:00
Kyon e4b274109f feat(libSceAudioOut): declare 33 callable exports 2026-10-30 07:02:41 +00: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 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
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
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
boykopovar fdf9ca7574 fix(sdk): reconcile public headers after rebase 2026-10-24 23:17:47 +03:00
boykopovar 35cf8d56cd refactor(sdk): add canonical headers for core libraries 2026-10-24 23:17:37 +03:00
PrintOrb c35572ec18 fix(audioout): serialize shared SDL audio initialization 2026-10-12 15:54:46 -05:00