godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.75k stars 21.12k forks source link

Android 3d game hangs on startup for a few minutes with gles3 on godot 3.3.4 and later when a 3d object is present on screen. #60512

Open Nyre221 opened 2 years ago

Nyre221 commented 2 years ago

Godot version

3.3.4.stable

System information

Operating System: KDE neon 5.24 KDE Plasma Version: 5.24.3 KDE Frameworks Version: 5.92.0 Qt Version: 5.15.3 Kernel Version: 5.13.0-37-generic (64-bit) Graphics Platform: X11 Processors: 8 × AMD FX(tm)-8350 Eight-Core Processor Memory: 7.5 GiB of RAM Graphics Processor: NVIDIA GeForce GTX 970/PCIe/SSE2

Issue description

On the motorola e7i power the game hangs on startup for a few minutes on the godot logo when glse3 is in use on a 3d project. this happens with both the debug and release version of a 3d project and it doesn't happen with other devices I've tried. The motorola e7i power uses PowerVR GE8322 as gpu. i downloaded GFXBench Benchmark from google play and it can load scenes without hanging. i could try other 3d games that use gles3, but i don't know any.

motorola_log.txt

04-25 14:45:44.445   769  2009 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.godotengine.dmotorola/com.godot.game.GodotApp bnds=[217,526][322,759]} from uid 10210, pid 5665
04-25 14:45:44.463   769  2009 I ActivityTaskManager: ->startActivity for ActivityRecord{f2da57f u0 org.godotengine.dmotorola/com.godot.game.GodotApp t2859} result:START_SUCCESS
04-25 14:45:44.726 18071 18071 I ngine.dmotorol: Late-enabling -Xcheck:jni
04-25 14:45:44.736   769   797 I ActivityManager: Start proc 18071:org.godotengine.dmotorola/u0a285 for activity {org.godotengine.dmotorola/com.godot.game.GodotApp}
04-25 14:45:44.807 18071 18071 E ngine.dmotorol: Unknown bits set in runtime_flags: 0x8000
04-25 14:45:44.810 18071 18071 W ngine.dmotorol: Using default instruction set features for ARM CPU variant (generic) using conservative defaults
04-25 14:45:44.872   769   785 V WindowManager: Set focused app to: AppWindowToken{b815d95 token=Token{e16594c ActivityRecord{f2da57f u0 org.godotengine.dmotorola/com.godot.game.GodotApp t2859}}} moveFocusNow=true displayId=0
04-25 14:45:44.873   769   950 D SectionHabit: update pkgName:org.godotengine.dmotorola,type:2,data:package:org.godotengine.dmotorola ,count :9,launchCountIndex:5,fgtime:2603,fgtimeIndex:7
04-25 14:45:44.874   413   413 D android.hardware.power@4.0-impl: Enter getSceneIdByName: sceneName:org.godotengine.dmotorola
04-25 14:45:45.335 18071 18071 I chatty  : uid=10285(org.godotengine.dmotorola) identical 1 line
04-25 14:45:45.456 18071 18071 I chatty  : uid=10285(org.godotengine.dmotorola) identical 1 line
04-25 14:45:45.639  5622  5622 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1885 onStartInput(EditorInfo{inputType=0x0(NULL) imeOptions=0x0 privateImeOptions=null actionName=UNSPECIFIED actionLabel=null actionId=0 initialSelStart=-1 initialSelEnd=-1 initialCapsMode=0x0 hintText=null label=null packageName=org.godotengine.dmotorola fieldId=-1 fieldName=null extras=null}, false)
04-25 14:45:45.695 18071 18096 I AudioTrack: start  mClientUid:10285 mClientPid:18071  mSessionId:76465 app name:org.godotengine.dmotorola
##here is where it hangs
04-25 14:49:33.611   769   795 I ActivityTaskManager: Displayed org.godotengine.dmotorola/com.godot.game.GodotApp: +3m49s163ms

Steps to reproduce

1) create an empty project with gles3 and add a mesh/sprite3d and a camera. 2) export to android

Minimal reproduction project

gles3m.zip

Edit

I want to clarify that the game run after a few minutes. It's like if it gets stuck on something while loading.

Zireael07 commented 2 years ago

What happens if you delete the default environment .tres file? (A common culprit in similar issues is sky radiance map generation)

Calinou commented 2 years ago

Using the GLES2 rendering backend is preferred over GLES3 on Android, as lots of devices have poor GLES3 support in practice (especially old/low-end devices).

Nyre221 commented 2 years ago

@Zireael07 I tried to delete it and nothing has changed. even creating a new one and trying the different modes doesn't help. I also tried to change the quality/compression settings of the project and it still doesn't work.

@Calinou i know that gles3 on android is not supported very well, but in this case it seems like a problem with godot and not with the phone. besides that, glse3 supports things that are not possible with glse2 like the hdr i use for the glow effect and the shaders for the blur (the only way i found in glse2 is very heavy). Also, godot4 will not have only gles3 and vulkan? just to be sure, do you know any games made with another engine that uses gles3?

this time i searched for godot:

adb shell logcat | grep -i godot

04-25 17:13:40.340   769  1372 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.godotengine.gles3m/com.godot.game.GodotApp bnds=[125,362][230,595]} from uid 10210, pid 5665
04-25 17:13:40.358   769  1372 I ActivityTaskManager: ->startActivity for ActivityRecord{d7607ea u0 org.godotengine.gles3m/com.godot.game.GodotApp t2909} result:START_SUCCESS
04-25 17:13:40.594   769   797 I ActivityManager: Start proc 30184:org.godotengine.gles3m/u0a288 for activity {org.godotengine.gles3m/com.godot.game.GodotApp}
04-25 17:13:40.726   769  2628 V WindowManager: Set focused app to: AppWindowToken{1c1978 token=Token{aa6dadb ActivityRecord{d7607ea u0 org.godotengine.gles3m/com.godot.game.GodotApp t2909}}} moveFocusNow=true displayId=0
04-25 17:13:40.729   769   950 D SectionHabit: update pkgName:org.godotengine.gles3m,type:4,data:package:org.godotengine.gles3m ,count :8,launchCountIndex:2,fgtime:8463,fgtimeIndex:3
04-25 17:13:40.729   413   413 D android.hardware.power@4.0-impl: Enter getSceneIdByName: sceneName:org.godotengine.gles3m
04-25 17:13:41.102 30184 30184 V FullScreenGodotApp: Creating new Godot fragment instance.
04-25 17:13:41.176 30184 30184 D SensorManager: registerListenerImpl sensor = {Sensor name="Accelerometer Sensor", vendor="Sprd Group Ltd.", version=1, type=1, maxRange=78.4532, resolution=0.01, power=0.17, minDelay=10000}, delayUs = 20000, latencyUs = 0, listener = Godot{386dc8 #0 id=0x7f05001e}
04-25 17:13:41.180 30184 30184 I chatty  : uid=10288(org.godotengine.gles3m) identical 1 line
04-25 17:13:41.273 30184 30184 D SensorManager: registerListenerImpl sensor = {Sensor name="Accelerometer Sensor", vendor="Sprd Group Ltd.", version=1, type=1, maxRange=78.4532, resolution=0.01, power=0.17, minDelay=10000}, delayUs = 20000, latencyUs = 0, listener = Godot{386dc8 #0 id=0x7f05001e}
04-25 17:13:41.273 30184 30184 I chatty  : uid=10288(org.godotengine.gles3m) identical 1 line
04-25 17:13:41.391 30184 30209 I godot   : Godot Engine v3.3.4.stable.official.faf3f883d - https://godotengine.org
04-25 17:13:41.406 30184 30209 I godot   : OpenGL ES 3.0 Renderer: PowerVR Rogue GE8322
04-25 17:13:41.419 30184 30209 I godot   : OpenGL ES Batching: ON
04-25 17:13:41.455  5622  5622 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1885 onStartInput(EditorInfo{inputType=0x0(NULL) imeOptions=0x0 privateImeOptions=null actionName=UNSPECIFIED actionLabel=null actionId=0 initialSelStart=-1 initialSelEnd=-1 initialCapsMode=0x0 hintText=null label=null packageName=org.godotengine.gles3m fieldId=-1 fieldName=null extras=null}, false)
04-25 17:13:41.494 30184 30209 I godot   :
04-25 17:13:41.507 30184 30209 I AudioTrack: start  mClientUid:10288 mClientPid:30184  mSessionId:76825 app name:org.godotengine.gles3m
04-25 17:13:41.968 30184 30209 I GodotInputHandler: === New Input Device: uinput-fpc
04-25 17:13:41.969 30184 30209 I GodotInputHandler:  - Mapping Android axis 11 to Godot axis 0
04-25 17:13:42.051 30184 30209 E godot   : **WARNING**: Font oversampling does not work in "Viewport" stretch mode, only "2D". To remove this warning, disable Rendering > Quality > Dynamic Fonts > Use Oversampling in the Project Settings.
04-25 17:13:42.051 30184 30209 E godot   :    At: scene/main/scene_tree.cpp:1244:_update_root_rect() - Font oversampling does not work in "Viewport" stretch mode, only "2D". To remove this warning, disable Rendering > Quality > Dynamic Fonts > Use Oversampling in the Project Settings.
## hangs here
04-25 17:15:50.607   769   795 I ActivityTaskManager: Displayed org.godotengine.gles3m/com.godot.game.GodotApp: +2m10s264ms

tell me if there is a better way to see the logs.

Calinou commented 2 years ago

Also, godot4 will not have only gles3 and vulkan?

It will, but the GLES3 renderer in 4.x will use a more low-end friendly approach that plays better with Android GPU drivers. The GLES3 renderer in 3.x is high-end-oriented. It was never designed with the limitations of mobile hardware in mind, other than using GLES in the first place (instead of full OpenGL).

Nyre221 commented 2 years ago

It will, but the GLES3 renderer in 4.x will use a more low-end friendly approach that plays better with Android GPU drivers. The GLES3 renderer in 3.x is high-end-oriented. It was never designed with the limitations of mobile hardware in mind, other than using GLES in the first place (instead of full OpenGL).

ah, I didn't know this. thanks for the info!

Nyre221 commented 2 years ago

@Calinou @Zireael07 I want to clarify that the game run after a few minutes. It's like if it gets stuck on something while loading. I apologize for omitting this.

Calinou commented 2 years ago

@Nyre221 Can you reproduce this on Godot versions older than 3.3.4? The issue title implies this, but please comment to clarify this.

If so, this is likely a (very long) shader compilation stutter, so I'm not sure if anything can be done about it. Asynchronous shader compilation/ubershaders are a bad fit for low-end mobile devices, so they're not a viable solution here.

Nyre221 commented 2 years ago

@Nyre221 Can you reproduce this on Godot versions older than 3.3.4? The issue title implies this, but please comment to clarify this.

If so, this is likely a (very long) shader compilation stutter, so I'm not sure if anything can be done about it. Asynchronous shader compilation/ubershaders are a bad fit for low-end mobile devices, so they're not a viable solution here.

If I remember correctly this also happened with the 3.2 version of godot. Unfortunately I don't have a stable internet connection at the moment and I can't download anything to check.

Nyre221 commented 2 years ago

@Calinou I recovered the 3.3.2 version of godot from an old disk and the problem is present there too.