react-native-webrtc / react-native-webrtc/react-native-callkeep
The Speaker icon is removed, while switching the route from Bluetooth or Microphone to Speaker from the call kit screen.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 511
- Avg merge
- 9h 12m
- Merged PRs (30d)
- 2
Description
Bug report
-
I've checked the example to reproduce the issue.
-
Reproduced on:
-
Android
-
iOS
Description
I am using RNCallKeep and react-native-incall-manager to handle the audio routing from the application UI, during VOIP calls.
While switching the route from Bluetooth or Microphone to Speaker from the call kit screen, the Speaker icon is visible for a split second then it changes back to the previous route icon (Bluetooth / Microphone). However, the route stays on Speaker.
Although switching back to Bluetooth / Microphone works fine and the icon is also updated accordingly.
I am receiving the audio route change notification for "Speaker" in the following method in onAudioRouteChange method in RNCallKeep.m. Also, on the JS side, I am getting the Event as well as shown in bold in the below logs, however on the callkit screen the icon changes to Bluetooth again.
Steps to Reproduce
- Connect a Bluetooth headset to your iOS device
- Initiate or receive a VOIP call
- When the route is set to Bluetooth/Microphone
- Now switch the route to Speaker from the Callkit screen (issue is reproduced here)
- Now again switching the route to Microphone or Bluetooth also works fine.
Versions
- Callkeep: 4.3.12
- React Native: 0.72.9
- iOS: all
- Phone model: iPhone 7 plus
Logs
2024-01-25 18:13:08.970367+0530 [864:288247] RNInCallManager.start() start InCallManager. media=audio, type=audio, mode=AVAudioSessionModeVoiceChat
2024-01-25 18:13:08.970608+0530 [864:288247] RNInCallManager.storeOriginalAudioSetup(): origAudioCategory=AVAudioSessionCategoryPlayAndRecord, origAudioMode=AVAudioSessionModeDefault
2024-01-25 18:13:08.974912+0530 [864:288247] RNInCallManager.startAudioSessionNotification() starting...
2024-01-25 18:13:08.975025+0530 [864:288247] RNInCallManager.startAudioSessionInterruptionNotification()
2024-01-25 18:13:08.975299+0530 [864:288247] RNInCallManager.startAudioSessionRouteChangeNotification()
2024-01-25 18:13:08.975354+0530 [864:288247] RNInCallManager.startAudioSessionMediaServicesWereLostNotification()
2024-01-25 18:13:08.975435+0530 [864:288247] RNInCallManager.startAudioSessionMediaServicesWereResetNotification()
2024-01-25 18:13:08.975465+0530 [864:288247] RNInCallManager.startAudioSessionSilenceSecondaryAudioHintNotification()
2024-01-25 18:13:08.975839+0530 [864:288247] RNInCallManager.start:auto:ringbackUriType:: audioSession.setCategory: AVAudioSessionCategoryPlayAndRecord, withOptions: 0 success
2024-01-25 18:13:08.976143+0530 [864:288247] RNInCallManager.start:auto:ringbackUriType:: audioSession.setMode(AVAudioSessionModeVoiceChat) success
2024-01-25 18:13:08.979351+0530 [864:288247] RNInCallManager.start:auto:ringbackUriType:: audioSession.setActive(YES), withOptions: 0 success
2024-01-25 18:13:08.979435+0530 [864:288247] RNInCallManager.startProximitySensor()
2024-01-25 18:13:08.979533+0530 [864:288247] RNInCallManager.setKeepScreenOn(): enable: YES
2024-01-25 18:13:09.614664+0530 [864:288020] [RNCallKeep][CXProviderDelegate][provider:didActivateAudioSession]
2024-01-25 18:13:09.614908+0530 [864:288020] RNInCallManager.AudioSessionInterruptionNotification: Ended
2024-01-25 18:13:09.614949+0530 [864:288020] [RNCallKeep][configureAudioSession] Activating audio session
2024-01-25 18:13:09.746392+0530 [864:288020] [RNCallKeep] sendEventWithNameWrapper: RNCallKeepDidActivateAudioSession, hasListeners : YES
2024-01-25 18:13:09.847646+0530 [864:288020] RNInCallManager.AVAudioSessionSilenceSecondaryAudioHintNotification: End
2024-01-25 18:13:09.878653+0530 [864:288249] [javascript] Inside Event Listener RNCallKeep didChangeAudioRoute
2024-01-25 18:13:09.878762+0530 [864:288249] [javascript] Receiver
2024-01-25 18:13:09.973877+0530 [864:288020] RNInCallManager.updateAudioRoute(): did NOT overrideOutputAudioPort()
2024-01-25 18:13:09.985134+0530 [864:288020] RNInCallManager.updateAudioRoute() did NOT change audio category
2024-01-25 18:13:09.985216+0530 [864:288020] RNInCallManager.updateAudioRoute() did NOT change audio mode
2024-01-25 18:13:09.985249+0530 [864:288020] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: End
2024-01-25 18:13:09.985276+0530 [864:288020] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: Unknow Value
2024-01-25 18:13:11.843002+0530 [864:288020] RNInCallManager.AudioRouteChange.Reason: CategoryChange. category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2024-01-25 18:13:11.843219+0530 [864:288020] RNInCallManager.updateAudioRoute(): [Enter] forceSpeakerOn flag=0 media=audio category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2024-01-25 18:13:11.844413+0530 [864:288020] RNInCallManager.updateAudioRoute(): did NOT overrideOutputAudioPort()
2024-01-25 18:13:11.844540+0530 [864:288020] RNInCallManager.updateAudioRoute() did NOT change audio category
2024-01-25 18:13:11.844576+0530 [864:288020] RNInCallManager.updateAudioRoute() did NOT change audio mode
2024-01-25 18:13:11.844609+0530 [864:288020] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: End
2024-01-25 18:13:11.844637+0530 [864:288020] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: Unknow Value
2024-01-25 18:13:15.427909+0530 [864:288249] [javascript] Printing Before Audio Routes in ComponenetDidMount iOS
2024-01-25 18:13:15.430607+0530 [864:288524] [RNCallKeep][getAudioRoutes]
2024-01-25 18:13:15.590945+0530 [864:288249] [javascript] Printing Audio Routes in ComponenetDidMount iOS
2024-01-25 18:13:15.591650+0530 [864:288249] [javascript] [ { name: 'Speaker', type: 'Speaker' },
{ name: 'iPhone Microphone', selected: true, type: 'Phone' },
{ name: 'Rockerz 238 Pro', type: 'Bluetooth' } ]
2024-01-25 18:13:15.593427+0530 [864:288524] [RNCallKeep][getAudioRoutes]
2024-01-25 18:13:15.599402+0530 [864:288249] [javascript] Audio Route SetTImeOut changed
2024-01-25 18:13:15.599523+0530 [864:288249] [javascript] Getting route
2024-01-25 18:13:15.600062+0530 [864:288249] [javascript] [ { name: 'Speaker', type: 'Speaker' },
{ name: 'iPhone Microphone', selected: true, type: 'Phone' },
{ name: 'Rockerz 238 Pro', type: 'Bluetooth' } ]
2024-01-25 18:13:15.651189+0530 [864:288249] [javascript] Bluetooth:AudioRoute
2024-01-25 18:13:15.750667+0530 [864:288249] [javascript] 'ChangeRoute: ios :: ', 'Bluetooth'
2024-01-25 18:13:15.750962+0530 [864:288249] [javascript] 'ChangeRoute: this.state.routeName: ', 'Rockerz 238 Pro'
2024-01-25 18:13:15.752629+0530 [864:288525] [RNCallKeep][setAudioRoute] - inputName: Rockerz 238 Pro
2024-01-25 18:13:16.123263+0530 [864:288020] RNInCallManager.AudioRouteChange.Reason: Override
2024-01-25 18:13:16.123347+0530 [864:288020] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: End
2024-01-25 18:13:16.123375+0530 [864:288020] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: Unknow Value
2024-01-25 18:13:16.180331+0530 [864:288249] [javascript] Inside Event Listener RNCallKeep didChangeAudioRoute
2024-01-25 18:13:16.180445+0530 [864:288249] [javascript] BluetoothHFP
2024-01-25 18:13:20.651713+0530 [864:288633] [RNCallKeep][getAudioRoutes]
2024-01-25 18:13:20.759155+0530 [864:288249] [javascript] Audio Route SetTImeOut changed
2024-01-25 18:13:20.759796+0530 [864:288249] [javascript] Getting route
2024-01-25 18:13:20.761072+0530 [864:288249] [javascript] [ { name: 'Speaker', type: 'Speaker', selected: true },
{ name: 'iPhone Microphone', type: 'Phone' },
{ name: 'Rockerz 238 Pro', type: 'Bluetooth' } ]
2024-01-25 18:13:20.777916+0530 [864:288020] RNInCallManager.AudioRouteChange.Reason: Override
2024-01-25 18:13:20.778024+0530 [864:288020] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: End
2024-01-25 18:13:20.778059+0530 [864:288020] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: Unknow Value
**2024-01-25 18:13:20.987289+0530 [864:288249] [javascript] Inside Event Listener RNCallKeep didChangeAudioRoute
2024-01-25 18:13:20.987796+0530 [864:288249] [javascript] Speaker**
2024-01-25 18:13:22.546169+0530 [864:288249] [javascript] Thu Jan 25 2024 18:13:22 GMT+0530 | sip.Transport | Sending WebSocket message:
2024-01-25 18:13:25.678314+0530 [864:288249] [javascript] Inside Event Listener RNCallKeep didChangeAudioRoute
2024-01-25 18:13:25.678435+0530 [864:288249] [javascript] Receiver
2024-01-25 18:13:25.679460+0530 [864:288020] RNInCallManager.AudioRouteChange.Reason: CategoryChange. category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2024-01-25 18:13:25.679736+0530 [864:288020] RNInCallManager.updateAudioRoute(): [Enter] forceSpeakerOn flag=0 media=audio category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2024-01-25 18:13:25.680968+0530 [864:288020] RNInCallManager.updateAudioRoute(): did NOT overrideOutputAudioPort()
2024-01-25 18:13:25.681411+0530 [864:288020] RNInCallManager.updateAudioRoute() did NOT change audio category
2024-01-25 18:13:25.681478+0530 [864:288020] RNInCallManager.updateAudioRoute() did NOT change audio mode
2024-01-25 18:13:25.681513+0530 [864:288020] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: End
2024-01-25 18:13:25.681540+0530 [864:288020] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: Unknow Value
2024-01-25 18:13:25.993789+0530 [864:288525] [RNCallKeep][getAudioRoutes]
2024-01-25 18:13:26.002005+0530 [864:288249] [javascript] Audio Route SetTImeOut changed
2024-01-25 18:13:26.002414+0530 [864:288249] [javascript] Getting route
2024-01-25 18:13:26.003373+0530 [864:288249] [javascript] [ { name: 'Speaker', type: 'Speaker' },
{ name: 'iPhone Microphone', selected: true, type: 'Phone' },
{ name: 'Rockerz 238 Pro', type: 'Bluetooth' } ]
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue points to RNCallKeep.m and its onAudioRouteChange handling; start there and compare the logged route events with getAudioRoutes during the Bluetooth/Microphone-to-Speaker reproduction. Done means the CallKit screen keeps the Speaker icon selected after switching, while the reverse route changes still work; use the attached logs and reproduction steps to verify.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, objective-c, react-native
- Domain
- audio-video-rtc, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100