PTT Framework Failing to Un-mute Microphone After Media Services Reset

Hi,

I wanted to reach out about an issue we're seeing in PTT Framework.

We have been investigating reports from some users that our app would run without issue for a day or so and then they would suddenly be unable to transmit audio but playback continued to work normally. After doing some digging and internal testing I was able to reproduce this by triggering a media services reset while PTT Framework was active (we had joined a channel). When this occurs everything appears to work correctly, all normal callbacks are received and the audio session is activated, but the data from the tap on the input node of our audio engine returns only silence regardless of whether the app is in the foreground or background.

I'm able to reproduce this with 100% reliability using the following steps:

  1. Activate PTT Framework by joining a channel.
  2. Navigate to Settings -> Developer, tap Reset Media Services, and select Reset All Media Services.
  3. Return to the app and attempt to transmit.

I've validated this behavior both in our app as well as in a separate minimal test app we use internally to validate interactions with the framework.

Once we end up in this state it persists through tearing down and recreating our audio engine, deactivating and re-activating the audio session, killing the app and restarting it, etc. The only way we have found to recover from this state is to either reboot the device or leave the framework's channel and join again (basically toggle PTT Framework off and back on).

Based on what I was able to find I believe this is the known CallKit issue (r.157725305) referenced in this forum post and does extend to PTT Framework.

As mentioned above, we currently haven't found a good way to deal with this. Our current solution to this is to programmatically "toggle" PTT framework. This partially solves the problem but it has a couple issues:

  1. It causes the PTT Framework activation and deactivation sounds in quick succession. This is expected but not ideal UX.
  2. Because attempting to join a channel when the app is not in the foreground results in a failure with PTChannelError.appNotForeground we can only recover when in the foreground.

The second issue is the more serious of the two as our users commonly rely on external wired or BLE devices to trigger PTT calls while the device is locked or the app is in the background. In this scenario we can't automatically recover so they won't know something is wrong until they realize they are only transmitting silence.

We can identify when this occurs via the internal media services reset notification but again we only receive this while the app is active. Additionally, if the app was suspended when the reset occurred but then becomes active it is received after a 2-4 second delay so if the app wakes up to start a call, we commonly don't receive it until the user is already in the middle of a call trying to transmit.

Is there anything we can do here other than posting a notification telling the user that there is an issue and they need to on-screen the app to resolve it? I've tried to provide as much information as possible but if there's anything else that would be helpful let me know.

I'm able to reproduce this with 100% reliability using the following steps:

Please file a bug on this and post the bug number back here once it's filed. I'd appreciate you uploading a sysdiagnose taken shortly after the issue has occurred, just to streamline the triage/investigation side of this.

However, yes, this is almost certainly caused by the same issue as this:

Based on what I was able to find, I believe this is the known CallKit issue (r.157725305) referenced in this forum post and does extend to PTT Framework.

As mentioned above, we currently haven't found a good way to deal with this.

Unfortunately, I don't think you'll find one, as you don't have the access to the same API layer CallKit does.

Our current solution to this is to programmatically "toggle" PTT framework.

Yes, that's basically your only option.

Is there anything we can do here other than posting a notification telling the user that there is an issue and they need to on-screen the app to resolve it?

No, I'm afraid I don't think you'll have any real options here.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Hi Kevin,

Appreciate the response. The bug has been filed with attached sysdiagnose after reproducing the issue but if you need any additional information please let me know. The bug number is FB23234903.

Appreciate the response. The bug has been filed with attached sysdiagnose after reproducing the issue but if you need any additional information please let me know. The bug number is FB23234903.

Perfect, thank you. I'm not sure we'll be able to get it fixed in 26.6, but I'll do what I can to get it fixed as soon as possible.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

PTT Framework Failing to Un-mute Microphone After Media Services Reset
 
 
Q