Henrik Rydgård and Claude Opus 5.5
ff7371dcc5
Atrac: Write decoded samples when sceAtracDecodeData returns, not when called
...
On a PSP the Media Engine decodes, and the samples land in the output
buffer as the call returns, a couple of milliseconds in. We wrote them at
once and only then delayed the thread. Since sceAudio plays straight out
of game memory, that matters: Fired Up decodes each chunk to 0x40 bytes into
one of its two buffers, running over the first 16 samples of the other one,
which it has just queued, and relies on the mixer having read those first.
Writing early replaced them about 21 times a second, which is the constant
crackle in its music and intro (it showed up with the sceAudio buffering
rework, which stopped copying buffers at enqueue).
Now the decoder's output is set aside, the old contents put back, and a
CoreTiming event writes the samples just before the thread wakes. Pending
writes are kept in savestates.
Adds audio/blocking/parked, recorded on a PSP: a blocking output that had
to wait returns before any of its buffer has played, so the game really
does depend on the decode's latency.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com >
2026-09-24 14:49:09 -06:00
Henrik Rydgård
c5e4d0d90d
Rename the get-memory-pointer functions to make it clear where CPU exceptions can happen.
2026-08-12 14:06:16 +02:00
Henrik Rydgård
3c81d6b121
More manual Read_U32 cleanup
...
Buildfix
2026-08-11 10:28:36 +02:00
Henrik Rydgård
398a678b88
Fix null pointer deref in AtracSasAddStreamData
...
The null check for getAtrac() only logged a warning and fell through to
a virtual call on the null pointer. Return 0 on invalid atrac ID.
2026-08-01 11:57:27 +02:00
Henrik Rydgård
d0eea81fe6
Fix typo in mono atrac initialization. Fixes crash in StormBasic homebrews
2025-08-14 22:09:50 +02:00
Henrik Rydgård
4d7b51d8cb
Reimplement AA3 header parsing
2025-07-22 17:48:20 +02:00
Henrik Rydgård
1983ab16c6
sceAtrac: Call AnalyzeAA3Track for AA3 data, oops.
2025-07-22 16:05:02 +02:00
Henrik Rydgård
ea29fd284f
sceAtrac: Logging improvements, constification (and not)
2025-06-24 21:36:04 +02:00
Henrik Rydgård
43e79aba55
Give Mpeg and Atrac their own log categories
2025-06-24 21:36:04 +02:00
Henrik Rydgård
01ea76ffc7
Memory safety in sceAtracDecode
2025-05-20 00:43:23 +02:00
Henrik Rydgård
3cd1f2f832
sceAudioCodec: Fix AT3 and AAC playback (possibly limited to certain bitrates) but fixes Kosmodrones
2025-04-13 15:48:11 +02:00
Henrik Rydgård
f7ff2e2d20
Remove redundant constants
2025-04-12 11:35:55 +02:00
Henrik Rydgård
4e8e6312e0
ImDebugger: Implement mute controls for individual sceAtrac channels
2025-04-12 11:35:55 +02:00
Henrik Rydgård
693f84d2fb
sceAtrac logspam reduction
2025-04-11 13:12:14 +02:00
Henrik Rydgård
3d8233b7f8
Some sceAudiocodec MP3 work. Not yet working in Beats (trying to DisableHLE of sceMp3).
2025-04-07 10:27:53 +02:00
Henrik Rydgård
4e25f44eef
Rename some module-related functions to include HLE where appropriate
2025-03-31 11:17:50 +02:00
Henrik Rydgård
870995a767
Mostly restore the old code path
2025-03-25 22:19:09 +01:00
Henrik Rydgård
1bd5cffa1d
Initial work on re-implementing atrac-through-sas
2025-03-25 22:01:30 +01:00
Henrik Rydgård
4b123a2e09
Move the sceSas error codes into the big enum
2025-03-25 12:04:33 +01:00
Henrik Rydgård
2b558eb545
Fix regression in Tomb Raider Legends
...
Need to make sure a buffer size check happens before the buffer is
accessed - since the game calls sceAtracSetDataAndGetID with both buffer
and bufferSize as 0, and it expects to receive TOO_SMALL and not a
memory exception.
Thanks to @sum2012 for quick investigationh help.
2025-03-23 07:11:01 +01:00
Henrik Rydgård
c70a9b2114
Merge pull request #20138 from hrydgard/default-to-new-sceatrac
...
Use the new sceAtrac implementation by default
2025-03-22 12:27:58 +01:00
Henrik Rydgård
0f840e6240
Move JPEG error codes to the big enum, some include cleanup
2025-03-21 20:44:46 +01:00
Henrik Rydgård
249281366e
Use the new sceAtrac implementation by default
...
Inverts/renames the setting to allow going back to the old sceAtrac
implementation, to work around any compatibility issue.
Note that we can never delete the old implementation, old savestates
will still use it - can't convert an existing session.
2025-03-20 23:10:21 +01:00
Henrik Rydgård
e3297d84f5
Fix pointer incrementes with low level decoder
2025-03-20 13:30:49 +01:00
Henrik Rydgård
e70dd3b2df
Break out AtracTrack into its own file. Add a little atrac analysis tool to ImDebugger (for future use)
2025-03-19 16:15:51 +01:00
Henrik Rydgård
ec169e9fa9
Sol Trigger fix
2025-03-19 11:41:13 +01:00
Henrik Rydgård
ef4e04c8a1
Pass more filename information into elf loading. Allow dumping PRX into elf.
2025-03-19 10:42:32 +01:00
Henrik Rydgård
2fb10fb5d9
sceAtrac: Crashfix in sas integration
2025-03-18 13:48:12 +01:00
Henrik Rydgård
e45333d1d8
Fix the sceSas context connection
2025-03-18 09:36:34 +01:00
Henrik Rydgård
6d7625ea6b
Implement save state support, with backwards compatibility.
2025-03-18 09:36:33 +01:00
Henrik Rydgård
89a73be155
Compute the joint-stereo flag as needed instead of storing it.
2025-03-18 09:36:33 +01:00
Henrik Rydgård
01076d2a4f
InitLowLevel parameter cleanup
2025-03-18 09:36:33 +01:00
Henrik Rydgård
4a4332b22e
Remove hack where we snuck AtracID into the contexts. Not suppose to be there.
2025-03-18 09:36:33 +01:00
Henrik Rydgård
02f06faad1
Atrac2 track_ removal, part 1
2025-03-18 09:36:33 +01:00
Henrik Rydgård
4379c1ad49
Rebase fixups
2025-03-18 09:36:33 +01:00
Henrik Rydgård
bb436cda8f
Reimplement a lot of logic, implement loop streaming properly
2025-03-18 09:36:33 +01:00
Henrik Rydgård
b99348383c
Some new findings, loop work
2025-03-18 09:36:33 +01:00
Henrik Rydgård
926a5623d1
Improve comments
2025-03-18 09:36:33 +01:00
Henrik Rydgård
8b02766702
Some cleanup and refactor.
2025-03-18 09:36:33 +01:00
Henrik Rydgård
1f85887cb6
Logging improvements
2025-03-18 09:36:33 +01:00
Henrik Rydgård
bab09ea30a
Implement sceAtracGetInternalError
2025-03-18 09:36:33 +01:00
Henrik Rydgård
7a4d175e06
Port over some utility functions, fix bugs.
2025-03-18 09:36:32 +01:00
Henrik Rydgård
818e7a99bd
minor refactor
2025-03-17 11:02:59 +01:00
Henrik Rydgård
63c997b973
Fix an ordering issue in Atrac context creation
2025-03-16 22:46:44 +01:00
Henrik Rydgård
b7782d98f3
Prepare for Atrac context data to work the new way. Not actually active yet. Also restrict old versions to 4 contexts.
2025-03-16 19:32:03 +01:00
Henrik Rydgård
4fbdb58beb
Merge the "Analyze" function into SetData
2025-03-16 19:32:00 +01:00
Henrik Rydgård
3979b6af54
Combine the two Analyze functions
2025-03-16 12:59:32 +01:00
Henrik Rydgård
fe0edc0bda
One more cleanup before merging Analyze and SetData...
2025-03-16 12:44:16 +01:00
Henrik Rydgård
8ab41e387e
Reorganize to make the next step easier
2025-03-16 12:21:55 +01:00
Henrik Rydgård
bcf89754c7
First step: Split out the track analysis.
2025-03-16 12:21:55 +01:00