Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug 15 FPS just showing menus in Android - Gfx.PresentFrame takes 60ms [2021.3.14f1] [Samsung S9]

Discussion in 'Android' started by Bersaelor, Nov 22, 2022.

  1. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    Hey there,

    now that our iOS application is live, we were looking into an Android release.
    I first thought our app is slow on Android during the AR scene, but it seems it's already slow in the main menu.

    I have even tried setting
    Code (CSharp):
    1. Application.targetFrameRate = 45;
    but that also didn't make a difference.

    Main thread seems to wait for render thread in `Gfx.WaitForPresentOnGfxThread` but the render thread `Gfx.PresentFrame` always runs for 58-66ms, which feels rerally weird given that I am just showing some text and images in the main menu.

    Is there a know issue about Android rendering being categorically slow?

    I also ran some ARFoundation samples from https://github.com/Unity-Technologies/arfoundation-samples and that seems to run fine, so I'm a little befuddled what could be wrong in my project.

    Screenshot 2022-11-24 at 17.05.25.png
     
  2. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    For comparison, this is how I expect the profile to look (running an ARFoundation sample app on the same android):

    The actual work should be done in 6ms, and then it should start `WaitForTargetFPS` (in this case 30fps)
    30fps arfoundation sample menu.png
     
  3. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    Turns out the problem can be replicated with the default 2021.3.14f1 URP(3D) project
    (1) download URP (3D) template project
    (2) create new Unity project based on (1)
    (3) remove OpenGLES2 from Graphics APIS
    (4) make development build for android with profiler attached

    Default-Setup:
    Screenshot 2022-11-25 at 16.04.41.png

    Profiler result:
    android default URP project slow.png