airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
203 stars 11 forks source link

Android Apps frozzen for 4-5 seconds with adobe air 33.1.1.575 and 33.1.1.633 #1231

Open megajogos opened 3 years ago

megajogos commented 3 years ago

Our game works just fine with Adobe Air 33.1.1.476. But with adobe air 33.1.1.575 and 33.1.1.633 the apps frozens for 4 to 30 seconds after few minutes:

image

Looking at scout it seems like this time is wasted with "Other overhead" ??

ajwfrost commented 3 years ago

@megajogos that's a very strange log! Is this happening on all devices do you know, and does it change if you update the target SDK level?

If you're able to build with "apk-debug" and send us the resulting apk file via the link below, we can investigate further.. (and the FLM file from Scout might be useful too?) https://transfer.harman.com/requests/JEytKFoyGrqUG3FyUTXiF0

thanks

spielepalast commented 3 years ago

This seems to be happening on our games too with Samsung S8 (Android 9). I don't have more info for now but here are the logs we have: SauceLabs_Log_Samsung_Galaxy_S8_Plus_real_2021-10-15_04-10.txt

ajwfrost commented 3 years ago

Thanks @spielepalast - although the log didn't seem to suggest anything untoward happening from what I could see? We can have a play here... (although I am really not getting the hang of that game...)

spielepalast commented 3 years ago

The tutorial can help to get started, but the rules can get quite complex due to all the variations there can be with the result of the bet-phase :)

Reverting to version 33.1.1.476 solved the freezes, as well as occasional crashes we could see in another game (SauceLabs_Log_Google_Pixel_4a_real_2021-10-14_01-05.txt - from 13:04:52). Hopefully this one helps.

ajwfrost commented 3 years ago

Thanks - so from that log, it looks like an ANR:

2021-10-14 13:04:49.797 INFO:   WindowManager : Input event dispatching timed out sending to ...AppEntry.  Reason: e4f1638 ...AppEntry (server) is not responding. Waited 5001ms for MotionEvent

and 5001 milliseconds earlier:

2021-10-14 13:04:44.796 WARN:   AudioTrack : restartIfDisabled(37): releaseBuffer() track 0xedccd990 disabled due to previous underrun, restarting

Again... audio stuff ... we can try to see if this is something we can work out (a 38s delay is weird that it doesn't trigger an ANR .. but maybe there's some thread 'wait with timeout' going on..) but ultimately I want to replace all this audio stuff anyway. Can I please ask (both @spielepalast and @megajogos) are you just playing back mp3 files/embedded assets in response to touch/key events, plus maybe having music playing in the background, like a traditional game?

thanks

spielepalast commented 3 years ago

There is no background music playing in our case, only on user inputs and/or AI actions. In this particular case, the only audio played was the sound of each card when they hit the board in the tutorial: The player must wait his turn to play a card (and trigger the sound), but he can do so immediately after the previously played card (from the AI), in which case the sounds can overlap each other.

We use mp3 files which we load in a zip file. They are then unzipped by the phone.

amorganiv commented 3 years ago

After building the Starfall Numbers App with 33.1.1.633 for Android it hangs/freezes after displaying UI looping animations. This issue does not occur with 33.1.1.575. Both the animated sparkles and hand toggle use 'Event.ENTER_FRAME' to track the motions. There are sound effects played before the sparkles and hand toggle appear. num5-sparkles-ht

ajwfrost commented 3 years ago

Thanks all - we think we know what's happening here, but if anyone can provide an apk-debug build of their application that we can use to reproduce the problem and then check that we've fixed it, it would be very useful! As ever with these ones, our test cases don't seem to do whatever particular activity sequence is required to trigger the freezes/ANEs...

thanks

amorganiv commented 3 years ago

Andrew... here is an apk-debug 64bit version of the Numbers app built with AIR 33.1.1.633: Select the number 5. Sparkles will appear over the number 5. There is short delay before the hand toggle appears next to the number. It fails to display the hand toggle and the app hangs. Try to touch the number 5. It should count to 5 and display the green next button with sparkles. Again there is a hand toggle delay but it tends to freeze/hang as the hand fades in.

Here is a dropbox link: https://www.dropbox.com/s/popy0d3af5mo6bt/Starfall_Numbers_64bit_Debug.apk?dl=0

ajwfrost commented 3 years ago

@amorganiv that's great, thanks - so using that and the existing .633 code with debugging added, we could see where the freeze is happening and could confirm it's happening in the closing of the audio track where we are waiting for the critical section -> there are also some outputs regarding audio output:

10-20 19:56:29.360  3291 22538 I audio_hw_primary_abox: primary_out-out_write: Transit to Playing
10-20 19:56:29.361  3319  3684 D AudioFlinger: mixer(0xec6a5600) Spend too much time to write: delta 72(effect 1, stage 3)
10-20 19:56:29.361  3291 22538 V audio_hw_primary_abox: primary_out-out_get_presentation_position: Error is -1

not 100% sure why though, but we can double-check on this. And I don't know that this explains why our thread can't enter the critical section for 2s or 20s or whatever (it did vary!)

Anyway, with the updated code where we reworked the closing of the output so that the playback thread was left to exit and clean up itself on the way out, it means the UI thread continues fine. Not been able to reproduce the problem with that app after we updated that..

I can get a test library out to you tomorrow in case that would help so you can confirm this... armv8 by default but let me know of any other requests.

thanks

ajwfrost commented 3 years ago

FYI please use the below link to download an updated version of the runtime, which you can use to test that the fix has made an improvement here.. https://transfer.harman.com/message/kdY96z4AzyV8yIbShlFHT5 thanks

amorganiv commented 3 years ago

Thank you Andrew! The fix resolved the sparkle & hand toggle hang/freeze issue for both 'armv7' & 'armv8' builds.

kasparv commented 2 years ago

FYI please use the below link to download an updated version of the runtime, which you can use to test that the fix has made an improvement here.. https://transfer.harman.com/message/kdY96z4AzyV8yIbShlFHT5 thanks

@ajwfrost the download page says "Download Count Exceeded", could you upload the improvement again?

ajwfrost commented 2 years ago

@kasparv sorry for the delay, please use https://transfer.harman.com/message/IFo3yxFCkpDzup2RdaZgme thanks

xxxVBxxx commented 2 years ago

FYI please use the below link to download an updated version of the runtime, which you can use to test that the fix has made an improvement here.. https://transfer.harman.com/message/kdY96z4AzyV8yIbShlFHT5 thanks

Hi @ajwfrost I'm having thw same issue after upgrading the air sdk to 33.1.1.633. Could you please provide some more information on how to fix this problem cause I didn't really understand the temporary fix you made. thanks in advance.

ajwfrost commented 2 years ago

@xxxVBxxx sorry - that temporary fix link has probably expired now, but the proper fix is in the latest SDK that was released on Friday: https://airsdk.harman.com/download/33.1.1.674

Are you able to re-build with that one please?

xxxVBxxx commented 2 years ago

@ajwfrost thanks for replying. I'll rebuild with the new SDK and see if it works.