[Android] Incoming voice audio is silent for 1+ minute after joining, then starts on its own

(#4515) Bug Open: Confirmed Priority: P1 mobile voice

Thread

Comment by Charles W (K5CDW)
Found the root cause with adb. It's client-side, a race in flutter_callkit_incoming's self-managed Telecom call, not self-hosting. The audio was never silent: it was going to the EARPIECE, which sounds like a near-silent speaker from arm's length. Pixel 6 Pro, Android 17, Fluxer Beta (dumpsys telecom / dumpsys audio / logcat): On voice join, the app starts a SELF-MANAGED outgoing call through CallkitConnectionService. Telecom routes to TYPE_EARPIECE and holds a privileged communication-route client for it. The app's setSpeakerphoneOn(true) calls (20+) all lose to it, so the speaker toggle and volume keys do nothing. Fluxer sends ACTION_CALL_CONNECTED about 200 ms after ACTION_CALL_START. Telecom only created the Connection about 360 ms after CREATED (SET_DIALING at +0.36 s). CallkitIncomingBroadcastReceiver.driveTelecomConnection() does CallkitConnection.find(id) ?: return, so the early CONNECTED is silently dropped and the call stays DIALING. Exactly 120 s later, Telecom fires STATE_TIMEOUT [state=DIALING] (logged in mCallAnomalyWatchdog), disconnects the call and clears its earpiece route. Only then does the speaker work. That's the "1+ minute" delay. Confirmed: after adb shell telecom unregister-phone-account com.fluxer/com.hiennv.flutter_callkit_incoming.CallkitConnectionService flutter_callkit_incoming_in_app_call_account 0, placeCall is rejected (the plugin handles it gracefully), and on the next join the speaker is loud immediately (active communication device = speaker). Suggested fix: have the plugin remember a pending CONNECTED and apply setActive() in onCreateOutgoingConnection, or have Fluxer call setCallConnected only after the Connection exists. Faster devices probably win the race, which may be why your Pixel 9a didn't reproduce it. fluxer_4515-adb-evidence.txt