26 Commits
Author SHA1 Message Date
boykopovar 69a0a691d1 fix(audio3d): restore attribute count output contract 2026-10-21 21:52:29 +03:00
Yuri Olive 68f9b47be0 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into feat/audio-missing-exports
# Conflicts:
#	docs/dev/debt/libSceAudio3d.md
2026-10-20 17:55:03 -03:00
011010 64092044df fix(libSceAudio3d): queue the bed writes and consume one per advance
sceAudio3dBedWrite2 stored the bed in a single slot that
sceAudio3dPortAdvance mixed without clearing, so an advance with no new
write replayed the previous block instead of mixing silence, and two
writes before one advance kept only the second.

The writes are queued now, as shadPS4's ConvertAndEnqueue does: the
queue is bounded by queue_depth and returns NOT_READY when full, an
advance consumes one bed, and an advance with nothing queued mixes
silence through the mixer's empty-source path, which the mixer test
already covers.

guest_audio3d_port gains the queue case: fill the queue, require
NOT_READY, advance, and require the consumed bed to make room. It fails
on the old code at the NOT_READY of the full queue.
2026-10-20 22:06:52 +02:00
011010 7887d17766 fix(libSceAudio3d): use the reference error code for an unsupported buffer mode
The branch invented AUDIO3D_ERROR_NOT_SUPPORTED as 0x80EA0005, which
shadPS4's error enum names OUT_OF_MEMORY. Both shadPS4 and prosper
put the unsupported buffer mode at 0x80EA0008, prosper from the PS5
module's own error table.

The debt entries now name the reference behind each unverified
choice: the downmix coefficients and the dropped LFE follow shadPS4
(fpPS4 agrees) against prosper's contradiction, the channel order
follows shadPS4, prosper and fpPS4, the return of
sceAudio3dAudioOutOutput follows KytyPS5 and prosper against
shadPS4's total-sample answer, and the full-queue NOT_READY follows
shadPS4, the only reference with a body.

The stubs leave the branch: this pull request carries the bed path
alone.
2026-10-20 22:06:52 +02:00
husari.orozco 553ce8e9ba fix(libSceAudio3d): tie the audio out drain to the frame it submits
Pop the associated frame under g_mutex before submitting it, so two
concurrent PortPush calls cannot submit the same frame twice or drop
another, and restore it at the front if the submission fails. Open the
lazy internal AudioOut port for PortPush outside g_mutex, re-checking the
port before storing the handle and closing it when the port vanished.
Move the rollback close in sceAudio3dAudioOutOpen outside the lock too.
2026-10-20 22:06:52 +02:00
husari.orozco 6caa4971f9 fix(libSceAudio3d): drain the associated AudioOut ports on push
Queue the explicit AudioOut buffers instead of submitting them straight
away: sceAudio3dAudioOutOutput now copies the block into the associated
port's pending queue and returns the sample count, so the queue_depth
backpressure clears instead of wedging the port in NOT_READY forever.
PortPush drains every associated port's pending queue outside g_mutex,
popping a frame only once its submission succeeds. PortFlush keeps
draining the ports with a null output while clearing their queues.
sceAudio3dAudioOutOpen rejects a non-zero index and an unknown format
before opening and opens the AudioOut port outside g_mutex, re-checking
the port before it registers the handle.

sceAudio3dAudioOutOutputs returns 0 on success, matching the reference;
sceAudio3dAudioOutOutput returns the granularity as the sample count.
2026-10-20 22:06:52 +02:00
husari.orozco 0ee0731675 feat(libSceAudio3d): implement the explicit AudioOut exports 2026-10-20 22:06:52 +02:00
husari.orozco cd58534968 fix(libSceAudio3d): drain audio out of the lock and make sync and async distinct
Deliver and close the AudioOut port outside g_mutex: the queued frames are
moved out of the mixed deque under the lock and submitted after it is
released, and a failed output is returned instead of being dropped.

Make the blocking modes distinct: BLOCKING_SYNC drains every queued frame so
the queue level reaches 0, while BLOCKING_ASYNC submits only the excess and
leaves up to queue_depth - 1 frames buffered. Map a failed sceAudioOutOpen to
AUDIO3D_ERROR_OUT_OF_RESOURCES and rename the handle member to
audio_out_handle.
2026-10-20 22:06:52 +02:00
husari.orozco 68efaf1e55 feat(libSceAudio3d): mix on advance and deliver through AudioOut 2026-10-20 22:06:52 +02:00
husari.orozco 64be87978d fix(libSceAudio3d): accept every bed output route and cover the bed validation 2026-10-20 22:06:52 +02:00
husari.orozco 28a53f31db feat(libSceAudio3d): implement sceAudio3dBedWrite and BedWrite2 2026-10-20 22:06:52 +02:00
Yuri Olive 02998c3bd0 fix(libSceAudio3d): leave the functions #6148 implements 2026-10-20 10:32:08 -03:00
Yuri Olive d4387fbaf7 feat(libSceAudioIn,libSceAudio3d,libSceVoice): export missing firmware interfaces 2026-10-20 07:10:28 -03:00
MarcZX100 e910caed27 feat(libSceAudio3d): report supported port attributes 2026-10-16 21:41:16 +02: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 57bc8b1661 feat(libSceAudio3d): implement sceAudio3dObjectSetAttributes and sceAudio3dPortFlush
Both exports are imported by titles that link libSceAudio3d; without them the loader fails with an unresolved import before the title runs. Following the offline model, object attributes are validated but produce no audio and PortFlush drops the frames queued by sceAudio3dPortAdvance.
2026-10-09 23:32:52 +02:00
Adrià Franch c3871dcb99 feat(libSceAudio3d): implement sceAudio3dObjectReserve and sceAudio3dObjectUnreserve 2026-10-07 18:01:24 +02:00
Adrià 09f8782378 feat(libSceAudio3d): implement sceAudio3dTerminate (#830) 2026-10-07 11:42:29 +13:00
Adrià Franch 42869efbfa fix(audio3d): wait until the slot frees in blocking push 2026-10-06 00:28:19 +02:00
Adrià FranchandClaude 06d2ae5f05 feat(audio3d): implement the port queue
Initialize, PortOpen/Close, PortSetAttribute, PortGetQueueLevel,
PortAdvance and PortPush. One port, validation order and error codes from
the PS5 module as read by prosper; blocking push paced at granularity
samples per frame at 48 kHz like KytyPS5.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-06 00:28:19 +02:00
Dean 33a870d973 Merge pull request #382 from nicolasabosch/feat/audio3d-default-parameters
feat(audio3d): implement default open parameters
2026-10-05 12:11:10 +13:00
Nicolas Abosch 35b40b76c3 feat(audio3d): implement default open parameters 2026-10-02 13:54:01 -03:00
julienlgyandCopilot 2755aff9b1 feat(libSceAudio3d): add missing sceAudio3dPortClose stub
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-02 12:46:50 +02:00
boykopovar abc72da741 feat(libs): define vabi macros + add to declarations 2026-09-10 08:07:03 +03:00
boykopovar 6123893998 feat(libs): throw not impl ex in every stub 2026-09-06 15:05:04 +03:00
boykopovar 59bee8d187 feat(libs): add libs function signatures 2026-08-20 23:18:16 +03:00