15 Commits
Author SHA1 Message Date
boykopovar 69a0a691d1 fix(audio3d): restore attribute count output contract 2026-10-21 21:52:29 +03:00
Adrià FranchandClaude 7caa8fa045 test(libSceAudio3d): drop the wall-clock upper bound of the real-time push check
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-20 22:06:56 +02: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 0531b591e8 test(libSceAudio3d): check that a blocking push runs at real time
The push hands the mixed frames to an AudioOut port, so the pacing
comes from the AudioOut queue and not from a local wait. The test
pushes 200 frames of 256 samples at 48 kHz and requires the elapsed
time to be the duration of the audio within 150 ms below and 300 ms
above, the shape libSceAudioOut's own real-time test uses.
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
MarcZX100 e910caed27 feat(libSceAudio3d): report supported port attributes 2026-10-16 21:41:16 +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à 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