Gemini Live Assistant sent 1011 (internal error) keepalive ping timeout during real-time audio streaming

I’m implementing a real-time voice assistant using Google Gemini Live API with Python (genai SDK) and PyAudio. My setup works for capturing microphone input, running VAD, and sending audio chunks, but I keep hitting the following issue intermittently:

[USER] ⚠️ Send error: sent 1011 (internal error) keepalive ping timeout; no close frame received

Environment:

  • Python 3.11

  • OS: Windows 10

  • PyAudio for mic input

  • genai SDK with AsyncLive.connect()

  • Audio settings: 16kHz input, 3–4s speech chunks

Symptoms:

  1. VAD detects speech normally and sends chunks.

  2. Many [SKIP] ❌ Dropped low-quality input messages appear.

  3. Sometimes the assistant receives responses correctly.

  4. Eventually, the 1011 internal error occurs, terminating the session.

What I tried:

  • Using ThreadPoolExecutor for audio read/write to avoid blocking the event loop.

  • Throttling sends with small asyncio.sleep() delays.

  • Adjusting VAD thresholds and minimum speech chunk sizes.

What is the correct way to avoid keepalive ping timeout with Gemini Live API?

did you solve it? im getting a similar error