fix: unblock avatar audio after lost stream trailer - #7043
Open
mikemikimike wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
Thanks for catching this. Fixed in 0a74af3 by closing the last queued reader when a new stream arrives, while preserving the active-reader fallback. Added a regression test covering an active reader followed by a queued reader and a new stream. Local ruff, format, and diff checks pass; the focused pytest dependency sync was blocked by slow wheel downloads, so CI is being used for the full test verification. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When an avatar audio stream loses its trailer,
DataStreamAudioReceivercan remain blocked on that reader forever even after later audio streams arrive. This change closes the stale reader when a subsequent stream is received, allowing the receiver to emit the pending segment end and process queued audio.Testing
uv run --package livekit-agents --with pytest python -m pytest tests/test_datastream_io.py -quv run --package livekit-agents ruff check livekit-agents/livekit/agents/voice/avatar/_datastream_io.py tests/test_datastream_io.pygit diff --check