jerky pauses in framerate after sleep/wake on iphone 4

If I press the sleep button while my app is running, then reawaken by pressing it again, a very noticeable 1 or 2 frame pause once every couple seconds is introduced.

I had a similar problem when pressing the home button to suspend and then resuming the game. To combat this I set UIApplicationExitsOnSuspend = true in the build.settings plist. But apparently the sleep button doesn’t initiate a suspend and the game starts where it left off, but now with choppy pausing.

Is there some other plist variable I need to set to exit on sleep? Ideally I’d like to not have to exit if either button is pressed, but the framerate jerkiness is bad. Is this a bug or do I need to clean something up on sleep and/or suspend?

[import]uid: 9422 topic_id: 11803 reply_id: 311803[/import]

Would you please submit a bug report with a reproducible test case? [import]uid: 7563 topic_id: 11803 reply_id: 43057[/import]

EDIT: found the Fogbugz submit form. You still have the old Report a Bug link at the top of the page, though.

My app consists of dozens of lua modules and libraries with perhaps 20K lines of code plus all the audio and image files. I think this bug shows up because I’m pushing the performance and/or memory envelope.

I tested the same build on different devices and got different results: On an iPad2 the bug is absent. On an iPhone 4 its noticeable. On an iPhone 3gs its quite distracting. So the capability of the hardware definitely impacts the severity of the bug.

Possibly related, I recently re-enabled music (had it off for development) and noticed lots of audio drop-outs on the lower end hardware, even before going in and out of sleep mode.

I’m local in S.F. and would be happy to swing by the Ansca offices if you’d like a demo of these and a few other bugs :slight_smile: (Carlos already got a sneak peek of my game after the Barnes and Noble seminar.)

[import]uid: 9422 topic_id: 11803 reply_id: 43161[/import]