libSceAjm.native: Ratchet & Clank: Rift Apart hangs at the title screen because a run after the ATRAC9 gapless total decodes the last superframe's padding as a new segment #11700
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-27T04:05:21Z.
Ratchet & Clank: Rift Apart freezes on its title screen ("Press X to start"): the main thread stops, and pressing X does nothing. The trace shows that AnyPS5 decodes 3 frames past an ATRAC9 sound's gapless total. The game's mixer then waits forever for input it never has. With the segment kept ended after the total, the title gets past the title screen to the save slot screen. This conflicts with the rule #2052 added for PPSA29141, so I'd like to know what the console does before proposing a fix.
Title: Ratchet & Clank: Rift Apart (PPSA01474 v01.005.003)
Where it stops: title screen, after the first ATRAC9 sound with a gapless total ends.
mainabed03546plus #9749 (with #9633), #10906 and #10000, and one local change that skips the two compute dispatches whose recompile #9749 still refuses (GetImageResource dword 0). Without that skip it stops earlier, on those shaders.Linux 7.3 (CachyOS), i9-14900K, RTX 4090 with NVIDIA 615.78.08. Froze in 2 of 2 runs without the change below (one of them on an older
main), passed in 1 of 1 with it.What the AJM trace shows
APS5_TRACE_AJM=1, the instance that plays the sound (codec 1, 2 channels, 48 kHz, 512-byte superframes of 4 frames; resampled at a ratio of about 1.28):RunAt9then resetssegmentSamples(if (segmentEnded()) instance.segmentSamples = 0;), so the next run starts a new segment and decodes the 3 remaining frames of that superframe (768 samples past the total). 296960 + 256 skipped is 1161 frames, so the total ends after the first frame of the last superframe and the other 3 frames are the encoder's padding.app.elf+0x2707e60–+0x2707eb3with its read position equal to its limit, 296960 (0x48800), still owing 550–654 input samples for the extra buffer. It holds the mixer lock, and the main thread waits on that lock.Local experiment
A local switch (not pushed) keeps the segment ended until a reset (
SetGaplessDecodewith the reset flag,ClearContextor initialization): withAPS5_AJM_GAPLESS_END_HOLDS=1the line above does not resetsegmentSamples.The title resubmits the 381 bytes a few times (6 in this run), gets no output, and stops asking. The mixer does not hang, and the title moves on from the title screen to the save slot screen.
What I don't know
#2052 added the reset because FMOD in PPSA29141 sets a total shorter than a sound's frames and reads the frames after it on later runs. Here the frames after the total are the padding of the superframe that holds the total, and the title wants nothing from them. I don't know what the console does after the total, so I haven't proposed a change that would break PPSA29141. @esatturan, do you know whether PPSA29141's later runs read frames in the same superframe as the total, or only from the next superframe on? If they only read from the next one, ending the segment until the next superframe would fit both titles.
A separate audio fault remains (a constant tone at the title in all three runs, with or without the switch). I'll report it separately once I've traced it.
Tested and written by Claude (AI assistant) on a contributor's machine.