Search Issue Tracker

By Design

Votes

0

Found in

2020.3.47f1

2021.3.24f1

2022.2.18f1

2023.1.0b15

2023.2.0a13

Issue ID

UUM-35582

Regression

Yes

[Android] Target Frame Rate cannot be set to 45 Hz on a 60 Hz device

--

-

How to reproduce:
1. Open the attached “IN-40698” project
2. In Edit → Project Settings → Player under Resolution and Presentation disable Optimized Frame Pacing
3. In the Build Settings click Build And Run on the connected device
4. When the app loads, observe the Average Frame Rate

Expected result: The Average Frame Rate is the same as the Target Frame Rate
Actual result: The Average Frame Rate is the same as the Screen Refresh Rate

Reproducible with: 2020.3.47f1, 2021.3.20f1, 2021.3.24f1, 2022.2.18f1, 2023.1.0b15, 2023.2.0a13
Not reproducible with: 2021.3.0f1, 2021.3.19f1
Could not test with: 2021.2.0a21 - Build failed due to gradle errors

Built with: macOS 13.2 (Intel)

Reproducible on devices:
VLNQA00331 - HUAWEI P20 lite (ANE-LX1), CPU: HiSilicon Kirin 659, GPU: Mali-T830, OS: 9
VLNQA00520 - Galaxy S22 USA (SM-S901U), CPU: Snapdragon 8 Gen 1 (SM8450), GPU: Adreno 730, OS: 12 (Display Refresh Rate is set to 60Hz)
VLNQA00134 - Samsung Galaxy S8 (SM-G950F), CPU: Exynos 9 Octa 8895, GPU: Mali-G71, OS: 9.0.0
VLNQA00523 - Galaxy S23 (SM-S911U), CPU: Snapdragon 8 Gen 2 (SM8550), GPU: Adreno 740, OS: 13 (Display Refresh Rate is set to 60Hz)

Notes: The issue does not reproduce with the Target Frame Rate set to 30. If it is set to 29 the issue reproduces, and the Average Frame Rate is 30.

  1. Resolution Note:

    As specified in the Unity docs, the Application.targetFrameRate has to be the screen's refresh rate divided by an integer. While 45FPS is not an allowed value for a 60Hz screen, it's a valid value for 90Hz screens.

    This behaviour was wrongfully working before a fix we introduced in 2021.3.20f1, now frame times are calculated more precisely and the game framerate does not stutter as it did before. Please, refer to the following issue to learn more about the fix that introduced this change: https://issuetracker.unity3d.com/issues/android-time-dot-deltatime-values-arent-stable-on-specific-devices

    A mobile device's maximum achievable frame rate is the refresh rate of the screen. For example, a device with a refresh rate of 60 Hertz has a maximum achievable frame rate of 60 frames per second. To target the maximum achievable frame rate, set Application.targetFrameRate to the screen's refresh rate. Screen.currentResolution contains the screen's refresh rate.

    To conserve battery power, the default frame rate on mobile platforms is lower than the maximum achievable frame rate. Usually, the default frame rate on mobile platforms is 30 fps. To target the default frame rate, set Application.targetFrameRate to -1.

    To target a frame rate other than the maximum achievable frame rate or the platform default on mobile platforms, set Application.targetFrameRate to the screen's refresh rate divided by an integer. If the target frame rate is not a divisor of the screen refresh rate, the resulting frame rate is always lower than Application.targetFrameRate.

    Note that mobile platforms ignore the QualitySettings.vSyncCount setting. Instead, you use the target frame rate to achieve the same effect as setting the vertical sync count. To do this, divide the screen's refresh rate by the number of vertical syncs you want to allow between frames, and set Application.targetFrameRate to this number.

    For example, on a device with a screen refresh rate of 60 Hz, to allow:
    - 1 vertical sync between frames, set targetFrameRate to 60.
    - 2 vertical syncs between frames, set targetFrameRate to 30.
    - 3 vertical syncs between frames, set targetFrameRate to 20.

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.