After updating to 3.5.5 we’re seeing a multi-second (3-4 second) freeze/hang after resuming our running game. We’re seeing this issue on the Kindle Fire only, other Android devices aren’t showing the problem. The game eventually resumes running correctly.
It’s pretty nasty though as the game appears to be completely unresponsive during this time and if you rapidly tap the screen you can get the “force kill or wait?” error pop-up, making it appear like it has crashed. This also occurs after attempting to make an IAP and I’m concerned users will worry that their transaction won’t go through.
I haven’t complied anything to test that yet but I assume it’s coming from that 3.5.5 fix: “Android: Fixed black screen on Kindle when accessing Quick Settings.”
There was an earlier app (not sure about the unity version that complies it, probably pre 3.4) which quick settings was also working properly. I’m mentioning this as it was behaving exactly the same as your description.
I’m not sure about the IAP part tough. I’ll run a quick re-complie tomorrow to test and post back my results…
Well IAP test still needs to wait till tomorrow but I just ran a quick pause/resume test.
And it appears to be working ok (with a very simple game), pauses ok then resumes instantly. There is a very quick black screen flash tough, right before resuming…
Tested using quick settings, home button resume + hw button sleep resume…
Our game is near completion so perhaps the issue is related to how many assets loaded at the time the app is resumed (we have a lot more in memory than a blank or near-blank project). Hard to say though.
Is it possible to connect the Editor’s profiler to an Android device build? I’ve only done that on iOS. If is is possible perhaps I could get a better idea of what is taking so long.
Ok, I was able to connect the profiler and watch what happens on the CPU during the hitch. Unfortunately, it’s not really telling me anything useful.
On a regular frame time spent in Camera.Render in this scene is very low (it’s our front-end UI) and is typically about 2 ms on the Kindle Fire. On the frame that occurs right at the point of resume, Camera.Render time spikes to 160 ms. That’s still vastly lower than the actual time of the hitch, which as I said is about 3 seconds, implying to me that the issue is happening somewhere in the engine core that isn’t exposed to the profiler.
Camera.Render → Drawing → Clear is taking 66 ms in the frame mentioned above. Wacky.
I suppose I’ll have to contact Unity directly about this one unless someone else has seen this exact issue and knows what the solution is.
We are currently working in an iOs game and the Camera.Render → Drawing → Clear on some situations takes around 80-120 ms in lots of consecutive frames. Does not happen with iPad2 or our Android devices.
The problem occurs when the user is walking around the map. We could not relate the ‘clear’ delay with the area he is in - most of times, it just seems random.