Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical FPS drop on Android devices #94261

Open
epsilonmb opened this issue Jul 12, 2024 · 4 comments
Open

Critical FPS drop on Android devices #94261

epsilonmb opened this issue Jul 12, 2024 · 4 comments

Comments

@epsilonmb
Copy link

Tested versions

Godot version: 4.2.2 stable

System information

Galaxy M20 SM-M205N (Android 10)

Issue description

  • Empty Godot project causes 90% CPU usage on Galaxy M20
  • FPS drops after 10 seconds of runtime, likely due to OS intervention
  • Issue persists in new projects with minimal scenes
  • Other games from Google Play don't exhibit this high CPU usage

Steps to reproduce

  1. Install CPU Monitor app https://play.google.com/store/apps/details?id=com.glgjing.stark
  2. Create empty Godot project with FPS display
  3. Export for Android
  4. Run on Android device
  5. Observe 90% CPU usage and FPS drop after 10 seconds

Minimal reproduction project (MRP)

MRP.zip

@Calinou
Copy link
Member

Calinou commented Jul 12, 2024

Can you reproduce this if Low Processor Mode is enabled in the Project Settings?

Also, can you reproduce this after switching the project to use the Compatibility rendering method? (Change the .mobile override of the project setting, as the dropdown in the top-right corner doesn't do this automatically until 4.3.)

@epsilonmb
Copy link
Author

  1. Test results with minimal scene, renderering method.mobile set to gl_compatibility, and Low Processor Mode on:
  • CPU usage: about 44%
  • FPS stable at 144
  • FPS drops to 60 when adding a few objects
  1. Same settings, but with Camera2D added to running scene:
  • FPS starts at 60, unlike without camera (renderer not running in best effort manner as if max fps is set to 60?)
  • CPU usage: about 67% when camera is still, often jumps to 92% or higher when moving
  1. Additional findings:
  • Low Processor Mode only reduces CPU usage in idle scenes without Camera2D
  • Changing Low Processor Mode Sleep value doesn't affect CPU usage
  • gl_compatibility rendering method doesn't lower CPU usage but slows FPS drops compared to mobile method
  • Camera2D causes high CPU usage regardless of settings
  1. Main issue: My initial report was about high CPU usage and FPS drops in a minimal Godot project on Android devices, without using Camera2D. While the suggested configurations (gl_compatibility and Low Processor Mode) improved performance somewhat for scenes without Camera2D, but they don't solve the problem entirely.

  2. Updated reproduction project: I've updated my minimal reproduction project to include a scene with Camera2D movement, allowing for testing of both the original issue and the newly discovered Camera2D performance problems.
    MRP.zip

@Alex2782
Copy link
Contributor

Galaxy M20 SM-M205N has a Mali-G71 GPU?

I tried out some Mali-GPU smartphones on Firebase Test Lab, high CPU usage was not measured.

CPU usage + Videos

Galaxy S9 (API 29) - Mali-G72

Bildschirmfoto 2024-07-14 um 00 57 43


Mate 9 (API 24) - Mali-G71

Bildschirmfoto 2024-07-14 um 00 56 53


Galaxy A10 (API 29), Mali-G71

Bildschirmfoto 2024-07-14 um 00 56 17


Nokia 1 (API 27), Mali-T720

Bildschirmfoto 2024-07-14 um 00 54 58


web-build_20240714_7dnq_starlte-29-en_US-landscape_video.mp4
web-build_20240714_7dnq_HWMHA-24-en_US-landscape_video.mp4
web-build_20240714_7dnq_a10-29-en_US-landscape_video.mp4
web-build_20240714_7dnq_FRT-27-en_US-landscape_video.mp4

@epsilonmb
Copy link
Author

Thank you for your input. Regarding CPU usage and FPS slowdown, I've noticed some discrepancies in measurement methods:

  1. Floating window method: The CPU usage displayed by the downloaded app's floating window seems to correlate well with observed FPS drops. When this shows high CPU usage, I notice frame rate decreases.
  2. Android Studio CPU Profiler: When I attach the process to Android Studio's CPU profiler, the CPU usage appears relatively stable and never reaches high levels.
    I will investigate further and update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants