CMHeadphoneMotionManager handler not called

Hi,

Looking to experiment with the new CMHeadphoneMotionManager AirPods Motion API on iOS 14, but I'm facing issues with the CMHeadphoneMotionManager.startDeviceMotionUpdates handler not being called.

After installing the beta on an iPad Pro 11" (2020, iOS 14.0 18A5301v), I connect a pair of AirPod Pros (firmware 2D15, hardware 1.0.0), and run the following MVP reproducible case I'm using to test —

Code Block
import UIKit
import CoreMotion
class ViewController: UIViewController, CMHeadphoneMotionManagerDelegate
 {
    var motionManager: CMHeadphoneMotionManager!
    override func viewDidLoad() {
        super.viewDidLoad()
        motionManager = CMHeadphoneMotionManager()
        motionManager.delegate = self
        if motionManager.isDeviceMotionAvailable {
            motionManager.startDeviceMotionUpdates(to: OperationQueue.main) { (motion, error) in
                print(error)
                print(motion)
            }
        }
    }
    func headphoneMotionManagerDidConnect(_ manager: CMHeadphoneMotionManager) {
        print("connect")
    }
    func headphoneMotionManagerDidDisconnect(_ manager: CMHeadphoneMotionManager) {
        print("disconnect")
    }
}


isDeviceMotionAvailable returns true, but the handler (and delegate methods) are never called.

Is there a sample project for CMHeadphoneMotionManager? Am I missing something obvious?

Thanks!

Replies

I've updated my Airpod Pros to the latest firmware (released overnight, 2D27), and am still not seeing any motion events fired.
I'm experiencing the same issue on iPhone 11 Pro. My guess is that for Beta 1, this API is just a stub. Looking forward to it working!
Same issue! Has anyone got this API to work?
Team Apple: How about marking up non-implemented APIS not as Beta, but (Beta: Feature not currently implemented)
Model: A2084
FW: 2D27
CMDeviceMotion has a SensorLocation property...
 public enum SensorLocation : Int {
        case default = 0
        case headphoneLeft = 1
        case headphoneRight = 2

    }

Does this suggest we could use coremotionManager class and specify the sensor to get the raw data?
Just as a heads up, it looks like this API is still not providing data on iOS 14 Beta 2 (18A5319i) and I haven't received any word from Apple (on radar FB7771582) as to whether this is just a stubbed-out API for now.

I'm starting to think we might not get access to this until we get an AirPods firmware update closer to launch. Not sure if iOS is stubbing out these methods, or the AirPods just haven't been updated to provide the data. I imagine that when (or if) spatial audio arrives in the betas, this API will start working.

Super excited to start playing with this when it lands!
Ditto. Looking forward to when this API starts working. Hope this doesn’t go the way of AirPower haha...
I'm having the same problem. isDeviceMotionAvailable() returns true, but isDeviceMotionActive() returns false. Is there something I need to do to make it active? Or, am I waiting for beta 3? Thanks!
Anyone finding success in beta 3?
No changes on iOS 14 Beta 3 for me. No update on FB7771582 either, it's still marked as Open.
Same here. Not working in iOS 14 Beta 3 .
any change on Beta 4?
Any update on this?
As of the latest AirPod Pro firmware (3A283), I'm happy to report this is now working 🙏
For anyone interested, basic iOS app example that gets the orientation data of AirPods Pro and transmits it via OSC to any location on LAN: https://github.com/Mach1Studios/M1-AirPodOSC
Anyone have any clues on how apple plans to actually process and spatialize audio other than via Dolby Atmos?