Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.84k stars 819 forks source link

Context loss on Starling 2.1 displaying native components #942

Closed cgascons closed 7 years ago

cgascons commented 7 years ago

Hi Daniel,

We recently updated our Starling to 2.1 and also updated our AIR SDK to 24 (build 180). We've been playing around with the immersive mode but we've been getting lots of Context losses so I thought I'd download and test your Starling-Demo-Mobile.

We downloaded the Sample from Starling 2.1 zip file and only changed the AIR SDK (from 22 to 24) and tested it in all our Android test devices. Our surprise was that the first test with your sample already (in one specific device) presented this context losses we were having by doing something so simple such as increasing/decreasing the volume (which pops-up the native volume display bar) and surprisingly the screen goes black and the context is restored.

After testing it with multiple devices this is the result we got so far:

We are testing this because some of our players are reporting this exact same behavior on their devices and honestly I'm running out of ideas. The devices that presented the errors are these so far:

1 - Sony Xperia Z5 2 - Acer B3-A20

I'm attaching below these lines both their Capabilities information we've tracked in our game in case it helps:

` = SONY Z5 =

Cap_avHardwareDisable = false Cap_cpuArchitecture = "ARM" Cap_hasAudio = true Cap_hasAudioEncoder = true Cap_hasEmbeddedVideo = true Cap_hasMP3 = true Cap_localFileReadDisable = false Cap_manufacturer = "Android Linux" Cap_pixelAspectRatio = 1 Cap_playerType = "Desktop" Cap_screenColor = "color" Cap_screenDPI = 320 Cap_screenResolutionX = 1184 Cap_screenResolutionY = 720 device_brand = "Sony" device_device = "E5823" device_manufacturer = "Sony" device_model = "E5823" device_product = "E5823" deviceInfo = "AND 24,0,0,174" os = "Linux 3.10.84-perf-g0802f10" os_name = "Android" os_type = "android" os_version = "6.0.1" platform = "Android"

= ACER B3-A20 =

Cap_avHardwareDisable = false Cap_cpuArchitecture = "ARM" Cap_hasAudio = true Cap_hasAudioEncoder = true Cap_hasEmbeddedVideo = true Cap_hasMP3 = true Cap_localFileReadDisable = false Cap_manufacturer = "Android Linux" Cap_pixelAspectRatio = 1 Cap_playerType = "Desktop" Cap_screenColor = "color" Cap_screenDPI = 160 Cap_screenResolutionX = 1280 Cap_screenResolutionY = 752 device_brand = "Acer" device_device = "corona" device_manufacturer = "Acer" device_model = "B3-A20" device_product = "B3-A20" deviceInfo = "AND 24,0,0,174" os = "Linux 3.10.72" os_name = "Android" os_type = "android" os_version = "5.1" platform = "Android" `

I'll appreciate any help/hints!

[EDIT] I forgot to say that I know there's a known issue (https://forums.adobe.com/thread/2251050) about this, but this is happening in my code (even turning the fullScreen tag off to false). Setting it to false in the sample does indeed "fix" the issue, i.e. the context isn't lost, but without having a fullScreen app.

[EDIT2]: I just found out that the reason why my code was loosing the context and yours weren't is that I was setting in my code the stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE. After adding it into your code, it also loses context.

Regards,

PrimaryFeather commented 7 years ago

I might have good news in that regard, actually! The AIR 25 Beta just came out, and it has the following statement in the release notes:

[Android] Context loss in Stage3D on android after displaying native dialog

That sounds very similar to what's happening in that thread you linked to. Could you try if AIR 25 makes any difference in your case? If it doesn't, please also check if an older AIR version (like AIR 21 or 22) make any difference. Thanks in advance!

cgascons commented 7 years ago

Will do Daniel! Thanks for the heads up!

cgascons commented 7 years ago

Hi Daniel,

Sorry it took me so long to reply. I'm happy to tell you that indeed the issue is gone on AIR 25 SDK (build126)!

Thanks for the heads up and for the help as always!

PrimaryFeather commented 7 years ago

That's fantastic news, thanks a lot for the update! :smile:

faizidev commented 7 years ago

hey guys i am facing still same issue i am compiling with using AIR 25 SDK but not got any success, i developed my game in starling 1.5 and testing on Nexus 5X with android 7.1.1 can you please suggest me another way to fixed that issue.

thanks

PrimaryFeather commented 7 years ago

My recommendation is to create a thread in the official Adobe AIR forum from Adobe: https://forums.adobe.com/community/air

Describe your problem in detail — perhaps somebody from Adobe already has an idea what you could do. Otherwise, a report at http://tracker.adobe.com would be the way to go!

faizidev commented 7 years ago

thanks for your suggestion