react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
923 stars 445 forks source link

Audio not returning after call is resumed #123

Closed danwhite-ipc closed 4 years ago

danwhite-ipc commented 5 years ago

Bug report

Description

When a call is resumed from a held state I am not getting audio back, unless I use InCallManager to toggle the device speaker.

Steps to Reproduce

Versions

- Callkeep: 3.0.6
- React Native: 0.59.10
- iOS: 12.4
- Android:
- Phone model: iPhone 8
danjenkins commented 5 years ago

Which underlying technology/module are you using for your media?

On Thu, 24 Oct 2019, 17:06 Dan White, notifications@github.com wrote:

Bug report

-

I've checked the example https://github.com/react-native-webrtc/react-native-callkeep/tree/master/example to reproduce the issue.

Reproduced on:

Android

iOS

Description

When a call is resumed from a held state I am not getting audio back, unless I use InCallManager to toggle the device speaker. Steps to Reproduce

  • Place Call On Hold
  • Hold Call
  • Resume Call

Versions

  • Callkeep: 3.0.6
  • React Native: 0.59.10
  • iOS: 12.4
  • Android:
  • Phone model: iPhone 8

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/react-native-webrtc/react-native-callkeep/issues/123?email_source=notifications&email_token=AAB3LLLJDV6CFAH3TZ4ILTDQQHBZVA5CNFSM4JEWE2V2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HUFEQ5Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB3LLI2VNZPPAAK3ZBUZQDQQHBZVANCNFSM4JEWE2VQ .

danwhite-ipc commented 5 years ago

Using react-native-webrtc and jssip

danjenkins commented 5 years ago

Which version of react native webrtc?

On Thu, 24 Oct 2019, 19:48 Dan White, notifications@github.com wrote:

Using react-native-webrtc and jssip

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/react-native-webrtc/react-native-callkeep/issues/123?email_source=notifications&email_token=AAB3LLN3FIMU2NGD7LIOTODQQHUWBA5CNFSM4JEWE2V2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECGBRKA#issuecomment-546052264, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB3LLOPBUF4WTMBL7O2FADQQHUWBANCNFSM4JEWE2VQ .

danwhite-ipc commented 5 years ago

Version: 1.69.2

danjenkins commented 5 years ago

Yup check out PR #80 :) You need to be running 1.75 of RN-WebRTC - however the latest version might not work as @saghul had to disable the flag in the SDK as it was causing crashing. So test out RN-WebRTC 1.75 (not 1.75.1) and see if that fixes things. If it does - try upgrading to 1.75.1 for me and see if disabling the flag has any affect (I haven't test it yet)

danwhite-ipc commented 5 years ago

v1.75 works but upgrading to v1.75.1 doesn't work.

saghul commented 5 years ago

That's unfortunate :-( We saw thousands of crashes, so I don't recommend staying on 1.75.0. I reported this to Google and since it's a field trial I don't have much hope TBH.

danwhite-ipc commented 5 years ago

So what are my options? If I can't stay on 1.75.0.

saghul commented 5 years ago

I wish I knew.

danjenkins commented 5 years ago

Try 1.75 and see if you get those crashes - I'm.not seeing them myself but I don't have thousands of users like @saghul

rcidt commented 5 years ago

I am experiencing this same thing. When a call comes in while on another call, if you select Hold+Answer, the audio is lost on both calls.

I made sure that we are properly managing the parallel calls, it seems like the mic and speaker are just completely disabled when holding a call from the CallKit UI.

I am using PJSIP.

danjenkins commented 5 years ago

hi @rcidt your issue is with react-native-pjsip rather than callkeep then - callkeep issues an event so pjsip needs to know to listen for that and deal with restarting the audio sessions :)

rcidt commented 5 years ago

@danjenkins you are correct, I managed to solve this by explicitly enabling/disabling the Audio Session through PJSIP. Thanks!

danwhite-ipc commented 4 years ago

I have been forced to upgrade react-native-webrtc to v1.84.0 from v1.75.0 due to seeing crashes on iOS 14. Has there need any advancement on the hold/resume audio issue?

saghul commented 4 years ago

Not really I'm afraid. Enabling the field trial which "fixed" it in 1.75 yields tons of crashes so I reverted it. I suspect using manual audio management (the useManualAudio property in RTCAudioSession) could solve it, but you'd need to write a small module to expose that functionality to RN in order to test it out.

danjenkins commented 4 years ago

@danwhite-ipc Temporarily you could use my fork which re-adds it

https://github.com/nimbleape/react-native-webrtc/tree/84-plus-dtmf-plus-field-trial

I need to look into whether this is something we could dynamically enable or not

I personally dont see the issues @saghul sees so shrug hahaha

danwhite-ipc commented 4 years ago

Cheers @danjenkins, your fork appears to work fine! 👍

saghul commented 4 years ago

@danwhite-ipc Temporarily you could use my fork which re-adds it

https://github.com/nimbleape/react-native-webrtc/tree/84-plus-dtmf-plus-field-trial

I need to look into whether this is something we could dynamically enable or not

I personally dont see the issues @saghul sees so shrug hahaha

My sample size is big, trust me :-)

As for making it dynamically adjustable, it would be possible, but it would require those who want to enable it to use manual linking. Th problem is this is needed really early in the initialization process.

danwhite-ipc commented 4 years ago

@saghul At the moment I don't have any alternatives.

danjenkins commented 4 years ago

I'm not saying you're wrong @saghul! Just that I haven't seen crashes in my bug reporting related to this

I use incall-manager to handle the call audio session whereas you don't. That's my only thought process ...

On Wed, 12 Aug 2020, 17:22 Dan White, notifications@github.com wrote:

@saghul https://github.com/saghul At the moment I don't have any alternatives.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/react-native-webrtc/react-native-callkeep/issues/123#issuecomment-672975679, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB3LLMXAAZO66IFV6KYJ43SAK6TRANCNFSM4JEWE2VQ .

namnm commented 3 years ago

Hi, I guess this issue is still around, we should reopen this.

Right now Im using InCallManager to toggle the device speaker just like @danwhite-ipc did at the beginning. Im at callkeep@latest, and webrtc@1.75.3

In this thread it suggests I should downgrade webrtc to 1.75.0, or use the fork from @danjenkins. And test to make sure there's no crash?

So I guess using InCallManager to toggle the device speaker may be the way now, lol

danjenkins commented 3 years ago

Hi, I guess this issue is still around, we should reopen this.

Right now Im using InCallManager to toggle the device speaker just like @danwhite-ipc did at the beginning.

Im at callkeep@latest, and webrtc@1.75.3

In this thread it suggests I should downgrade webrtc to 1.75.0, or use the fork from @danjenkins. And test to make sure there's no crash?

So I guess using InCallManager to toggle the device speaker may be the way now, lol

Yes that's what I use and my fork (which is almost up to date)

namnm commented 3 years ago

@danjenkins So you use both IncallManager toggling speaker, and also the fork of enabling the field trial? I guess we only need one of those two?

danjenkins commented 3 years ago

I use both and you need both as far as I'm concerned

danwhite-ipc commented 3 years ago

I have had no issues running @danjenkins fork 👍🏻

namnm commented 3 years ago

Ok thanks for your info. Im now only using IncallManager to toggle the speaker and it seems to be working so far. I tried upgrading the webrtc but it causes my app to stop working. We are strictly depending on an old jssip version, which is not compatible with new webrtc version I guess.

danjenkins commented 3 years ago

Ok thanks for your info. Im now only using IncallManager to toggle the speaker and it seems to be working so far. I tried upgrading the webrtc but it causes my app to stop working. We are strictly depending on an old jssip version, which is not compatible with new webrtc version I guess.

Yeah you can't use latest jssip as it relies on tracks not streams