Question for Support Hi! I’m running a Python agen...
# ask-ai
s
Question for Support Hi! I’m running a Python agent on Google Cloud Run. Locally everything works (agent hears me and responds). On Cloud Run the agent joins the room, sends TTS greeting, but does not receive STT audio — logs show: •
MIC subscribed … True
•
active_speakers_changed -> ['user_XXXX']
• then shortly after:
input stream detached
/
stream closed
•
stt_audio_duration
always stays 0.0 I already: • set
min-instances=1
+
--no-cpu-throttling
so CPU is always allocated • verified environment variables are correct how do you suggest to proceed?
t
Thanks for reaching out, Bar. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm sorry to hear you're having trouble with the Python agent on Google Cloud Run not receiving STT audio. Let's work through this together! It might be related to how the audio input pipeline or stream lifecycle is managed. Here are some friendly steps to help troubleshoot: 1. Stream Lifecycle Debugging: Try adding some logging to keep an eye on the audio stream’s state. This can help us see exactly when and why it detaches. 2. Cloud Run Environment Monitoring: It’s a good idea to log container stats like memory usage, CPU count, and instance details to make sure the environment is running smoothly. 3. Audio Stream Validation: Double-check that the audio stream is correctly attached and enabled before processing starts. 4. Audio Format Validation: Make sure the audio format matches what’s expected—16kHz sample rate, mono, LINEAR16 encoding. 5. Timeout Monitoring: Keep an eye on how long processing takes to avoid hitting Cloud Run’s timeout limits. 6. Error Recovery: Adding strong error handling for stream failures and retries can really help keep things running smoothly. If you’re comfortable sharing your current STT initialization code or any specific error messages from the Cloud Run logs, that would be super helpful! It’ll allow us to better understand if the issue is related to resource limits, network connectivity, or how the stream lifecycle is managed. I’m here to help you get this sorted out! Sources: livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/s... | agents/src/stt/stt.ts
s
absolutely! uploaded as files are both my python agent script and the logs I get
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
s
are others get this issue?
can I share something else so you could help me understand where the issue is?