im checking recordings and the user audio sometime...
# ask-ai
a
im checking recordings and the user audio sometimes sounds cut off tho i dont see any timeout or overflows on my raspberry pi, what could be the issue?
t
Thanks for reaching out, Sebastián. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m looking at the issue where recordings sound cut off on a Raspberry Pi even though you don’t see timeouts or overflows. Here are the most likely causes and quick actions to diagnose and fix it. What can cause cut‑off audio • Pre‑connect buffer: audio captured before the client fully connects can be dropped if the preconnect buffer isn’t published. • AudioSource frame drops: on low‑power devices the internal capture queue can overflow or drop frames without explicit errors. • VAD / STT stream end: aggressive VAD or ending the STT input too early can trim speech segments. • Late subscription: if the recording/egress subscribes after the speaker starts, the initial audio may be missed. • CPU / timing issues: Raspberry Pi CPU/load or clock/IO jitter can delay or lose frames when capture is blocking. Immediate checks to run 1. Confirm whether speech happens before Room.connect() completes. If so, ensure the pre‑connect buffer is forwarded when connecting. 2. Increase
AudioSource
queue size (e.g., 1000–2000 ms) to avoid dropped frames during bursts. 3. If using VAD/STT, relax silence thresholds (longer min silence) and ensure
end_input()
is called only after speech really finishes. 4. Verify your recorder/egress subscribes to the track before the user begins speaking (use
on_track_subscribed
hooks). 5. Monitor Raspberry Pi CPU, IO, and process scheduling while recording to spot spikes or blocking loops. If you want, tell me: • Are you using a custom
AudioSource
or standard device capture? • Is speech sometimes cut off only at the very start of the call, or in the middle as well? • Are you using VAD/STT, and which library/settings? I can then give the exact config lines and next steps to try. Sources: client-sdk-js | livekit/livekit_composite | DeepWiki | Resolving "InvalidState - failed to capture frame" errors in AudioSource | Speech-to-text (STT) models | LiveKit Docs | Capturing the First Few Seconds of a Call for Processing | Debugging Audio/Video Sync Issues in LiveKit Publishing
n
@aloof-scooter-47164 if you’re looking at recordings in the new agent observability tool I think the recordings are inaccurately cut off and do not match what the user actually experienced. I’ve noticed the same issue.
t
Thanks — I hear you: you and Sebastián are seeing recordings in the new agent observability tool that appear cut off compared to the user’s real experience. I can help investigate — a few quick questions to narrow this down: • Are the cutoffs happening only at the very start of recordings, only mid‑call, or both? • Is the agent using the default device capture or a custom
AudioSource
(or both)? • Are you running VAD/STT or any post‑processing in the observability agent that might end streams early? • Do the raw egress/recording files (outside the observability UI) also show the cutoffs, or is it only in the observability playback? • Approximate environment: Raspberry Pi or other hardware, and any CPU/load spikes when the issue occurs? Answering these will let me point to the most likely cause (pre‑connect buffer,
AudioSource
queue size, VAD behavior, subscription timing, or device/CPU timing) and give exact config steps to test. Would you like me to recommend specific debug commands and config changes to try next?
a
@nutritious-bird-16298 I've experienced this with the LiveKit Egress recordings, not with the observability though I think the recording should be similar right?
t
You're right to compare them — LiveKit Egress recordings should match what you get from the observability playback, but the failure modes I mentioned can show differently between the two. To narrow this to the Egress recordings specifically, quick questions: • Which Egress type are you using (file/MP4, stream/RTMP, or cloud)? • Does the cut‑off occur only at the start, only mid‑call, or both? • Are you publishing audio via the default device capture or a custom
AudioSource
on the Raspberry Pi? • Do the raw egress files (downloaded from your egress target) show the same cut‑off as what you hear in the observability tool? • Are you running VAD/STT or any agent-side processing that could end streams early? Answer those and I’ll give exact config changes and diagnostic commands to test (e.g., increase
AudioSource
queue_size_ms
, check pre‑connect buffer handling, and VAD thresholds).