3

I've been looking around for a while but couldn't find much about this. I have an AudioComponentInstance that I use to continuously record the user while in-app. This doesn't get written to a file, but I do some light processing in a recording callback. This light processing is basically an offline, lightweight voice activity detection system on every 100ms of audio data.

So essentially what I have is like the Hey Siri feature. While in-app, the microphone is always on. It waits for the user to start talking, and once the lightweight recognizer detects speech, other stuff happens.

I know this can be very battery efficient because Hey Siri is a system-wide feature. But at the same time, I have no clear idea of the impact on battery life. I only have anecdotal data – for example, the Sleep Cycle app uses 30% of battery if your phone is not charging while you sleep. So in that case, 30% battery for 8 hours of mic use. But that might be high because they're constantly doing some sort of sleep processing?

Is there a way to use Instruments or something to do an isolated battery test, or someone who has a better understanding of the microphone's impact on battery life? Thanks!

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

2

In your case, using "Hey Siri" as a comparison is not accurate because this feature relies on a dedicated SoC, specifically to optimize power usage. In your scenario, you have no choice but to consume CPU resources which will result in a higher power draw.

While further testing would be required, my assumption is that your power usage will be no better than an app in idle state at best (YMMV based on what else your app is doing).

https://machinelearning.apple.com/2017/10/01/hey-siri.html

To avoid running the main processor all day just to listen for the trigger phrase, the iPhone’s Always On Processor (AOP) (a small, low-power auxiliary processor, that is, the embedded Motion Coprocessor) has access to the microphone signal (on 6S and later). We use a small proportion of the AOP’s limited processing power to run a detector with a small version of the acoustic model (DNN).

The acoustic model it is referring to is the trigger phrase "Hey Siri", which it has been highly optimized to detect, again circling back to power and performance considerations.

CodeBender
  • 35,668
  • 12
  • 125
  • 132
  • Yeah good point. My system uses active CPU resources, albeit being very optimized at doing that. Doesn't compare to a DNN running on a dedicated LP processor. So I guess my best bet here is to run a long battery test on the app? Not super familiar, but I'm guessing Energy Log within Instruments is the way to go here. –  Jan 15 '19 at 15:32
  • You are correct in that regard. However, an important caveat is to test with a sample of hardware, since I would imagine optimizations have taken place over time. – CodeBender Jan 15 '19 at 15:35
  • Yeah, and along with doing an Energy Log, this dead simple test could work nicely too for real world conditions (test with a large sample of real users) – https://stackoverflow.com/a/40086701/3857868 –  Jan 15 '19 at 15:43