You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the app's AVAudioSession has the .mixWithOthers or .interruptSpokenAudioAndMixWithOthers option enabled, and CallKit is not enabled, Chime SDK fails to connect to the meeting while the app is backgrounded with audioFailedToStart error (specifically when calling meetingSession.audioVideo.start()). Connecting in the foreground works fine. This bug occurs when trying to reconnect to the conference after an interruption from another audio source or phone call.
To Reproduce
Steps to reproduce the behavior:
Enable .mixWithOthers option on the AVAudioSession
Handle phone call interruptions by stopping the meeting session when the interruption starts, and starting the session again when the interruption ends.
Call will fail with audioFailedToStart error
Expected behavior
Successfully connect to the meeting
Logs 2023-09-22 11:27:45.734040-0400 **redacted**[63175:18733445] [**redacted**][ChimeConferenceSession] - ERROR: Failed to reconnect to chime conference: audioFailedToStart (no additional information is logged about the error from the SDK)
Test environment Info (please complete the following information):
Device: iPhone 14
OS: iOS 16.3.1
Version AmazonChimeSDK: 20.0
Version AmazonChimeSDKMedia: 16.0
Can you reproduce this in the demo app? No
Additional context
One workaround that I've found is to use mono16k audio mode in the Chime SDK configuration. However, this is not acceptable for our use case which requests high fidelity audio
Example code for handling audio interruptions without CallKit:
/// Initializes NotificationCenter observers
func initNotificationCenterObservers() {
NotificationCenter.default.addObserver(
self,
selector: #selector(handleInterruption),
name: AVAudioSession.interruptionNotification,
object: AVAudioSession.sharedInstance()
)
}
/// Handles conference interruptions. More information
@objc private func handleInterruption(notification: Notification) {
guard let userInfo = notification.userInfo,
let typeValue = userInfo[AVAudioSessionInterruptionTypeKey] as? UInt,
let type = AVAudioSession.InterruptionType(rawValue: typeValue) else {
return
}
if type == .began {
meetingSession.audioVideo..stop()
}
if type == .ended {
if let optionsValue = userInfo[AVAudioSessionInterruptionOptionKey] as? UInt {
let options = AVAudioSession.InterruptionOptions(rawValue: optionsValue)
let shouldResume = options.contains(.shouldResume)
if (shouldResume) {
do {
try meetingSession.audioVideo.start()
} catch {
logger.error("Error reconnecting to meeting")
}
}
} else {
logger.info("Interupption ended but iOS indicates that we should not resume")
}
}
}
The text was updated successfully, but these errors were encountered:
Describe the bug
When the app's AVAudioSession has the
.mixWithOthers
or.interruptSpokenAudioAndMixWithOthers
option enabled, and CallKit is not enabled, Chime SDK fails to connect to the meeting while the app is backgrounded withaudioFailedToStart
error (specifically when callingmeetingSession.audioVideo.start()
). Connecting in the foreground works fine. This bug occurs when trying to reconnect to the conference after an interruption from another audio source or phone call.To Reproduce
Steps to reproduce the behavior:
audioFailedToStart
errorExpected behavior
Successfully connect to the meeting
Logs
2023-09-22 11:27:45.734040-0400 **redacted**[63175:18733445] [**redacted**][ChimeConferenceSession] - ERROR: Failed to reconnect to chime conference: audioFailedToStart
(no additional information is logged about the error from the SDK)Test environment Info (please complete the following information):
Additional context
One workaround that I've found is to use
mono16k
audio mode in the Chime SDK configuration. However, this is not acceptable for our use case which requests high fidelity audioExample code for handling audio interruptions without CallKit:
The text was updated successfully, but these errors were encountered: