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

Handling media-routes/sensors/events during a audio/video chat on React Native
ISC License
547 stars 191 forks source link

audioSession deActive suddenly before joining call #214

Open fukemy opened 1 year ago

fukemy commented 1 year ago

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'})
    }
maharjanaman commented 6 months ago

@fukemy did you manage to solve this?

fukemy commented 6 months ago

it's seem IOS 13 problem, it's gone after upgrade to 14, dont know why