Hello!
I noticed that whenever the proximity sensor is on and activated (phone is next to ear), CPU usage spikes with about 10%. I am testing this with m59 and the codec is OPUS.
I have been able to consistently reproduce this in my app on the initiator side on multiple iPhone 7 Plus devices and sporadically on a 5S device, all of them running iOS 10.3.2. This only happens on the initiator side.
Checking the thread based CPU analysis in Xcode reveals that there is a definitive jump in activity in the AURemoteIO::IOThread whenever the proximity sensor is covered. This is mimicked by the VoiceProcessThread as well, which I am guessing that makes sense because it processing whatever the IOThread thread throws at it.
I don't set any preferred number of channels/IO buffer duration/sample rate, this is what the RTCAudioSession looks like in a call:
category: AVAudioSessionCategoryPlayAndRecord
categoryOptions: 4
mode: AVAudioSessionModeVoiceChat
isActive: 1
sampleRate: 48000.00
IOBufferDuration: 0.010667
outputNumberOfChannels: 1
inputNumberOfChannels: 2
outputLatency: 0.000896
inputLatency: 0.000521
outputVolume: 1.000000
I checked Signal which uses a similar setup, they have the exact same values for the RTCAudioSession, however this CPU spike is not reproducible in their app.
Can anyone give me an idea what is happening here? Is there a reason why the CPU usage would spike when the screen is off?
Thanks!