Search Issue Tracker

By Design

Votes

0

Found in

2021.3.35f1

2022.3.20f1

2023.2.11f1

2023.3.0b7

Issue ID

UUM-64077

Regression

No

[Android] Inconsistent frame rate due to increased "WaitForTargetFPS" usage in the Android Player

--

-

How to reproduce:
1. Open the "IN_65938" project
2. In the Build Settings "Run Device" dropdown, select the desired device
3. Enable Development Build and Autoconnect Profiler
4. Press Build And Run
5. Observe the Profiler

Expected result: Frame rate is stable
Actual result: Vsync value varies ~+-4ms and frame rate is unstable

Reproducible with: 2021.3.35f1, 2022.3.20f1, 2023.2.11f1, 2023.3.0b7

Testing environment: Windows 10 Pro, Windows 11 (user reported)
Reproducible on: No other environment tested

Reproducible on these devices:
OnePlus 10 Pro 5G (user reported)
VLNQA00267, Samsung Galaxy S10+ (SM-G975F), Android 12, CPU: Exynos 9 (9820), GPU: Mali-G76
VLNQA00120, Google Pixel 2 (Pixel 2), Android 8.1.0, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540
VLNQA00178, Xiaomi Redmi Note 4 (Redmi Note 4), Android 6.0, CPU: MediaTek Helio X20 MT6797M, GPU: Mali-T880

Not reproducible on these devices:
VLNQA00494 - iPhone 14 Pro Max, 16.3.1 iOS
VLNQA00358 - iPhone 12, 14.1 iOS
VLNQA00392 - iPad (9th generation), 15.0 iOS
VLNQA00310 - iPad Pro 12.9", 13.4.1 iOS

Notes:
- Limiting frame rate using "Application.targetFrameRate = 30;" still reproduce the issue
- Not reproducible on the Windows Standalone Platform
- Reproducible on Vulkan and OpenGLES3 Graphics API

  1. Resolution Note:

    Even though the the "VSync" or "WaitForTargetFPS" profiler marker is fluctuating -+a few ms, the actual frame rate was observed to be relatively stable (29.7 FPS on average).

    On Android for Frame Pacing we rely on the Android Choreographer that delivers regular ticks at the same frequency as the display subsystem. There are still subtleties as to when this tick is delivered relative to the actual hardware VSYNC, and these offsets vary by device. https://developer.android.com/reference/android/view/Choreographer

    So for reasons like device specific Choreographer ticks and OS thread suspension variation the overall frame time can vary slightly. Frame time can appear more stable on Windows because we use a clever combination of thread suspension and "busy-waiting" to get more accurate results. These options are not practical for Android.

    Just for curiousity I implemented "busy-waiting" for the Android Choreographer ticks and could notice less fluctuation for "WaitForTargetFPS" but the actual frame rate stability did not improve.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.