I have a call where bitrate for the published micr...
# ask-ai
a
I have a call where bitrate for the published microphone track is fluctuating and the end it just drops down to 3kbps from 50kpbs. In the egress i can hear the voice, livekit dashboard shows no packet drops. What could be the case and how do i resolve it?
t
Thanks for reaching out, Mehul. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for sharing your observation about the drop in microphone track bitrate. There are a couple of common reasons this might happen: • Opus DTX (Discontinuous Transmission): LiveKit has DTX enabled by default, which helps reduce bitrate during moments of silence or low audio activity. This is a thoughtful feature designed to save bandwidth, and it can bring the bitrate down to as low as 1kbps during those quiet times. If you’d prefer to keep a steady bitrate, you can disable DTX when publishing the track. • Bandwidth Congestion: LiveKit’s StreamAllocator adjusts the bitrate dynamically based on the bandwidth available. While audio gets priority, you might still notice some fluctuations if the network is a bit constrained. Since your LiveKit dashboard shows no packet drops and the audio is coming through clearly on the egress, this behavior is actually quite normal. If you’d like help turning off DTX or need any guidance on configuration, just let me know which SDK you’re working with—I’m here to help! Sources: Bringing Zoom's end-to-end optimizations to WebRTC | LivekitUnitySampleApp/Assets/LivekitSamples.cs
a
My agent doesn't get anything though also the function doest get called
t
I understand how frustrating it can be when your agent isn't receiving audio and the function isn't being called. Let’s work through some common causes together and see if we can get things back on track: • Audio Subscription: Please double-check that your agent is properly subscribed to the audio track. If you’re using manual subscription, it’s important to make sure the subscription logic is set up correctly. • Tool Registration: It’s a good idea to confirm that the function is registered within the agent’s tool context. If you’ve added tools programmatically, don’t forget to update the context with
update_tools()
. • Chat Context: Also, verify that the chat context is in sync with your tools and instructions by using
update_chat_ctx()
. This can sometimes make a big difference. • Silent Function Execution: If your function isn’t returning a value, it might be running silently without generating a response. Take a look at any event handlers that could be suppressing replies. • Version Compatibility: Lastly, please ensure you’re using the latest version of the LiveKit SDKs, as updates often fix known issues. Could you let me know if you’re using manual subscription or share a bit more about your agent’s setup? That way, I can help you troubleshoot more effectively. I’m here to help! Sources: agents/CHANGELOG.md | SIP troubleshooting guide | LiveKit Docs | livekit-agents/livekit/agents/voice/generation.py | How to Set Up Speech-to-Text Input with Text-Only Output in LiveKit Agents | Receiving and publishing tracks | LiveKit Docs
a
I further checked in my python agent logs i get this error: {"message": "_SegmentSynchronizerImpl.resume called after close", "level": "WARNING", "name": "livekit.agents", "pid": 902090, "job_id": "AJ_ksT6u7XfUYfJ", "timestamp": "2025-09-25T150612.847911+00:00"} and new agent never picks up
t
It looks like the error
_SegmentSynchronizerImpl.resume called after close
means that a resume operation was tried on a transcription synchronization component that had already been closed. This can happen if the component’s lifecycle isn’t managed quite right or if there’s a race condition during state changes. Let’s walk through some steps that might help resolve this: • Make sure that
resume()
is only called when the component is still open. Properly handling the lifecycle of the transcription synchronizer is key here. • Double-check that the agent’s session isn’t closing too early because of errors in the STT, LLM, or TTS components. Looking at the logs for
error
and
close
events can help pinpoint what’s going on. • Try enabling logging for state transitions, like
user_state_changed
and
agent_state_changed
, so you can confirm everything is behaving as expected. • Verify that the agent name is consistent both in the
WorkerOptions
during agent creation and in the
RoomAgentDispatch
rule. • Also, check that
room_io
is properly initialized and subscribed to the participant’s audio tracks. If you’re still running into trouble after these steps, please don’t hesitate to reach out. I’m here to help you through any part of this or to dive deeper into your setup if needed! Sources: livekit-agents/livekit/agents/voice/agent_activity.py | Events and error handling | LiveKit Docs | Docs::Telephony | Turn detection and interruptions | LiveKit Docs | agents/CHANGELOG.md
a
Can you tell me when is this called?
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!