Environment
- Firebase AI Logic SDK:
- Reproduced on
17.8.0
- Reproduced on
17.10.1
- Backend:
GoogleAI / Gemini Developer API
- Model:
gemini-2.5-flash-native-audio-preview-12-2025
- Android device with issue:
- Model:
rk3588
- Android version:
12
- API level:
32
- Comparison device:
- Google Pixel 8 Pro
- Behavior is noticeably more stable there
- App type:
- Reproduced in a minimal single-activity Android app with only:
Connect
Disconnect
Simulate goAway
- Audio mode:
LiveSession.startAudioConversation(...)
Problem Summary
On rk3588, Firebase Live audio threads are not reliably released across disconnect/reconnect cycles.
Depending on timing and reconnect path, we observe one or more of these behaviors:
- old
Firebase Audio / Firebase Blocki threads remain alive after disconnect
- reconnect partially reuses old threads but also creates new ones
- repeated reconnects, especially after
goAway, cause thread count and CPU usage to keep increasing over time
- after running for hours, the process becomes unstable and eventually crashes
This is reproducible both:
- in our production app
- in a minimal standalone test app
So this does not appear to be caused by app-specific business logic.
Minimal Reproduction
We built a minimal Android app that only does the following:
- create a
LiveSession
- call
startAudioConversation()
- disconnect using one of:
stopAudioConversation() + close()
close()
stopAudioConversation() + delay + close()
- reconnect again
We also tested goAway handling in 17.10.1 in two ways:
- stop audio and restart on the same session
- stop audio -> delay -> close old session -> connect new session -> start audio
Reproduction Steps
Case A: Manual connect / disconnect / reconnect
- Launch app
- Tap
Connect
- Wait until audio conversation is active
- Tap
Disconnect
- Tap
Connect again, either immediately or after some delay
Case B: goAway / reconnect path
- Launch app and connect
- Wait for server
goAway or simulate the same handling path
- Reconnect / restart audio according to app logic
- Observe thread list and CPU
Observed Behavior
On rk3588, after disconnect/reconnect cycles we repeatedly observe leftover threads like:
Firebase Audio
Firebase Blocki
Typical symptoms:
- after one connection, we see a pair/group of Firebase threads
- after disconnect, those threads often remain alive
- after reconnect, sometimes the old threads are reused, but often new
Firebase Audio threads are also created
- repeated reconnects gradually increase thread count and CPU
- some
Firebase Audio threads remain at very high CPU for long periods
Example from a long-running production session on rk3588
- process thread count grew to about
129
- process RSS was around
348 MB
- peak RSS was around
433 MB
- many historical
Firebase Audio threads remained alive simultaneously
- multiple
Firebase Audio threads each consumed significant CPU
Example from the minimal app on rk3588
- baseline: about
22-24 threads
- connected: about
38-39 threads
- after reconnect cycles: thread count rose into the low
40s
- old Firebase threads remained, and new Firebase threads were added
Example behavior on Pixel 8 Pro
On Pixel 8 Pro, reconnect behavior is noticeably more stable:
- fewer long-lived leftover Firebase threads
- reconnect often appears to reuse existing internal threads
- thread count does not grow as aggressively
Expected Behavior
One of these should happen consistently:
- after disconnect, Firebase Live audio threads should be fully cleaned up
- or reconnect should safely reuse the same internal audio threads without thread count growth
- but it should not keep accumulating
Firebase Audio / Firebase Blocki threads over time
What We Tried
We tested all of the following:
close() only
stopAudioConversation() then close()
stopAudioConversation() then wait then close()
goAway -> stop audio -> restart audio on same session
goAway -> stop audio -> close old session -> connect new session -> start audio
None of them fully solved thread accumulation on rk3588.
Suggested Investigation Areas
This may be related to:
- device-specific audio stack / HAL behavior on rk3588
- Firebase Live audio worker lifecycle
- incomplete cleanup of internal audio/network scopes after disconnect or reconnect
- interaction between
goAway, audio shutdown, and reconnect timing
Request
Could you please investigate whether:
LiveSession.close() / stopAudioConversation() are expected to fully terminate all internal Firebase audio threads
- thread retention on certain Android devices, especially rk3588-based devices, is a known issue
- there is a recommended reconnect pattern for
goAway that avoids accumulating Firebase Audio threads
Environment
17.8.017.10.1GoogleAI/ Gemini Developer APIgemini-2.5-flash-native-audio-preview-12-2025rk35881232ConnectDisconnectSimulate goAwayLiveSession.startAudioConversation(...)Problem Summary
On
rk3588, Firebase Live audio threads are not reliably released across disconnect/reconnect cycles.Depending on timing and reconnect path, we observe one or more of these behaviors:
Firebase Audio/Firebase Blockithreads remain alive after disconnectgoAway, cause thread count and CPU usage to keep increasing over timeThis is reproducible both:
So this does not appear to be caused by app-specific business logic.
Minimal Reproduction
We built a minimal Android app that only does the following:
LiveSessionstartAudioConversation()stopAudioConversation() + close()close()stopAudioConversation() + delay + close()We also tested
goAwayhandling in17.10.1in two ways:Reproduction Steps
Case A: Manual connect / disconnect / reconnect
ConnectDisconnectConnectagain, either immediately or after some delayCase B:
goAway/ reconnect pathgoAwayor simulate the same handling pathObserved Behavior
On
rk3588, after disconnect/reconnect cycles we repeatedly observe leftover threads like:Firebase AudioFirebase BlockiTypical symptoms:
Firebase Audiothreads are also createdFirebase Audiothreads remain at very high CPU for long periodsExample from a long-running production session on rk3588
129348 MB433 MBFirebase Audiothreads remained alive simultaneouslyFirebase Audiothreads each consumed significant CPUExample from the minimal app on rk3588
22-24threads38-39threads40sExample behavior on Pixel 8 Pro
On Pixel 8 Pro, reconnect behavior is noticeably more stable:
Expected Behavior
One of these should happen consistently:
Firebase Audio/Firebase Blockithreads over timeWhat We Tried
We tested all of the following:
close()onlystopAudioConversation()thenclose()stopAudioConversation()then wait thenclose()goAway-> stop audio -> restart audio on same sessiongoAway-> stop audio -> close old session -> connect new session -> start audioNone of them fully solved thread accumulation on
rk3588.Suggested Investigation Areas
This may be related to:
goAway, audio shutdown, and reconnect timingRequest
Could you please investigate whether:
LiveSession.close()/stopAudioConversation()are expected to fully terminate all internal Firebase audio threadsgoAwaythat avoids accumulatingFirebase Audiothreads