AGC frame capture: flips from REWIND tails are not frame boundaries, so APS5_FRAME_CAPTURE never starts in GTA V (PPSA04264) gameplay #12235
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 Tehshortbus on 2026-10-28T04:13:46Z.
What happens
During GTA V gameplay,
APS5_FRAME_CAPTUREwithAPS5_FRAME_CAPTURE_TRIGGERnever starts: the title presents its frames through flips thatexecuteRewindTailattaches to REWIND tails, and those never reachFrameRecorder::FrameBoundary. When boundaries are counted for them (local change below), the capture still cannot start, becausestart()'sWaitIdleFor(10 s)times out at every boundary and gives up after five attempts.@Sam-mon7, since this is the recorder from #8740 and #11435/#11436 touch the same files, I'd like your view on how a fix should look before anyone writes one.
Title, test or build step
Grand Theft Auto V, PPSA04264 01.011.001, from the main menu into Story mode (the opening cinematic).
AnyPS5 commit
main86fb985abbwith #11580 (fedf3e91a7) merged locally (aa67f59bb1), only so that the title gets past #11425 into gameplay. #11580 changes only the shader recompiler.System
CachyOS Linux (kernel 7.3.0-4-cachyos), GCC 16.2.1, Release, NVIDIA GeForce RTX 4070 SUPER (615.78.08), 3840x2160, warm shader cache.
Steps to reproduce
Start Story mode, then
echo 4 > <dir>/triggeronce gameplay (the cinematic) is running.Log
1. Boundaries stop when gameplay starts. On
aa67f59bb1, the trigger was created during the cinematic and no[frame-capture]line and no capture directory ever appeared, in two runs. For a third run I added two local debug lines (not part of any change): one inFrameRecorder::FrameBoundaryprinting every 300th boundary, and one next to++flipSubmissionsOfThread()inDriver::Submit(Submission.cpp:466) printing every 300th submission that carries a flip. Both counters stop together at 2100:while the same run's trace keeps presenting (2614 presents by 91 s; 2193 presents by 61 s, when Story mode starts and
VideoOut.Flipgives way toDriver.Packet):The only other place that attaches flips to a submission is
Driver::executeRewindTail(Submission.cpp:369,reserveOutputs(tail)). It runs on the queue worker, does not go throughAgcDriver::Submit, and so neither increments the flip count thatEntryPoints.cpp:24compares nor callsFrameBoundary.2. With tail flips counted,
start()never finds the driver idle. With the local change below, boundaries continue into gameplay and the trigger is seen, but:The title froze for those 50 s (audio kept playing) and recovered once the recorder gave up. Queue 0 spent the time in
Driver.Rewind:That is consistent with a queue 0 submission parked at a REWIND whose valid bit the title sets from the thread that is blocked in
WaitIdleForinsideFrameBoundary. I have not confirmed which thread sets it.The local change used for part 2 (12 lines; not proposed as is, since on its own it turns "never starts" into these freezes):
plus
Driver::RewindTailFlips()returning a newstd::atomic<std::uint64_t> rewindTailFlipsmember.What was checked
started at frame boundary 1: 48 ranges, 319.3 MiB snapshot in 3.7 s), with the trigger file present from launch (same line), and withAPS5_FRAME_CAPTURE_AT_FLIP=1000at the main menu (started at frame boundary 1000: 96 ranges, 1326.2 MiB snapshot in 2.0 s). So the trigger check itself is fine; only the REWIND-tail flips are missing.executeRewindTail's flips,FrameBoundaryorstart()'s idle wait; #11435 and #11436 change the replay side and add tracing.Questions:
Submit(as above), sincestart()cannot wait for idle on the queue worker?start()to treat "every queue idle or parked at a REWIND the CPU has not released" as idle, with the parked submission recorded soagc_frame_replaycan issue its tail when the captured CPU write releases it? Or would you ratherstart()check without blocking and retry at the next boundary?I'm happy to test any change on GTA V, or write the fix in whichever shape you prefer.
AI-assisted: yes (Claude Code)