THE APPS: Two Cocos2d universal iOS games with a large customer base.
THE PROBLEM: Several months back (in 2011) reports started coming in, sounds would randomly cut out, only some of the sounds would play in the app, others wouldn’t. This problem can ONLY be fixed by a device reboot.
IMPORTANT NOTES & DETAILS:
The SAME code and SAME sound files played fine for over a year with NO bug reports of this sort. I wish I could pinpoint a date, but I believe the problem started with an iOS update.
The bug is incredibly hard to reproduce. I have personally seen it once, but I have had no luck causing it again. Yet we get 1-2 support emails a day with the same issue, some of which come in the form a bad reviews. If I had to pull a number out of the air, I’d guess we’re looking at a 1 in 1000 incidence. It seems maybe more common on the iPad, but I’m not sure.
Restarting the device is the ONLY way to fix the problem. Restarting the app does nothing, deleting the app and reinstalling does nothing, has to be a power down and turn back on.
A few weeks ago in an attempt to blindly fix I dumped the Cocos2d Sound engine and switched one of the apps over to ObjectAL (another openAL based sound engine), hoping it might have fixed the problem. It did not, same issue is occurring. As you'd note, both of these are just interfaces for OpenAL.
The sound files themselves were converted from wavs to cafs using Apple’s recommend method ( https://developer.apple.com/library/ios/#codinghowtos/AudioAndVideo/_index.html ), although we also used the -c 1 flag to make them single channel.
Just to be clear, the bug has nothing to do with the usual sound issues (mute switch, volume). A portion of the sounds continue playing fine, but they will never all play again until the device is powered down and restarted.
If anyone has any ideas I’d all, I’d be very grateful for the help. I’m at wits end here trying to fix a persistent bug I can’t recreate and that appears to be caused by something outside my control.