Skip to content

Reduce Android display latency by setting the desired frame timestamp - #6792

Open
shiumano wants to merge 4 commits into
ppy:masterfrom
shiumano:frame-timestamp
Open

Reduce Android display latency by setting the desired frame timestamp#6792
shiumano wants to merge 4 commits into
ppy:masterfrom
shiumano:frame-timestamp

Conversation

@shiumano

Copy link
Copy Markdown
Contributor

Display latency is reduced by two frames.

latency-before-after.mp4

I also checked using Perfetto, the official Android profiling tool.
(Trace coinfig: config.txtpb.txt)

Before

スクリーンショット 2026-08-28 014536

After

スクリーンショット 2026-08-28 014831

The meanings of each location are as follows:
①: The application has started rendering
②: The application has finished rendering
③: The frame to be composited has been selected
④: The frame has been displayed on the screen

I haven't addressed the time taken for the ①→② step this time; please disregard it, as it varies significantly depending on the situation.
The improvement made this time concerns the time taken for the ②→③ step.


Description of changes for ec1a4f5

After calling eglPresentationTimeANDROID, VSync no longer worked as expected even with SwapInterval set to 1.
Therefore, I implemented Choreographer as an alternative to VSync.

Details

By the way, Choreographer is extremely strict .
If the load increases even slightly, the frame rate immediately drops from 120fps to 60fps—far more drastically than with SwapInterval(1).
As it stands, I believe there are only a handful of devices capable of consistently maintaining 120fps with VSync.

Furthermore, unfortunately, 240fps results in less latency than 120fps with V-Sync.

Comment thread osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs Fixed
Comment thread osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs Fixed
Comment thread osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs Fixed
Comment thread osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs Fixed
Comment thread osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs Fixed
Comment thread osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs Fixed
Comment thread osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs Fixed
Comment thread osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants