fix: raise streaming chunk_size to 12 to cut codec re-decode overhead

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
mARTin-B78 2026-10-03 14:03:40 +02:00
parent 79909a6fb8
commit 169cfe9963
2 changed files with 10 additions and 1 deletions

View File

@ -378,6 +378,12 @@ The first request after container startup can be slower because CUDA graph captu
## Changelog
### Unreleased
**Fix: Streaming (8023) Slower Than Realtime**
- **Root Cause:** `generate_voices.py` wrote `chunk_size: 4` (~0.33 s audio) into every voice. Each streamed chunk runs a codec decode over 25 frames of left context plus a GPU sync, so a 4-frame chunk spent most of its time re-decoding context. Measured on GB10: RTF 1.13–1.49 with 1.0–1.9 s of playback underruns per 8.4 s sentence.
- **Fix:** Default `chunk_size` is now 12 (1 s audio per chunk; upstream default). Same sentence: RTF 0.96–1.01, underruns 0.14–0.29 s; time-to-first-audio rises from ~0.6–0.9 s to ~1.1 s. `voices.json` picks this up the next time `generate_voices.py` runs (container start).
- **Note:** Remaining speed is bound by the model step time (~61–73 ms/step) while other GPU workloads (LLM serving) share the GB10; the upstream figure without contention is ~44 ms/step (RTF ~0.53). Clients should keep a ~1 s jitter buffer.
### v6.11 — 2026-09-21
**Feature: Language Aliases for VoiceClone Voices**
- OpenAI-compatible clients that send a route alias such as `FR`, `FR_F` or `FR_M` in the `voice` field now get a configured speaker in that language (case-insensitive) instead of silently falling back to the default English voice. Unknown aliases still return the default voice or a 400 as before.

View File

@ -93,7 +93,10 @@ for scan_dir in SCAN_DIRS:
entry = {
"ref_audio": audio_path,
"language": detect_language(base_name),
"chunk_size": 4,
# 12 codec frames = 1 s of audio per streamed chunk. Each chunk
# re-decodes 25 frames of left context in the codec, so 4 made
# streaming ~30% slower than realtime on GB10 (measured RTF 1.3 vs 1.0).
"chunk_size": 12,
}
ref_txt = os.path.join(root, f"{base_name}.reference.txt")