We’ve been getting frequent reports from users about our game crashing halfway through our tutorial on GT-I9100 devices, and we wasted considerable time trying to dig into it before finally just buying an I9100 and debugging locally. Once we had the device, it was nearly trivial to find out that it was caused by loading too many sound effects.
Now, on researching specifically that issue, it’s clear in http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Use\_OpenSL\_ES\_to\_play\_effect\_on\_Android that there’s a limit to 31 sound effects.
I have 2 points to make here:
1) That limitation is hard to discover and causes an app crash.
2) It should be very easy to build in safety checks to the OpenSLEngine.cpp. Either a system that tracks the loaded effects and unloads, the oldest when you try to play a new effect, or simply a system that stops playing new effects when you get over the limit. Lack of audio or more delays to play effects is a much preferred outcome over an app crash.
I’m going to be implementing a system to unload older effects, but I’ll be implementing it in JS,where it won’t be very useful to anyone not using JS Bindings. It’d probably be a very good idea for someone to implement some safety checks into the C++ code
Something like 50% of our app’s 1 star ratings were caused by this bug, and we’ve had to disable the I9100 for our last couple of releases.