Could you please review the following processes for any potential issues?
Yes. It's very simple. Your app should NEVER do this:
try to setActive(YES) for workaround
The CallKit audio session is NOT a standard audio session. It's a restricted audio session configuration that:
-
Has different, higher, session priority than any other audio session.
-
Is allowed to activate in the background IF that activation comes from the properly authorized daemon.
That means:
sometimes it won't
...in the standard case, activation will fail because you're not the proper authorization. However, that activation attempt can disrupt the system and interfere with other activations.
However...
sometimes it will succeed,
These APIs are inherently race condition prone, which means that activation could succeed because, for example:
However, no matter what, that activation will not flow properly within CallKit and it will cause other issues. Making this as explicit as possible:
The "setActive(YES) for workaround" in our app CAN fix the issue.
No, it can't. It's possible that it may mask the issue in some cases; however, it's also very likely to introduce failures somewhere else.
In any case, in terms of what the real problem is, the key issue is the "SessionID 0x0" here:
error 18:44:22.533627+0800 audiomxd AVAudioSessionXPCServer.mm:404 -[AVAudioSessionRemoteXPCClient createProxySession:reply:] failed due to session lookup failure for SessionID 0x0
That session ID is the global identifier callservicesd uses to "find" your app’s audio session so that it can manage and activate it. It's not explicitly set by your app because it's actually included in the configuration payload you configure (and modify) CXProvider with. I'm not sure how it became NULL, but if I had to guess, it was either a side effect of an out-of-order process initialization (creating CXProvider prior to main) or a side effect of a system-wide disruption that wasn't handled properly.
Related to that point, please note that I'd much prefer a full sysdiagnose log over a console log snippet, as it's possible I might have been able to say more about the underlying cause if I'd had the full log so I could see where the configuration was last set.
In any case, I'd expect that setting the configuration yourself would clear the issue, unless it's caused by a broader system-wide disruption that you cannot control. Note that the configuration itself doesn't have to change; you can just use your existing configuration.
The bug is likely Apple-related.
I'm not sure if the bug itself is our (it depends on what created the specific situation); however, we could do a better job of identifying the situation and/or self-correcting. Please file a bug on that point that includes full sysdiagnose data, then post the number back here.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware