Skip to content

v0.1.3: ask the TTS for the pause instead of holding audio back; generation ids; bounded TTS wait; interrupt fixture - #19

Merged
korexil merged 1 commit into
mainfrom
v0.1.3-tail-hold
Oct 17, 2026
Merged

korexil merged 1 commit into
mainfrom
v0.1.3-tail-hold

Conversation

@korexil

@korexil korexil commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Follow-up to the forum feedback on the PCM traces. Measurements with this code are in bench/results/traces-2026-10-18 and bench/results/interrupt-2026-10-18.

No more tail hold. tts-service's /stream and /synthesize take an optional pause (seconds of silence after the sentence, 0–3, else 400); the leveler pads that instead of --sentence-pause. The standalone server asks for chunk_pause_ms per sentence and forwards every block as it arrives, so the 1.2 s hold and its trimming are gone (voice.tail_hold_ms removed). Taking turns: the first frame now leaves with the first PCM block, 1.77–1.96 s in three runs (it used to wait 0.19 s for the next block), and the 0.13 s gap at the start of an answer is gone (0 in 3 of 3). What plays is unchanged on a matched pair (same pause and silence statistics; no audible difference blind, one listener).

Events carry the answer number. gen on every bus event; tts_start / pcm / chunk_end are published from the worker at request / arrival / end time rather than when the paced event loop dequeues them. That dequeue timing had inflated the per-sentence RTF figures published from the 10-16 traces (0.96–0.98 / 0.84–0.89); re-measured at arrival they are 0.6 (first sentence 1.3–1.5 only while the LLM is decoding). The 10-16 README and docs/benchmarks carry the correction.

Bounded TTS wait. tts.read_timeout_s (default 10, was 60); the wake acknowledgement keeps 60 s for a cold start.

Interrupt fixture. loopback.py --abort-after S --then "..."; bench/tts_fault_proxy.py injects a 500 or a hang; bench/interrupt_fixture.py checks that nothing of the aborted answer leaks into the next one, with results for clean / 500 / hang. Unit tests cover the abort, a TTS error, a blocked TTS, the read timeout and the pause request (52 passed).

Engine patch. native-tts/qwen3-tts-cpp-16bb5af.patch regenerated from the build the demos and measurements were made with: the tail pad feeds codec silence frames (QWEN3_TTS_TAIL_PAD_CODES to override) instead of repeating the last frame, which doubled the ending audibly. Same C ABI. Docs follow. The v0.1.3 prebuilt package is built from this patch and will be attached to the release after it is checked on the GPU.

…generation ids; bounded TTS wait

- tts-service: /stream and /synthesize take an optional "pause" (seconds of silence after the
  sentence); the leveler pads that instead of --sentence-pause. standalone asks for chunk_pause_ms
  and forwards every block as it arrives: the 1.2 s tail hold and its trimming are gone, so the
  first frame leaves with the first PCM block (0.19 s sooner) and the occasional 0.13 s gap at the
  start of an answer no longer happens.
- Every event on the bus carries the answer number (gen); tts_start / pcm / chunk_end are published
  from the worker thread at request / arrival / end time, not when the paced event loop dequeues
  them (the 10-16 per-sentence RTF figures were inflated by that; corrected in the docs).
- TTS read timeout 60 -> 10 s (tts.read_timeout_s); the wake acknowledgement keeps 60 s for a cold
  start.
- loopback: --abort-after and --then; bench/tts_fault_proxy.py and bench/interrupt_fixture.py
  (button interrupt + new question, with a TTS 500 or hang injected); tests for the interrupt,
  TTS error, blocked TTS, read timeout and the pause request.
- native-tts patch regenerated from the build the demos used: the tail pad feeds codec silence
  frames (QWEN3_TTS_TAIL_PAD_CODES) instead of repeating the last frame; docs follow.
- bench/results/traces-2026-10-18 and interrupt-2026-10-18: measurements with this code.
@korexil
korexil merged commit c52f757 into main Oct 17, 2026
5 checks passed
@korexil
korexil deleted the v0.1.3-tail-hold branch October 17, 2026 16:17
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