Accelerometer streaming data stopping?


I have an IOS app that is collecting streaming accelerometer data at 50Hz and after a period of time I find that the device will not send me any more data and will require a Reset before it resumes the data stream.  Other functions (eg controlling the LED) do work whist the accelerometer is stalled.  The issue only started after moving from 10Hz to 50 Hz.

I am doing a fair amount of processing of the data (Vector maths and NSArray manipulation and such) and thought that perhaps I was taking to long on the block.  However the issue still occurs after moving the processing to a dispatch queue:

 [self.metaDevice.accelerometer.dataReadyEvent startNotificationsWithHandler:^(MBLAccelerometerData *obj, NSError *error) {  

        dispatch_queue_t serialQueue = dispatch_queue_create("", DISPATCH_QUEUE_SERIAL); 

        dispatch_async(serialQueue, ^{

            [self processAccelData:obj withError:error];



I have several Mbient Pro's and its the same on them all.

Any suggestions?


  • How long does it typically take for the stream to stall out?
    Did you time the processing function to confirm it completes in 20 ms? If it takes longer than that you will never be able to keep up on a serial queue.

    Also, I would recommend creating the queue outside of the callback, as it is written you create a brand new queue on each callback (50 per second) which will use considerable memory and processing time.  Then use the setCallbackQueue on MBLMetaWearManager so that callbacks will occur automatically on your custom queue instead of having them come first on main and transferred over to the custom one.
This discussion has been closed.