Accelerometer error on iPhone 6 device

I am seeing the following error in the Xcode console the first time that I set the accelerometer interval and add the runtime listener to the accelerometer:

<Error>: CoreLocation: Could not get ideal gyro update interval, assuming 0.005000 s

It does not happen on subsequent times when I set the accelerometer interval and add the runtime listener to the accelerometer.

Everything seems to work okay.  Is there any reason to be concerned over this?

I am using build 2511.  This occurs when building for the device and testing on my iPhone 6.  Have not tried on any other devices at the moment.

Hi @thegdog,

If this isn’t causing an actual error in your app, and it’s not affecting the user experience of the app, then I wouldn’t worry about it. Most likely, it’s taking a brief moment for the hardware to “activate”, but once it catches up, then it works as expected. This is fairly typical actually, in regards to device hardware needing a short amount of time to get going before you try to utilize it.

Best regards,

Brent

I had previously built and released with a different daily build and it did not happen there, so I was surprised to see it pop up now.

Everything seems to be working fine.  Will do some more testing and make sure that nothing else pops up.

Thanks Brent.

Are you trying to set the interval?  system.setAccelerometerInterval() – http://docs.coronalabs.com/api/library/system/setAccelerometerInterval.html

It should be set to the same as your FPS. 

Rob

Yes, I do believe it is the first time I am setting the interval (that the error appears).

Interestingly, I had my FPS set to 30, and then I was setting the interval to 60.  I had tried lower values, but it just didn’t work well on any device I tried it on.  60 was the best interval for all the iOS devices that I had tested.  For my Android devices, 60 worked okay for some, but others required 80.

Will see when I test Android now that I bumped the FPS up to 60.  Will see if it makes any difference in how the accelerometer works on Android.

The way Engineering explained this to me is that if you set a value higher than the FPS of the app, you’re asking the system to generate more events than can be visibly drawn anyway.   In other words in a 30 fps app, and you’re set to an interval of 90, it’s gong to give you three updates per frame.  Since you can’t update the screen any faster, then its not doing  you any good taking away CPU time that could be going to other things.

If you set your interval to 30 but your app runs at 60 fps, then you’re events will fire off on average of every other frame which could lead to jittery performance.  On the other hand on some devices  calling it any faster could lead to more performance problems…  This of course could have nothing to do with the error your getting and it sounds like it’s not causing a problem.  I was just suggesting setting the interval to make sure you don’t get stuck on some default you may not want.

Rob

Thanks, Rob, but I am not really doing any intense screen drawing while the accelerometer is in use.  It’s for a Heads Up-like game where tilting the device brings up the next answer.  So all I really need to do is capture the device being tilted more than a certain amount in a certain direction when it happens.

And on some Android devices, with the interval set to 60, it seemingly took a couple of seconds to register sometimes.  I am interested to see if it got any better with setting the FPS to 60 as well.

Hi @thegdog,

If this isn’t causing an actual error in your app, and it’s not affecting the user experience of the app, then I wouldn’t worry about it. Most likely, it’s taking a brief moment for the hardware to “activate”, but once it catches up, then it works as expected. This is fairly typical actually, in regards to device hardware needing a short amount of time to get going before you try to utilize it.

Best regards,

Brent

I had previously built and released with a different daily build and it did not happen there, so I was surprised to see it pop up now.

Everything seems to be working fine.  Will do some more testing and make sure that nothing else pops up.

Thanks Brent.

Are you trying to set the interval?  system.setAccelerometerInterval() – http://docs.coronalabs.com/api/library/system/setAccelerometerInterval.html

It should be set to the same as your FPS. 

Rob

Yes, I do believe it is the first time I am setting the interval (that the error appears).

Interestingly, I had my FPS set to 30, and then I was setting the interval to 60.  I had tried lower values, but it just didn’t work well on any device I tried it on.  60 was the best interval for all the iOS devices that I had tested.  For my Android devices, 60 worked okay for some, but others required 80.

Will see when I test Android now that I bumped the FPS up to 60.  Will see if it makes any difference in how the accelerometer works on Android.

The way Engineering explained this to me is that if you set a value higher than the FPS of the app, you’re asking the system to generate more events than can be visibly drawn anyway.   In other words in a 30 fps app, and you’re set to an interval of 90, it’s gong to give you three updates per frame.  Since you can’t update the screen any faster, then its not doing  you any good taking away CPU time that could be going to other things.

If you set your interval to 30 but your app runs at 60 fps, then you’re events will fire off on average of every other frame which could lead to jittery performance.  On the other hand on some devices  calling it any faster could lead to more performance problems…  This of course could have nothing to do with the error your getting and it sounds like it’s not causing a problem.  I was just suggesting setting the interval to make sure you don’t get stuck on some default you may not want.

Rob

Thanks, Rob, but I am not really doing any intense screen drawing while the accelerometer is in use.  It’s for a Heads Up-like game where tilting the device brings up the next answer.  So all I really need to do is capture the device being tilted more than a certain amount in a certain direction when it happens.

And on some Android devices, with the interval set to 60, it seemingly took a couple of seconds to register sometimes.  I am interested to see if it got any better with setting the FPS to 60 as well.