Skip to content

Bound return-audio pacing queue - #277

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/bound-return-audio-queue
Open

Bound return-audio pacing queue#277
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/bound-return-audio-queue

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • add a per-participant return-audio backlog cap (return_audio_max_buffer_s, default 3 seconds)
  • drop the oldest queued audio frames when a TTS burst exceeds the cap, keeping newer audio responsive
  • expose queued/dropped frame and duration counters and rate-limit backpressure warnings
  • extend pacing tests for overflow, drop-oldest behavior, flush metrics, and invalid buffer limits

Tests

  • PYTHONPATH=server-runtime:utils/xr-ai-logging uv run --project agent-sdk --with pytest --with pytest-asyncio --with loguru --with numpy --with livekit --with livekit-api --with pyyaml --with fastapi --with 'uvicorn[standard]' --with httpx --with websockets --with cryptography pytest tests/test_return_audio_pacing.py\n- uvx ruff check server-runtime/xr_media_hub/transport/livekit/_room_client.py server-runtime/xr_media_hub/transport/livekit/config.py tests/test_return_audio_pacing.py

Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
@fallintoplace
fallintoplace force-pushed the fix/bound-return-audio-queue branch from 359dbd5 to 165d72e Compare June 30, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant