iOS 10 GM Slow touch response in OpenGL/GLKit apps

Upon upgrading to Xcode 8 GM / iOS 10 GM, I noticed scrolling around my farm in Egg, Inc that it was juddering. Seeing it was 60 fps, I investigated and found that 1 touch move event was firing for every-other frame update.


I then created a new project using the GLKit template, adding a catch for the touch move event, and same thing, 1 touch move event for every-other frame.


Is anyone else seeing this, and has anyone figured out a workaround?


Bug submitted: 28199497

Replies

I do have exactly the same issue. Only difference is that i'm running on final versions of both. iOS and Xcode.


I guess that possible workaround might be to use older version of xcode for now.

Yep same here. OpenGL rendering has slowed down a lot for me in iOS 10. Still works fine on iOS 9, but it's blocking the main thread on iOS 10 so that touchesMoved can't get through. Still investigating.

Also having the same issue - been hammering on this for days, so nice to have some confirmation.


My app is a drawing app, and occasionally the framerate appears to drop - but as mentioned, it's not the framerate, it's the input rate. Occasionally, the input rate drops to 30hz, which effectly makes my render drop to 30fps since nothing happens if there aren't new input samples.


I created a new Project with just a standard UIView, no custom draw, and it only produces 30 touchesMoved events per second. This is on an iPad Pro with the pencil or fingers.

I have a similar problem. My app that uses SceneKit runs great on an old iPad 2 iOS 9.x about 40 fps, but on iOS 10 it runs with half the framerate, about 20 fps. Im trying to find out what causes this problem, but it is really a waste of time to have to downgrade and upgrade the iOS on the iPad to make the different tests.

To follow up on this, I got a resonse on my bug report to Apple. This is the response:


"As long as you don't cause any display updates the screen stays in low power and therefore 30hz mode, which in turn also keeps the event input stream down at 30 hz. A workaround is to actually cause a display update on each received move, even if it is just a one pixel move of a view if input is needed while no explicit screen update will be triggered."


In my application, using a GLKView, I set its preferredFramesPerSecond to 60. Occasionally, my input rate would randomly drop to 30hz. The response from Apple doesn't fully explain why this would happen, but apparently the expected method of handling this is to call display() directly from touchesMoved() while dragging.


I've subclassed GLKView and I set preferredFramesPerSecond to 60. On touchesBegan(), I set isPaused=true, and start calling display() within touchesMoved(). On touchesEnd(), I set isPaused=false. Doing this, I'm no longer having any issues - the app is more performant than it's ever been.


Apple's example TouchCanvas.xcodeproj does all drawing from within touchesMoved() as well, so I guess this is the intended way to handle this.

I have been having the same issue with my opengl game on iOS 10. My game uses GLKViewController with preferredFramesPerSecond set to 60 and up until iOS 10 I had no issues with UITouch rate. But with iOS 10, the touches suddenly start becoming sluggish after a few seconds into the game. Based on meanderingbrian's response above, the following is what I have done to fix my issue:


In viewDidLoad, I set self.enableSetNeedsDisplay to YES.

Then in drawInRect, I added the following code:


dispatch_async(dispatch_get_main_queue(), ^{

[(GLKView*)self.view setNeedsDisplay];

});


Hope this helps someone.