This is happening because the TTS playback from the agent is being captured again by the ReSpeaker mic, so it loops back into the STT pipeline. On Raspberry Pi with LiveKit agents, echo cancellation is usually not handled directly inside the Python SDK media devices, so running in console mode makes it worse since there’s no control over the audio routing.
The practical fix is to either enable OS-level AEC (PulseAudio/PipeWire with WebRTC echo cancellation) or implement a simple half-duplex flow in the agent where STT is paused or frames are ignored while TTS is speaking. I’ve solved this setup on Linux voice agents before and can help you wire proper device routing plus AEC or STT gating so the TTS audio no longer feeds back into the recognizer.
@bored-dinner-9401