react-native-webrtc / react-native-webrtc/react-native-incall-manager

audioSession deActive suddenly before joining call

Open
#214 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
597
Forks
201
Avg merge
2h 42m
Merged PRs (30d)
1

Description

Hi, sometimes I got no sounds when on audiocall with IOS, then after check log, I saw audioSession deActive suddenly called, I dont know why, can u help?

2023-02-20 11:07:06.209401+0700 VedaxLink[48872:11061163] RNInCallManager.start() start InCallManager. media=audio, type=audio, mode=AVAudioSessionModeVoiceChat
2023-02-20 11:07:06.211151+0700 VedaxLink[48872:11061163] RNInCallManager.storeOriginalAudioSetup(): origAudioCategory=AVAudioSessionCategoryPlayAndRecord, origAudioMode=AVAudioSessionModeVoiceChat
2023-02-20 11:07:06.212496+0700 VedaxLink[48872:11061163] RNInCallManager.startAudioSessionNotification() starting...
2023-02-20 11:07:06.212548+0700 VedaxLink[48872:11061163] RNInCallManager.startAudioSessionInterruptionNotification()
2023-02-20 11:07:06.212588+0700 VedaxLink[48872:11061163] RNInCallManager.startAudioSessionRouteChangeNotification()
2023-02-20 11:07:06.212619+0700 VedaxLink[48872:11061163] RNInCallManager.startAudioSessionMediaServicesWereLostNotification()
2023-02-20 11:07:06.212649+0700 VedaxLink[48872:11061163] RNInCallManager.startAudioSessionMediaServicesWereResetNotification()
2023-02-20 11:07:06.212673+0700 VedaxLink[48872:11061163] RNInCallManager.startAudioSessionSilenceSecondaryAudioHintNotification()
2023-02-20 11:07:06.213938+0700 VedaxLink[48872:11061163] RNInCallManager.start:auto:ringbackUriType:: audioSession.setCategory: AVAudioSessionCategoryPlayAndRecord, withOptions: 0 success
2023-02-20 11:07:06.214494+0700 VedaxLink[48872:11061163] RNInCallManager.start:auto:ringbackUriType:: audioSession.setMode(AVAudioSessionModeVoiceChat) success
2023-02-20 11:07:06.215430+0700 VedaxLink[48872:11061163] RNInCallManager.start:auto:ringbackUriType:: audioSession.setActive(YES), withOptions: 0 success
2023-02-20 11:07:06.215516+0700 VedaxLink[48872:11061163] RNInCallManager.startProximitySensor()
2023-02-20 11:07:06.215618+0700 VedaxLink[48872:11061163] RNInCallManager.setKeepScreenOn(): enable: YES
2023-02-20 11:07:06.281994+0700 VedaxLink[48872:11059104] [javascript] '_ContactCallUpdateSubStatus success', undefined
2023-02-20 11:07:06.288411+0700 VedaxLink[48872:11059104] [javascript] singlecall inited
2023-02-20 11:07:06.289781+0700 VedaxLink[48872:11059104] [javascript] 'newcallstate', 'Connecting...'
2023-02-20 11:07:06.341907+0700 VedaxLink[48872:11058862] [RNCallKeep][CXProviderDelegate][provider:didActivateAudioSession]
2023-02-20 11:07:06.351753+0700 VedaxLink[48872:11058862] RNInCallManager.AudioSessionInterruptionNotification: Ended
2023-02-20 11:07:06.351785+0700 VedaxLink[48872:11058862] [RNCallKeep][configureAudioSession] Activating audio session
2023-02-20 11:07:06.392997+0700 VedaxLink[48872:11058862] [[RNCallKeep]] sendEventWithNameWrapper: RNCallKeepDidActivateAudioSession, hasListeners : YES
2023-02-20 11:07:06.395774+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.Reason: CategoryChange. category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2023-02-20 11:07:06.396178+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute(): [Enter] forceSpeakerOn flag=0 media=audio category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2023-02-20 11:07:06.396544+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute(): did NOT overrideOutputAudioPort()
2023-02-20 11:07:06.396652+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute() did NOT change audio category
2023-02-20 11:07:06.396668+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute() did NOT change audio mode
2023-02-20 11:07:06.396681+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: End
2023-02-20 11:07:06.396694+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: Unknow Value
2023-02-20 11:07:06.430938+0700 VedaxLink[48872:11059104] [javascript] socket connect now
2023-02-20 11:07:06.442994+0700 VedaxLink[48872:11059104] [javascript] 'send keepalive ios now', true
2023-02-20 11:07:06.443017+0700 VedaxLink[48872:11059104] [javascript] send keepalive ios now
2023-02-20 11:07:06.443065+0700 VedaxLink[48872:11059104] [javascript] 'setKeepAliveTimeout now', 5230
2023-02-20 11:07:06.461923+0700 VedaxLink[48872:11059104] [javascript] start initAudioRoom
2023-02-20 11:07:06.461993+0700 VedaxLink[48872:11059104] [javascript] JanusAudioBridgePulgin inited
2023-02-20 11:07:06.462968+0700 VedaxLink[48872:11059104] [javascript] rn-webrtc:pc:DEBUG 4 ctor +11s
2023-02-20 11:07:06.463069+0700 VedaxLink[48872:11059104] [javascript] janus plugin connect
2023-02-20 11:07:06.467930+0700 VedaxLink[48872:11058862] [native] [GESTURE HANDLER] Initialize gesture handler for view <RNSScreenView: 0x10ae2ffd0; reactTag: 3653; frame = (0 0; 390 844); autoresize = W+H; gestureRecognizers = <NSArray: 0x280a4f450>; animations = { UIPacingAnimationForAnimatorsKey=<CABasicAnimation: 0x2805cf6e0>; position=<CASpringAnimation: 0x2805cc280>; }; layer = <CALayer: 0x2804e9f00>>
2023-02-20 11:07:06.487439+0700 VedaxLink[48872:11059104] [javascript] 'setOnParticipantsListener', [ { id: 6256408643567800,
    displayName: '48f02cbe-efe1-4eca-9652-a0582a20c1a4_1676866022650',
    isTalking: false,
    isMuted: false,
    didSetup: true } ]
2023-02-20 11:07:06.487553+0700 VedaxLink[48872:11059104] [javascript] rn-webrtc:pc:DEBUG 4 addTrack +25ms
2023-02-20 11:07:06.488513+0700 VedaxLink[48872:11059104] [javascript] rn-webrtc:pc:DEBUG 4 createOffer +1ms
2023-02-20 11:07:06.488708+0700 VedaxLink[48872:11059104] [javascript] negotiationneeded
2023-02-20 11:07:06.489240+0700 VedaxLink[48872:11059104] [javascript] rn-webrtc:pc:DEBUG 4 createOffer OK +1ms
2023-02-20 11:07:06.489296+0700 VedaxLink[48872:11059104] [javascript] rn-webrtc:pc:DEBUG 4 setLocalDescription +0ms
2023-02-20 11:07:06.489715+0700 VedaxLink[48872:11059104] [javascript] 'signalingState', 'janus.plugin.audiobridge', 5942734482099627, 'have-local-offer'
2023-02-20 11:07:06.490554+0700 VedaxLink[48872:11059104] [javascript] rn-webrtc:pc:DEBUG 4 setLocalDescription OK +1ms
2023-02-20 11:07:06.505492+0700 VedaxLink[48872:11059104] [javascript] rn-webrtc:pc:DEBUG 4 setRemoteDescription +15ms
2023-02-20 11:07:06.505976+0700 VedaxLink[48872:11059104] [javascript] 'signalingState', 'janus.plugin.audiobridge', 5942734482099627, 'stable'
2023-02-20 11:07:06.649083+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.Reason: CategoryChange. category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2023-02-20 11:07:06.649389+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute(): [Enter] forceSpeakerOn flag=0 media=audio category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2023-02-20 11:07:06.649915+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute(): did NOT overrideOutputAudioPort()
2023-02-20 11:07:06.650105+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute() did NOT change audio category
2023-02-20 11:07:06.650157+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute() did NOT change audio mode
2023-02-20 11:07:06.650183+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: End
2023-02-20 11:07:06.650197+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: Unknow Value
2023-02-20 11:07:06.723901+0700 VedaxLink[48872:11059104] [javascript] 'iceconnectionstate', 'janus.plugin.audiobridge', 5942734482099627, 'checking'
2023-02-20 11:07:06.741081+0700 VedaxLink[48872:11059104] [javascript] 'fcm onMessage', { RoomId: '48f02cbeefe14eca9652a0582a20c1a47ea53b20d993453c9f005bc057580b32',
  CallerId: '48f02cbe-efe1-4eca-9652-a0582a20c1a4',
  CallId: 'KgLTHP5CxUCZi2xvmLAuMw',
  Cmd: 'HideCallScreen' }
2023-02-20 11:07:06.741139+0700 VedaxLink[48872:11059104] [javascript] 'fcm onMessageroute name', 'SingleCall'
2023-02-20 11:07:06.741211+0700 VedaxLink[48872:11059104] [javascript] report stop calling ios now
2023-02-20 11:07:06.741439+0700 VedaxLink[48872:11060779] [RNCallKeep] isCallActive 48F02CBE-EFE1-4ECA-9652-A0582A20C1A4 1 ?
2023-02-20 11:07:06.929733+0700 VedaxLink[48872:11059104] [javascript] audioRoom OnWebRTCUpListener
2023-02-20 11:07:07.101532+0700 VedaxLink[48872:11059104] [javascript] 'NotifyJsonStr', 'RoomContactAcceptCall'
2023-02-20 11:07:07.104082+0700 VedaxLink[48872:11059104] [javascript] 'NotifyJsonStr', 'RoomChatMsgReadedByUser'
2023-02-20 11:07:07.458344+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.Reason: CategoryChange. category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2023-02-20 11:07:07.458571+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute(): [Enter] forceSpeakerOn flag=0 media=audio category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2023-02-20 11:07:07.464949+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute(): audioSession.overrideOutputAudioPort(.None) success
2023-02-20 11:07:07.465280+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute() did NOT change audio category
2023-02-20 11:07:07.465346+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute() did NOT change audio mode
2023-02-20 11:07:07.465381+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: End
2023-02-20 11:07:07.465421+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: Unknow Value
2023-02-20 11:07:07.483974+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.Reason: CategoryChange. category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2023-02-20 11:07:07.484151+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute(): [Enter] forceSpeakerOn flag=0 media=audio category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
2023-02-20 11:07:07.485392+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute(): audioSession.overrideOutputAudioPort(.None) success
2023-02-20 11:07:07.485703+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute() did NOT change audio category
2023-02-20 11:07:07.485724+0700 VedaxLink[48872:11058862] RNInCallManager.updateAudioRoute() did NOT change audio mode
2023-02-20 11:07:07.485737+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: End
2023-02-20 11:07:07.485749+0700 VedaxLink[48872:11058862] RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: Unknow Value
2023-02-20 11:07:07.500758+0700 VedaxLink[48872:11058862] [RNCallKeep][CXProviderDelegate][provider:didDeactivateAudioSession]
2023-02-20 11:07:07.500784+0700 VedaxLink[48872:11058862] [[RNCallKeep]] sendEventWithNameWrapper: RNCallKeepDidDeactivateAudioSession, hasListeners : YES
2023-02-20 11:07:07.500958+0700 VedaxLink[48872:11059104] [javascript] 'connectionState', 'connecting'
2023-02-20 11:07:07.502066+0700 VedaxLink[48872:11059104] [javascript] 'connectionState', 'connected'

When user press answer incomming call, i call Incallmanager,start():

 if(Platform.OS === 'ios'){
      InCallManager.start({media: isVideo ? 'video' : 'audio'})
    }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the JavaScript InCallManager.start({media: ...}) entry point and the RNCallKeep didActivateAudioSession and didDeactivateAudioSession events shown in the log. Reproduce an answered incoming call and trace the audio-session lifecycle around HideCallScreen; done means the premature deactivation cause is identified and audio remains available during the call.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript, react-native
Domain
audio-video-rtc, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.