Magnetometer Access- iOS 10.2

Hello Everybody,



i have the following problem:



I try to access the magnetometer values and have a problem with the interval.

So how i access the values:

first i create a CMMotionManager:


var myMotionManager= CMMotionManager()


after that i set the interval( need the values as fast as possible)


myMotionManager.magnetometerUpdateInterval = 0.02;


after that i start the getting values:


myMotionManager.startMagnetometerUpdates(to.... in....)


it working good. So i get every 20ms new values!


I try that on a iPhone 5, iPhone 5s and iPhone SE with iOS 10.2 and iPhone 6 with iOS 9.3.2


Now i try to change the interval to 10ms so first change the magnetometerUpdateInterval to 0.01


What i see is that is working good on iPhone 5 and iPhone 5s.


event: MagnetUpdate - 9.734 ms

event: MagnetUpdate - 10.245 ms

event: MagnetUpdate - 11.346 ms

event: MagnetUpdate - 10.687 ms


What does the iPhone 6?

- set it back to 20ms


event: MagnetUpdate - 20.234 ms

event: MagnetUpdate - 20.245 ms

event: MagnetUpdate - 20.346 ms

event: MagnetUpdate - 20.687 ms

_______________________________________

What does the iPhone SE ?

- very strange !

i see two events


______log____________

event: MagnetUpdate - 20.234 ms

event: MagnetUpdate - 0.0124 ms

event: MagnetUpdate - 20.164 ms

event: MagnetUpdate - 0.0137 ms

_____________________


The intervall is measured between the events.


Do i something wrong or is that a bug on the iPhone SE? Have someone the same problem? How get the maximum interval from each device?

Hello Everyone,


i try it with more devices and see the following results:


I edit my code and set the interval on 0.01


iPhone 7 128 GB iOS 10.2


Interval = 20.284 ms

Interval = 1.03 ms

Interval = 24.09 ms

Interval = 0.956 ms



iPhone 6s 64 gb iOS 10.2


Interval: 20.1158 ms

Interval: 0.3011 ms

Interval: 19.937 ms

Interval: 0.3030 ms



Why it works on the iPhone 5s and iPhone 5 but dont work on other devices? It will be okay if the interval is set back to 20ms or other value but it is not okay to get two different interval values.

Based on what I have found, Apple is limiting the sample rate of the Magnetometer to 50Hz on the more recent iPhones even though the phone's internal chip supports operations at twice that speed.

>even though


Right, just remember that it is has always been common for various chips to perform at faster rates in the lab - processors, ram etc. Consumers (and devs) can thank device manufs. for having the sense to settle on specs (speed, power consumption, component longevity etc.) that are otherwise reliable in day/day use.


As always, feel free to make your case for different specs via the Bug Reporter, bottom right - who knows, they may be waiting for other components, such as the battery, unit price etc., to catch up, and they already have a 100Hz road map.

Magnetometer Access- iOS 10.2
 
 
Q