fix(avplayer): skip late video frames in no-sync mode while audio drives the clock #2351
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2351"
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 Faffu on 2026-10-09T16:07:26Z.
What
Fixes #1635.
In
SCE_AVPLAYER_AV_SYNC_MODE_NONE,takeVideohands out every decoded frame in order. A title that requests video slower than the film's frame rate (PPSA12544 requests 7-19 frames per second for a 30 fps cinematic) therefore falls further behind its audio on every call.While the title pulls audio (
audioDriving), no-sync mode now skips queued frames of the current epoch that the audio clock has already passed. This reuses the loop that sync mode already runs. Frames that are not late are handed out as before; no-sync mode still never refuses a frame for being early, and nothing changes when no audio is pulled or at a trick speed. Whether the console hands out every frame in this mode is unknown, so the behaviour is recorded under Functional inTechnicalDebt.md.TestUnsyncedVideoKeepsUpWithAudioreproduces the issue in miniature: no-sync mode, audio pulled in real time, about 15 video requests per second for the 30 fps test movie, and it checks that video stays within 150 ms of the audio.@awake-devel the issue's open question (whether the title requests several frames per game frame when behind) is not settled by this change. If you can, a run of PPSA12544 on this branch would confirm it on the title.
Tested
Fedora 44 host, build and run inside an Ubuntu 24.04 container (GCC 13, as CI),
guest_avplayer_testsonly:mainpython3 tools/check_conventions.py --base upstream/mainpasses. Not tested on a title or on Windows.Side note, not changed here: when a
Checkfails inguest_avplayer_tests, the process aborts in_Unwind_Resumeinstead of printing the message frommain's catch.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-09T17:44:21Z.
Linux run: Linux 7.2 (x86_64), GCC 16.2.1, Release,
-DBUILD_TESTING=ON, #2351 (2be693d4) tested on currentmain(0fdda7be).tests/guest_avplayer_tests: passes cleanly (AvPlayer tests passed).tools/check_conventions.py: passes cleanly.Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:04:15Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
2be693d4, merged ontomainf8c2f072in one build with 9 other PRs that had no Windows run.guest_avplayer.agc_driver_depth_fast_clear_submitfrom #2325, which fails intermittently on its own too. The test comes from #425, where I reported it.No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by AnzouBelilita on 2026-10-09T19:09:21Z.
Independent native-Windows validation for PR #2351:
guest_avplayer_tests(98 build steps); build completed successfully.guest_avplayerpassed 3 consecutive runs after the clean rebuild (3.10 s, 3.95 s, 4.01 s).python tools/check_conventions.py --base d70b89989473ba1f6ae13e44e079e67f1f8a44b0passed.git diff --check --ignore-submodules=all d70b89989473ba1f6ae13e44e079e67f1f8a44b0...HEADpassed.2be693d426f03ac11d176d89d807a2d318bce59f.An earlier repeat sequence on the pre-clean build had one failure in
TestPlayback(enable video failed); the subsequent run passed. After the clean rebuild, all three consecutive runs passed.This adds native-Windows coverage for the no-sync AVPlayer frame-skipping regression. No commercial title or PS5 hardware was tested.
No production source files were modified during validation.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T22:43:18Z.
This conflicts with main after today's merges; could you rebase? It's otherwise ready.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T07:43:57Z.
Rebased onto current
mainas @oneandonlydean asked. The conflicts were mechanical (the new test and the TechnicalDebt line next to the ones added today); both sides kept, no logic changed. Scoped build + ctest on the rebased tree is green, includingguest_avplayer. Merging on green CI.Imported from boykopovar/AnyPS5. Originally posted by Faffu on 2026-10-10T07:44:48Z.
Thank you for rebasing it!