No audio on CallKit calls

Originator:vpimentel
Number:rdar://27674736 Date Originated:3 August 2016
Status:Open Resolved:No
Product:iOS Product Version:10.0 Beta 4
Classification: Reproducible:Yes
 
Area:
AVFoundation (Audio / Video)

Summary:
A lot of times there is no audio when using CallKit because AudioUnitInitialize returns a AVAudioSessionErrorCodeMissingEntitlement error. Sometimes it works, sometimes it doesn't.

Steps to Reproduce:
1. Report incoming call through CallKit (outgoing also fails), i.e., call reportNewIncomingCall method on CXProvider.
2. Answer call.
3. Method on provider delegate that notifies of a CXAnswerCallAction gets called.
4. Audio session is configured, but AudioUnitInitialize fails with OSStatus equals to AVAudioSessionErrorCodeMissingEntitlement.
5. Action is fulfilled or not, it doesn't matter.
6. didActivateAudioSession method in the provider delegate is never called.
7. No audio in the call.

Expected Results:
I expect AudioUnitInitialize to not fail, and when the action is fulfilled the didActivateAudioSession method gets called and the audio in the call works correctly.

Actual Results:
Since AudioUnitInitialize fails, it doesn't matter if the action is fulfilled or not, because the call will have no audio.

Version:
iOS 10.0 Beta 4 [14A5322e]

Notes:
This problem is visible in the Speakerbox example code:

https://developer.apple.com/library/prerelease/content/samplecode/Speakerbox

Configuration:
iPhone 6s 16GB, using Wifi

Comments

Seems Apple won't fix this bug and they don't accept that issue is. I've got the same answer from "Apple Developer Relations Response".

Bug Reporter Response

We are still seeing this kind of errors in our app and we have the “requires background audio” entitlement checked from the beginning.

Taking Speakerbox and adding the “requires background audio” entitlement makes that app throw the same entitlement error, so it doesn't help (see attached file). We have already checked that we are asking for microphone access and that we set the NSMicrophoneUsageDescription in our Info.plist. With those changes, the Speakerbox app and our app keep randomly getting this error.

What else should we check?

Apple Developer Relations Response

10-Aug-2016 04:47 PM

Please know that our engineering team has determined that this issue behaves as intended based on the information provided.

The Speakerbox sample code doesn’t have the “requires background audio” entitlement checked. This developer will need to enable background audio in their applications otherwise you will get this error if your application tries to start a session in the background.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!