We’re developing a watchOS app to log IMU and audio data concurrently. IMU data is logged using a CMMotionManager object, while audio is recorded using an AVAudioSession. Both of these are stored on-device, and transferred to a paired iPhone once recording ends.
We’re experiencing a problem where even though we’re have instantiating a WKExtendedRuntimeSession the app stops all recording a few seconds after the watch has gone to sleep.
Recorded IMU data transfers as expected, albeit with gaps in the data where the watch was asleep. The recorded audio seems to end at the first instance of the watch falling asleep.
This also happens when the AVAudioSession is removed (and thus no audio is being recorded). This only happens on the Apple Watch Series 6, and does not happen on the latest Apple Watch Series 8. Both watches are running the same OS.
We’ve read that the WKExtendedRuntimeSession can expire if the app usage exceeds a certain CPU usage, however in both cases, Xcode indicates that CPU usage does not exceed 70%, so we doubt that this is the cause. We are also not getting a WKExtendedRuntimeSessionInvalidationReason flag that would indicate this is happening.
Could it be a hardware limitation, or is there another potential cause for this behaviour?
We’ve tested a couple of different sample rates, this does not seem to happen with a sample rate as low as 1, but does happen with a sample rate of 30.
We’ve also set the WKExtendedRuntimeSession background mode to physical therapy and ticked the workout processing box, as we understand that these can influence the behaviour/longevity of the session, to no success.