Hi everyone, we’re seeing this in production and could use some help.
Setup: LiveKit Cloud with a self-hosted Python agent (livekit-agents 1.8.6). An Anam avatar publishes the agent’s audio (audio_output=False). The web client runs livekit-client 2.22.4 with new Room() and default capture options, so the browser’s echo cancellation is on.
What happens: On phones in speaker mode, the agent’s speech leaks back into the user’s mic. VAD triggers an interruption, the agent stops mid-sentence, and the echoed words are committed as a user turn that the agent then answers.
It happens mostly at the start of the agent’s later replies, not just the greeting, and can loop for several turns. We’ve seen it on a Samsung Galaxy S24, and on iPhone in both Chrome and Safari.
What we’ve ruled out:
aec_warmup_duration is active at its default 3 s, but most echoes come after it has expired.
Raising the interruption min_duration doesn’t help, because the echo is real speech.
resume_false_interruption can’t help, because the avatar’s audio isn’t pausable.
Making the greeting uninterruptible only covers the first reply, and users need to be able to interrupt.
What’s the recommended way to stop the agent treating its own speech as user speech, without turning off interruptions? Especially when an avatar participant publishes the audio.
Can adaptive interruption be used with a self-hosted worker on a LiveKit Cloud project?
Happy to share session IDs, config or logs if useful.
Hi, I see you have an open support ticket for question 1 so I won’t duplicate any repro effort here but I’ll give my thoughts. That PR in the agents repo does look relevant, Mobile Echo Issue with iphone's built in mics · Issue #3758 · livekit/agents · GitHub and I agree with the direction it took, that although you can probably mitigate this in the agent, the root cause is probably more in the client (it’s not obvious but the user xianshijing-lk in that thread is a senior figure on our client team). Looks like that the issue was closed without a resolution. You have an avatar in your setup, which I guess is perhaps confusing the echo canceller as the delay in each reply is inconsistent, but that’s just a guess.
If you (or anyone else) have examples of this, they would be really helpful in helping us better understand/resolve the issue. Egress recordings would be especially helpful.
Here is a session ID for reference: RM_eeD59du8YyvD
Also, we can reproduce this (decently) consistently now by starting an agent session through a mobile device browser in speaker mode, and then holding the mobile device’s mic against our shirt. By doing this, we can still hear and speak with the agent, and it’s significantly more likely that the echo pops up within the conversation.