Suddenly the BackgroundAudio is not playing during...
# ask-ai
f
Suddenly the BackgroundAudio is not playing during my conversations anymore. From the worker logs i see: backend-1 | {"message": "AudioMixer: stream <async_generator object BackgroundAudioPlayer._play_task.<locals>._gen_wrapper at 0xffff5549a020> timeout, ignoring", "level": "WARNING", "name": "livekit", "pid": 131, "job_id": "AJ_TMjFRZ83HEyo", "room_id": "RM_uZDkZX2c9mdz", "timestamp": "2025-12-19T165435.762512+00:00"}
t
Thanks for reaching out, Heidi. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m sorry BackgroundAudio stopped working. I’m responding to the warning you pasted: "AudioMixer: stream <async_generator object BackgroundAudioPlayer._play_task.<locals>._gen_wrapper ...> timeout, ignoring" — that means the background audio generator isn't yielding frames fast enough, so the mixer dropped the stream. To diagnose and fix this I need a few quick details and then I’ll suggest targeted steps: 1) Does this affect built-in clips (e.g.,
BuiltinAudioClip.OFFICE_AMBIENCE
) or only your custom audio source/generator? 2) Did anything change recently (code/agent/sdk version, deployment, file paths, or network environment)? 3) Is the problem consistent or intermittent? If intermittent, how often does it occur? 4) If using a custom generator or
play()
with
AudioConfig
, can you share the relevant snippet (or describe whether it performs blocking I/O or long-running work before yielding frames)? 5) Any other relevant worker logs around the same timestamp (connection drops, high latency, or CPU spikes)? Immediate things you can try now: • If using a custom generator: ensure it yields
rtc.AudioFrame
promptly and does not perform blocking file reads or heavy CPU work inside the generator. Offload blocking work (file reads, decoding) to a background task and have the generator yield frames quickly. • Test with a built-in clip (e.g.,
BuiltinAudioClip.OFFICE_AMBIENCE
) to see if playback works; if built-ins play, the issue is in your custom source. • Confirm the agent session and room connection are stable at the time playback starts (check room join/leave and network errors in logs). • Restart the worker process briefly to rule out a stuck async task, then retry playback. • If the source is a remote stream or file, verify the source is available and responds quickly. Tell me the answers to 1–4 (and paste the small code snippet if possible). With that I’ll provide the exact code checks/fixes to stop the generator timing out. Sources: Agent speech and audio | LiveKit docs