AvPlayer: in no-sync mode the video plays at the game's frame rate, so cinematics fall far behind their audio #1635
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 awake-devel on 2026-10-08T15:22:51Z.
What happens
In Hollow Knight: Silksong (PPSA12544) on Linux, the intro cinematic's sound plays far ahead of the picture. By the time the sound ends, the picture is about 52 s behind, and the last part of the cinematic plays with almost no sound.
Measurements
Media/StreamingAssets/Intro_Cinematic.mp4, 79.6 s, 1916x1080, 30 fps, AAC.Likely cause
sceAvPlayerSetAvSyncModewith mode 1 (no sync); #591 notes Unity titles do this.Source.cpp'stakeVideohands out the next decoded frame on each call and never compares it with the clock. Late frames are only dropped when sync is on (core/libs/prx/libSceAvPlayer/src/Source.cpp:512-516oncba8d86d).Open question, being checked now
Does the title call
sceAvPlayerGetVideoDataonce per game frame, or several times when it is behind? If it is the second, AnyPS5 may be answering "no frame" because the decode-ahead has not produced the next frame yet. The faithful fix would then be to have frames ready sooner. A run that logs every call is under way.Candidate fix
In no-sync mode, while the title is pulling audio, skip queued frames that are already older than the audio clock. Frames that are not late are handed out as today. This departs from the console's "hand out every frame" only for frames that are already late. It would be recorded in TechnicalDebt.md, and once the title runs at the film's frame rate or faster, nothing is skipped.
A unit test reproduces the problem in miniature: in no-sync mode with audio pulled in real time and 15 video requests per second, the video falls 465 ms behind.
Related: #591, #1601 (flicker in the same cinematic), #1486 (audio pacing), discussion #1519.
Test machine: Arch Linux, i7-8750H, GTX 1050 Ti Max-Q, NVIDIA 580.178.04.