Scirra / Construct-bugs

Public bug report submissions for Construct 3 and Construct Animate. Please read the guidelines then click the 'Issues' tab to get started.
https://www.construct.net
107 stars 83 forks source link

r143 Android exports gets MALI Devices Bug back #2814

Closed kingpirux closed 5 years ago

kingpirux commented 5 years ago

Problem description

Attach a .c3p

Steps to reproduce

  1. Export to android
  2. Install in the device with Mali GPU
  3. With turn screen activated, after instalation open the game and turn the screen landscape to portrait many times

Observed result

Expected result

More details

For some weird reason, the remote preview works fine most of the times but in random cases the problem pop up. It only affects exported apps. Maybe exported apps uses an old Chrome and is not included the fix. According to: https://bugs.chromium.org/p/chromium/issues/detail?id=934823#c33 the crhomium solution is NOT comming until JUNE. So i recommend to keep the workaround as before until this is completly implemented in exports as well (please dont forget to check for Android Studio update as well).

*First affected release: r143

System details

Tested on Nokia 3 with Mali-T720MP1

Boulerzzz commented 5 years ago

I get the same thing.

Does this work for you? (see the video)

video-1554460258.zip

If you exit full screen and enter again it works for me.

AshleyScirra commented 5 years ago

Can't reproduce on a Samsung Galaxy Tab S2 (SM-T710) which has a Mali-T760 MP6, either via Remote Preview or with a built APK. This device previously reproduced Mali issues with WebGL 2. This is a strong sign - as I already said - that the issue is NOT related to the referenced issue. That Chrome bug is now fixed, a workaround found based on the root cause, and both the fix and the workaround verified, and the issue closed. Chrome 75 coming out will not affect anything. It is possible there is a different, unrelated issue which has similar looking symptoms; even so it is a new issue which will need a separate investigation. Unfortunately until we can reproduce the issue there is nothing we can do. If there is a device-specific GPU driver bug, unfortunately there isn't much we can do about it; you could try reporting it directly to Google.

kingpirux commented 5 years ago

I get the same thing.

Does this work for you? (see the video)

video-1554460258.zip

If you exit full screen and enter again it works for me.

intresting ill try

kingpirux commented 5 years ago

@AshleyScirra the fix that @Boulerzzz propoused worked, so there you have a clue about it, it might be an issue with the chrome fix in certain phones. how we can send this report to chrome?

Boulerzzz commented 5 years ago

@kingpirux It is most likely not related to the Mali bug we had in r137.

I had this exact issue in r142 as well but then it only affected larger text objects and I was able to work around it by using spritefont. Now its the whole game that wont render before you exit and enter full screen.

We will have to be able to create a minimal project before Ashley can do anything about it tho.

kingpirux commented 5 years ago

@Boulerzzz what phone are you using? mine is a nokia 3 maybe the problem is quite specific

kingpirux commented 5 years ago

i didnt have any problem at all in the same projects in 142.3

Boulerzzz commented 5 years ago

I have both a oneplus 3 and a honor 9 lite

Oneplus 3 with Adreno 530 works fine Honor 9 lite with Mali-T830 does not work.

Ok maybe you did'nt have any large text objects. Those were the only ones giving me problems before. :)

kingpirux commented 5 years ago

can you create that large text object minimal project to test with r142? so we can check if it was or wasn't the mali workaround?

kingpirux commented 5 years ago

can it be the mp cores? mp1 is 1 core, mp2 is 2 cores, mp6 is 6 cores/threads ._. i dont know im not an expert on this, just researching

Boulerzzz commented 5 years ago

Try remote preview in latest stable with this project. Text won't be rendered on my honor 9 lite.

TEST.zip

kingpirux commented 5 years ago

Try remote preview in latest stable with this project. Text won't be rendered on my honor 9 lite.

TEST.zip

intresting!!! it also banished, please make the bug report so Ashley can check it out. But this is a litle bit different, since the entire screen is being rendered EXCEPT the text. But in my games there are not that many or big text boxes

kingpirux commented 5 years ago

And add this tested on: Honor 9 Lite: Mali-T830 MP2 Nokia 3: Mali-T720MP1 Samsung J7 Prime: Mali-T830 MP1 Samsung Galaxy S6: Mali-T760 MP8

kingpirux commented 5 years ago

@AshleyScirra i made chromium issue https://bugs.chromium.org/p/chromium/issues/detail?id=950205 and other thing, i found an other weird thing, with firefox's geckoview this bug doesn't happend, and it works, but there firefox doesn't render tilemaps if you use 0,5 or lower layout scale (i found this since i needed to upload a game in a very old AndroidTV for a job and the only way was making an apk with geckoview)

AshleyScirra commented 5 years ago

FYI it looks like you haven't yet proven it is a Mali issue because your report lacks test results from other devices.

kingpirux commented 5 years ago

also tested on MotoG5 adreno 505, MotoG6 adreno 508, Oneplus 3 with Adreno 530 works fine

kingpirux commented 5 years ago

@AshleyScirra can you test this: https://drive.google.com/file/d/1ACxMl8VB3ZEEbpEGAevxvWbIoWKwHD3e/view?usp=sharing on your galaxy tab ? wait for the light blue screen or the "start game" button, and tell me if it shows up

AshleyScirra commented 5 years ago

Sorry, I won't run pre-compiled APKs. I will investigate .c3p files though.

kingpirux commented 5 years ago

Sorry, I won't run pre-compiled APKs. I will investigate .c3p files though.

i was thinking, since it's an old phones problem (all affected are 2016 and older, and here in argentina is a standard), is there a posibility to make the "Use WebGL1" a gpu optional choice on project options? Like "only for old phones with graphic glitches", to be sincere i updated the version on a game i made for a client, and it stoped working on their Samsung J7, i currently dont care about performance, i just want it to work again for them, and it was working on r142 and i checked that the balcklisting made those phones work, it was my mistake to update on a betta release, i know, but it wasnt before that on an untouched project, i just made the mistake to save the beta release because i needed to export it again and didnt check that i was on beta construct...

PD: think about this option like a "test" on the next beta, if it helps other people, it could stay as a solution for 3rd world projects :P i would gladly help on testing on all our old phones.

AshleyScirra commented 5 years ago

Adding a WebGL 1 option doesn't actually fix anything. This simply postpones the problem until later, where usually it comes up again, but in a more complicated combination with another factor, which ends up being worse. Further if the only way to get it to work everywhere is to force WebGL 1, then there's no point having an option, since it basically means "would you like your app to be broken on some devices or not?". If it can't work everywhere, the engine should disable it. However that is a drastic option that in turn prevents devices that could work perfectly well with WebGL 2 from gaining the benefits of it.

In short as ever the only sensible option is to find the root cause of the issue, and either fix it, or work around it on the affected devices. This requires a thorough investigation and a clear understanding of the problem. So far I am unable to reproduce the problem and as far as I can see the previous issue with WebGL 2 on Mali is fixed. We are also not seeing any reports from other users (previously there were long forum threads with lots of people saying they had issues; this does not seem to have happened again). Therefore I would suspect a GPU driver bug affecting a minority of devices. These things happen - GPU drivers are notoriously poor quality, and it's difficult to do anything about it. All developers doing anything with computer graphics with any technology struggle with this. Your best bet is a very thorough report with Google with a minimum reproduction and comprehensive cross-device testing results.

kingpirux commented 5 years ago

@Boulerzzz can you help me testing on the broken device with this instructions: To test WebView using Chrome Canary, you must follow the instructions on this page: https://www.chromium.org/developers/androidwebview/android-webview-beta (use the steeps on Android N with canary)

Boulerzzz commented 5 years ago

Yes it works when using chrome canary webview. Interesting.

Edit: both chrome dev and chrome canary makes the game work. Chrome beta and chrome regular produces the rendering issue.

kingpirux commented 5 years ago

ill try in a few more devices and report back. Looks like android exported apps uses only the stable chrome and not the android webkit on those devices, that means that all devices with this problem will keep it until June when Chrome is updated.

kingpirux commented 5 years ago

i found that Huawei GW uses mali 450 mp4, BUT it uses android EMUI that updates the android webview and so it works fine; Nokia 3 uses Chrome as webview and (i dont know why) it doesnt allow to pick android webview but with canary it started to work.

kingpirux commented 5 years ago

@AshleyScirra https://bugs.chromium.org/p/chromium/issues/detail?id=950205#c13 the confirmation that it was the corrupted mali problem :( saddly we have to wait until june for the fix to come to this devices T.T well it was good trying and learning a lot from it.

AshleyScirra commented 5 years ago

Ergh, I suppose maybe the VAO workaround that Google recommended does not work for all devices after all. I'll just disable WebGL 2 on Android until Chrome 75 is out then... :(

Boulerzzz commented 5 years ago

@AshleyScirra I haven't had time to look into this any further but I just built a bunch of APKs and made some tests and here is what I found.

In my projects I like to use a loader layout. On the loader layout I usually load files from ajax and saves from localstorage etc. so that everything is ready when the game starts. I noticed that another project I have works fine on my phone when compiled from r144!! That project however, takes a longer time to load because I got a bunch of files that need to be loaded using ajax. This made me think it could be something with the loader layout.


The project that I had an issue with is very small and have only a key from localstorage to load. On the loader layout I just use these events.

  1. On loader layout complete -> check if key exist
  2. Key exist/missing -> go to "game"

Now that makes the game not render objects.

But this made it work

  1. On loader layout complete -> check if key exist
  2. Key exist/missing -> "Wait 1 sec" -> go to "game"

Note: It also works if I'm not using a loader layout at all.


I could not reproduce this in a minimal project.

It still works on chrome canary without a wait action on the loader layout event sheet.

Can you @kingpirux try to place a "wait 1 sec" or remove your loader layout and see if that solves this for you?

Anyways this seems to have solved it for me!

Also if all projects had this issue on mali devices we should see more reports about it, right? That's why I think it's something else. I don't know if this helps but I thought I would write my solution before you disable webgl 2!

AshleyScirra commented 5 years ago

I would guess this is a non-deterministic GPU driver bug (which effectively happens randomly), and adding a wait simply renders a few more frames which might postpone the issue. That doesn't actually solve the problem, it probably only delays it.

SnipG commented 5 years ago

Ones that have the bug, just use the affected phones with the minimum cases from that Mali issue report. If they don't reproduce then could be something else. If so, then you wait months for chrome 75, if it's out and tests will still fails - you file new issue for chrome and then you start waiting chome 78 etc. So next year same time you might get it fixed if you guys don't test stuff futher atm.

kingpirux commented 5 years ago

i dont get what snip is pointing, but that's what we did, we tested the problem to find out what was causing it, there was a fix, but the fix is not applied in all phones in the same way, lets resume that we all, including Ashley, learned something new: not all phones works with WebView in the same way, some use Android WebView (so when a fix comes up, it is appliedd right away) some other uses official Chrome (so fixes will come when Chrome updates come)