CosyVoice3 v0.2.0: clicks at native streaming joins; cumulative HiFT context reduces discontinuities
Summary
With CosyVoice3 streaming on v0.2.0 (67d45feb2f654bbc66cca25bff78464b3ec08fa1), some voiced chunk boundaries contain an audible click/pop in the PCM produced by the native C API. This is observable before HTTP transport or audio playback.
Related historical reports: #22 (closed streaming-support issue) and #33 (closed onset/end-transient discussion). This report concerns internal streaming chunk joins.
Environment and scope
- Windows x64, AMD Radeon RX 9070 / gfx1201, Vulkan.
- CosyVoice3-2512 F16 GGUF local Shimanto derivative, with a cached reference GGUF. I have not established that every official model/reference reproduces the same waveform.
cosyvoice_tts_instruct_stream, speed 1.0, chunk_tokens 125, seed 42, strict seed enabled, 8 threads, AVX-512, balanced inference buffer.- LLM and DiT requested Q8_0 K / Q4_0 V with Q8_0 fallback; metadata diffusion-step count retained.
- Same v0.2.0 core and GGML/Vulkan binaries between controls. Local stage logging is content-free; an earlier logging-only control produced sample-identical audio to the uninstrumented core. No claim that a new pristine build of current main was tested.
Reproduction / measurement
One synthetic continuous test text:
今天我們沿著河邊慢慢散步看看路旁盛開的花朵接著走進街角的咖啡店挑一個靠窗的位置坐下喝完咖啡再一起聊聊最近遇到的有趣事情最後趁著天色還亮一起走回家休息。
Instruction: 清晰地說中文。
- Initialize the same model/reference and set chunk_tokens=125 and sampler seed=42.
- Call
cosyvoice_tts_instruct_stream. - Copy the native float samples in each callback and record cumulative sample offset. Concatenate directly, retaining the existing onset fade and adding no filtering, per-chunk fade, resampling, or loudness normalization.
- Listen around the native callback joins; also inspect the sample difference across each join.
For this model's metadata (24 kHz, token/mel ratio 2, pre-lookahead 3, HiFT 480 samples/mel frame), callbacks start the subsequent chunks at 4.72, 9.72 and 14.72 seconds. This agrees with the existing overlap/cropping length calculation; I did not find an off-by-one in that particular calculation.
The exact waveform and join amplitudes depend on reference and sampled speech. The private reference/audio are not attached, so the paragraph alone is not an exact portable reproduction of these numbers.
Controlled comparison
I compared the existing tail-mel cache against a local cumulative-mel implementation. The speech-token prefixes and Flow mel outputs at every call were byte-identical in both runs. Output length and first chunk PCM also matched. Only HiFT history/output commit handling changed.
For the synthetic continuous paragraph above:
| At 14.72 s | Existing tail-mel cache | Cumulative mel + output offset |
|---|---|---|
| Absolute adjacent-sample join step | 0.251224 | 0.017612 |
A separate 40-character control had join steps 0.117133 and 0.165045, reduced to 0.00330024 and 0.0458884 with cumulative mel. Listener feedback was that the cumulative version was nearly free of the previous obvious click, but this is not a universal listening test.
An adjacent-sample step is not itself a click score. In the continuous paragraph's cumulative result, the last emitted sample at 14.72 s exactly matched the next call's recomputed sample at that same time: the remaining 0.017612 was the natural waveform slope. In the other control at 9.72 s, the actual same-time recomputation discrepancy was approximately 0.004148, while the natural next-sample step was approximately 0.041740.
Suspected mechanism, not an isolated root-cause proof
In the v0.2.0 implementation:
token2wav_extretains a short tail of Flow mel for the next HiFT call.SineGen2::build_cgraphcomputes a localggml_cumsumphase from the supplied input; it does not receive an explicit prior cumulative phase state.- A finite tail of F0/mel is not generally equivalent to preserving the oscillator's accumulated phase.
By contrast, the official Python CosyVoice3Model accumulates mel, runs HiFT from the shared origin, then slices new output using speech_offset.
The controlled result implicates HiFT streaming-context continuity, but does not separately establish the contributions of phase, convolution context, noise alignment, or shape-dependent numerical behavior.
Local mitigation / design question
The local change keeps cumulative mel per worker and a committed speech-sample offset:
all_mel = concat(previous_mel, new_flow_mel)
full_wave = HiFT(all_mel, finalize)
emit full_wave[previous_commit:new_commit]
Async copies must finish before growing the CPU vector that was their source. State is reset for a new utterance, cancellation invalidates old pending audio, and finalization emits all remaining samples.
I also tested an optional second mitigation: choose a lower-energy handoff in the available prefix's last 20–250 ms (20 ms energy window, 1 ms candidate spacing), retaining the uncommitted suffix for the next recomputed prefix. It changes no sample values, inserts no silence, and uses no future prefix when selecting. It is not a substitute for correct vocoder state.
On three longer local controls, A=cumulative fixed handoff and B=cumulative energy-selected handoff:
| Audio duration | Maximum same-time recomputation discrepancy A | B |
|---|---|---|
| 43.04 s | 0.0000649691 | 0.0000363588 |
| 37.28 s | 0.0000987547 | 0.0000255924 |
| 49.56 s | 0.000836067 | 0.0000321917 |
These comparisons used identical speech tokens, Flow mel and full HiFT recomputations between A/B. The first two texts hit existing text-budget splitting and contain two sub-utterances; those inter-utterance joins were excluded from this metric. The last text was one continuous utterance. These maxima are not perceptual thresholds or evidence of benefit at every join.
Cumulative recomputation can increase long-utterance compute/workspace, so this is a correctness-oriented workaround, not a performance claim or a proposed final bounded-state design. Could you confirm whether preserving explicit HiFT phase/convolution/noise state would be the preferred upstream fix, or whether cumulative mel + speech offset is appropriate here?
Could you share the DiT KV setup you ran with — --diffusion-steps, --dit-kv-fixed-slots, --dit-kv-offloadable-slots, --dit-kv-cache-length? You mentioned the metadata diffusion-step count was retained and that KV used Q8_0 K / Q4_0 V, so we'd rather have the exact numbers than guess at the slot config.
Thanks — an update from our side.
Root cause confirmed: the NSF oscillator phase restarts per chunk.
In SineGen2::build_cgraph the per-harmonic phase is frac(f0*k/sr) + rand_ini[k], downsampled to mel rate and then ggml_cumsumed. That cumsum is seeded entirely from the mel passed to the current call, so at every streaming boundary harmonic k restarts at rand_ini[k] instead of continuing from the accumulated phase.
From the shipped CosyVoice3-2512 metadata (nsf_alpha = 0.1, nb_harmonics = 8, nsf_sigma = 0.003):
- a full phase jump bounds the step in the source signal at
2*nsf_alpha*uv ~= 0.2beforel_linear/tanh, which is your0.251224; - the excitation noise cannot be the cause:
noise_ampnever exceeds0.033withnsf_sigma = 0.003, so re-drawing it per chunk cannot produce a 0.25 step; - convolution context is already covered:
overlap_length()ismax(c0 + cp + 1, stft_overlap) = max(3 + 4 + 1, 1) = 8frames.
So, to answer your question directly: preserving explicit phase state is the right upstream fix, and cumulative mel is not the right shape for it. Upstream never chunked HiFT — token2wav concatenates the mel and vocodes from a shared origin, which makes speech_offset slicing trivially continuous. This port deliberately chose bounded per-chunk causal HiFT with a mel prefix, and the missing piece was the oscillator phase, not the context length. Cumulative mel would undo that choice and cost O(utterance) vocoder work per chunk, so we carry 36 bytes of state instead.
Status: implemented locally. The accumulated phase is kept per worker as a mod-1 fraction, added to the frame-rate cumsum before scaling, with the resume row derived as input_frames - retain_frames - 1 in mel-frame space (note the cumsum runs on the f0 axis, which is input_frames - 3). The correction is gated to speed == 1.0, because the cached mel prefix is prepended before the speed interpolate.
With DiT KV caching disabled, the joins are clean now.
New finding: with DiT KV caching enabled, a residual remains at the joins. HiFT is invoked identically in both configurations, so the phase correction is the same; that points at the mel itself rather than the vocoder state. In the all-cached path the DiT emits only new frames per chunk (fixed + offloadable == diffusion_steps), and any divergence between the cached-attention output and a full recomputation appears as a mel step at the join, which the vocoder then renders as a click. We are reproducing this locally now, so your KV numbers are no longer blocking — but if you still have them they would let us confirm we are testing the same configuration. We will follow up with measurements and, if it holds, a separate fix.
Thanks for investigating this and for publishing #37. I rechecked the exact native C-API harness and saved run logs behind the measurements in this issue.
| Option / equivalent field | Value |
|---|---|
--diffusion-steps |
API override 0 (use GGUF metadata); 10 effective steps, confirmed by cosyvoice_get_diffusion_steps() in the saved logs |
--dit-kv-fixed-slots |
0 |
--dit-kv-offloadable-slots |
0 |
--dit-kv-cache-length |
API input 0; resolved to 40960 (n_max_seq = 4096, multiplied by 10), although no DiT slots were allocated |
The harness zero-initialized cosyvoice_context_params_v4_t, initialized its base with cosyvoice_init_default_context_params(), and left both DiT slot counts at zero. It selected Q8_0 K / Q4_0 V with Q8_0 fallback for DiT, but that format selection did not enable DiT KV caching. My original wording was ambiguous: the reported cumulative-mel comparison used DiT KV caching disabled, not an all-cached configuration.
Other controls: Vulkan on RX 9070, speed 1.0, chunk_tokens 125, seed 42, strict seed enabled, one worker, 8 threads, balanced inference buffer, and LLM/Flow Flash Attention requested. The same local CosyVoice3-2512 F16 derivative and cached reference were used between runs.
I found fix/hift-streaming-phase at 712a7b7c402d2bd098103205b753736b8ff787d8 and will test it in an isolated build without our cumulative-mel workaround, first using the same zero-slot settings. I have not yet validated this branch or the separate cached-DiT residual locally.
Thanks — that clears it up, and it confirms we analysed the right configuration.
You're right on both points. With fixed = 0 and offloadable = 0 the DiT KV buffer is never allocated — build_kv_cache is the only allocation site and it is gated on fixed + offloadable != 0 — so dit_kv_cache_length resolving to 40960 does not affect the output. And selecting a KV format does not enable caching: cosyvoice_check_kv_cache_types only runs when dit_kv_fixed_slots != 0.
One correction so this issue stays focused: the "residual with DiT KV enabled" in our previous comment came from our own testing with DiT KV caching enabled — it was not part of your report, and not from a configuration you have validated. The cause is not yet identified and we are tracking it separately; there is nothing for you to validate on that front. Everything below concerns the zero-slot path you actually ran.
In that configuration the DiT still runs every chunk over the full mel prefix. Only the final transformer block of the last flow step trims the query side to the new frames (cut_len = offset); the keys and values of that block are still taken from the full prefix, and the preceding steps run full-length. The new frames are therefore conditioned on the entire history, which is consistent with your cumulative-mel HiFT patch removing the clicks: the dominant remaining discontinuity at a join was the vocoder oscillator phase. #37 targets that.
When you test 712a7b7 with the same settings:
- the correction only engages at
speed == 1.0, so your 1.0 is fine; COSYVOICE_HIFT_PHASE_LOG=1printsinput_frames / new_frames / cache_frames / retain / row / offsetper chunk, which is the quickest way to cross-check the resume arithmetic;- for a quantitative check, compare the adjacent-sample step at each join with the local step size just before it (for example the median
|x[t]-x[t-1]|over the preceding 100 ms), which removes the dependence on loudness. For reference, the two variants in your report gave 0.251224 and 0.017612 at 14.72 s.
I reran the original 75-character example from this issue following your instructions, with 712a7b7c402d2bd098103205b753736b8ff787d8, speed 1.0, DiT fixed/offloadable slots 0/0 and COSYVOICE_HIFT_PHASE_LOG=1.
Listening feedback: our local user listened to the patched retest clip and can still hear the problem. The measurements below are separate from that listening report.
Same original reproduction
The fresh baseline (67d45feb2f654bbc66cca25bff78464b3ec08fa1) produces 17.48 s / 419520 float samples. Its entire PCM is bitwise identical to the saved baseline behind the original issue, including the 0.251224 join at 14.72 s. This is the original example, not the different 49.56-second paragraph we also tested locally.
Both cores were freshly built with the same MSVC Release configuration and existing matched GGML/Vulkan companion binaries. Apart from the identical local dependency-import adapter, source files were verified against the fixed commit archives, including your five changed files. Neither compared core contains our cumulative-mel or handoff-selection workaround. Actual loaded core paths and hashes were checked.
Same local F16 CosyVoice3-2512 derivative and cached reference; Vulkan RX 9070; effective diffusion steps 10; chunk_tokens 125; seed 42; strict seed on; one worker; 8 threads; AVX-512; balanced buffer; LLM/Flow FA requested. DiT KV remains disabled. The model/reference are private and not attached, so this is not yet a portable official-model reproduction.
Your preceding-100-ms comparison
For a callback start at sample n, step = abs(x[n]-x[n-1]). At 24 kHz, the denominator is the median of the 2399 absolute adjacent differences inside x[n-2400:n], excluding the join itself, with no epsilon. Values are from native float PCM, without filtering, per-chunk fade, normalization or resampling. These ratios are diagnostics, not perceptual click scores.
| Join | Baseline step | Patched step | Baseline preceding median | Patched preceding median | Baseline ratio | Patched ratio |
|---|---|---|---|---|---|---|
| 4.72 s | 0.000633792 | 0.000648485 | 0.00197343 | 0.00198126 | 0.321 | 0.327 |
| 9.72 s | 0.000349421 | 0.000325820 | 0.000533264 | 0.000531793 | 0.655 | 0.613 |
| 14.72 s | 0.251224 | 0.227325 | 0.02011764 | 0.01950466 | 12.488 | 11.655 |
The large third-join step remains on this setup, even using the normalization you suggested.
Full phase log for the patched run
CONFIG diffusion_override=0 fixed=0 offloadable=0 cache_length_input=0 n_max_seq=4096 strict=1
TTS_FLAGS=15
REQUEST_SEED=42
hift phase: input_frames=244 new_frames=244 cache_frames=0 retain=8 row=235 offset=0.362805 0.725610 0.088415 0.451220 0.814024 0.176830 0.539635 0.902439 0.265244
hift phase: input_frames=258 new_frames=250 cache_frames=8 retain=8 row=249 offset=0.222351 0.444702 0.667053 0.889404 0.111755 0.334106 0.556458 0.778809 0.001160
hift phase: input_frames=258 new_frames=250 cache_frames=8 retain=8 row=249 offset=0.364476 0.728952 0.093430 0.457905 0.822382 0.186859 0.551334 0.915810 0.280287
hift phase: input_frames=138 new_frames=130 cache_frames=8 retain=0 row=-1 offset=0.364476 0.728952 0.093430 0.457905 0.822382 0.186859 0.551334 0.915810 0.280287
RESULT load_s=1.10238 synthesis_s=4.45148 audio_s=17.48 rtf=0.254661 rate=24000 samples=419520 steps=10 saved=1
Warm single-run controls: baseline RTF 0.255667 / first native PCM 0.874958 s; patched RTF 0.254661 / first PCM 0.868558 s. Timing excludes model load and is not a statistically established speedup.
I have not captured token/mel equality for this new branch comparison; the byte-identical token/mel evidence in the original issue applies only to the earlier cumulative-mel comparison. I am therefore not attributing the remaining problem to a particular component yet.
Could you check whether these checkpoint rows and accumulated offsets match the intended F0/mel alignment? Is there another tensor or boundary invariant you would like us to inspect to explain why the phase path is active but this original join remains problematic? Production was left unchanged; no private audio, reference, model or local paths are included here.
Thanks — the log settles it.
The checkpoint rows and accumulated offsets are correct: row = input_frames - retain_frames - 1 (235/249/249, -1 on the finalized call), and the printed offsets are the accumulated phase at the next call's absolute mel start (Phi(236)/Phi(486)/Phi(736)), proportional to the harmonic index as expected.
The invariant worth checking is the emitted frame count (result->length / scale_factor): intermediate calls emit input_frames - 8, the finalized call emits its full input_frames. Your 236/250/250/138 over a 874-frame mel satisfies that, and the emitted ranges tile the timeline exactly.
On the 14.72 s step: we cannot reproduce a join outlier on the F32 variant here. The mel and the oscillator phase are both continuous at the joins, and the join steps sit inside the natural frame-to-frame distribution. Since your step barely moves with the phase fix (0.251224 -> 0.227325), it looks specific to your model/reference; we would need a reproducible setup to go further.
#37 is reframed accordingly: it keeps the oscillator phase continuous across chunks as a correctness fix, without claiming to fix that join.
Update after testing the official F32 model and the official public reference. These are CPU results, not an F32 Vulkan reproduction.
Build and controls
-
PR #37 head
67dd1ef53203a2f1c76779383b4009a07ac6d1bb, MSVC Release on Windows, Ryzen 7 9800X3D / Radeon RX 9070. -
Official
CosyVoice3-2512_F32.gguffrom Lourdle/Fun-CosyVoice3-0.5B-2512-GGUF, revisionab01740bbbfcc059fd748163787554f7c8977e64; SHA256f1071f50711ee565736c250756e969cf687e7672e89f5f978a8c917307d284e7. -
Native
cosyvoice_tts_instruct_stream; CPU backend explicitly selected; 8 threads, AVX-512, one worker, balanced buffer, seed 42 / strict seed, speed 1.0, chunk_tokens 125. LLM/Flow FA requested; effective diffusion steps 10, DiT fixed/offloadable slots 0/0. Same separate Q8_0 K / Q4_0 V setting as previously reported; DiT caching remains disabled. -
No cumulative-mel or handoff-selection workaround, no added per-chunk fades, filtering, normalization or resampling. Original native onset handling retained.
-
Public reference: official zero_shot_prompt.wav, transcript
希望你以后能够做的比我还好呦。. Prepared with the native frontend-only CLI using speech_tokenizer_v3.onnx and campplus.onnx. The reference is 3.48 s / 24 kHz / mono; audio SHA256c7b31d6dbe7cc6a716dded00550db5b50940bf209e424e4ad207b12e657c8ff6. -
Same original 75-character test text:
今天我們沿著河邊慢慢散步看看路旁盛開的花朵接著走進街角的咖啡店挑一個靠窗的位置坐下喝完咖啡再一起聊聊最近遇到的有趣事情最後趁著天色還亮一起走回家休息。
Instruction:
清晰地說中文。
F32 / CPU observations
| Reference | Audio length | RTF (excluding model load) | First native PCM | Step at 14.72 s | Previous 100 ms median difference | Ratio |
|---|---|---|---|---|---|---|
| Our existing private reference | 16.36 s | 3.63306 | 11.9408 s | 0.177238 | 0.00854467 | 20.74 |
| Official public reference above | 16.36 s | 3.17571 | 10.2056 s | 0.112425 | 0.00932036 | 12.06 |
The official-reference F32/CPU run has join steps 0.000113057, 0.001773619 and 0.112424545 at 4.72, 9.72 and 14.72 s, respectively. Same preceding-100-ms definition as our previous comment, without epsilon; these remain diagnostics, not perceptual click scores.
With the public reference, phase logs show input/new/emitted frames:
244/244/236, 258/250/250, 258/250/250, 82/74/82.
Emitted frames sum to 818, matching 392640 samples at 24 kHz / 480 samples per frame; the mel dump also totals 818 new frames.
Listening distinction: our user hears a discontinuity in F32/CPU with our reference. For F32/CPU with the public reference, the user specifically confirmed a sudden loudness increase; whether an additional join click is audible is still unconfirmed. A candidate loudness rise occurs around 3.8 s: consecutive 200 ms RMS windows rise from 0.06089 to 0.20449 (~10.52 dB), away from callback boundaries. This does not establish the cause or equate that loudness change with the 14.72 s join. Full-clip peak is ~0.99; no samples reach |1|, but the native HiFT output clamp means this does not exclude internal limiting.
Why we could not run F32 on Vulkan
Loading the same F32 GGUF on Vulkan0 fails before reference loading or synthesis:
ggml_vulkan: Device memory allocation of size 2867917336 failed.
ggml_vulkan: Requested buffer size exceeds device buffer size limit: ErrorOutOfDeviceMemory
ggml-backend.cpp:133: GGML_ASSERT(buffer) failed
So we cannot currently test F32 on this Vulkan setup. The reported reason is a single-buffer size limit; we are not treating it as proof of total VRAM exhaustion. The process exited; no driver reset was recorded.
Our existing local F16 derivative does run on Vulkan. With the public reference, the seed-42 14.72 s step is 0.001736 and our user did not hear a click in that clip. Seed-42 reruns are bitwise reproducible. Additional Vulkan seeds 43/44 also gave smaller join steps with the public reference, but listening on a phone did not reliably distinguish the two references. This is a limited reference/backend interaction, not proof of a universal fix. The local F16 derivative and official F32 have different weights, so their comparison is not precision-only.
Does the Vulkan allocation failure require a different buffer/allocation configuration for this F32 model? For the CPU/public-reference case, which additional invariant would best separate the loudness change from the remaining boundary-step measurement?
Production remains unchanged. Test programs are closed. No private model, reference audio, generated voice audio, credentials or local paths are attached.
Follow-up listening correction to our F32/CPU report above: please supersede the earlier statement that the new Vulkan samples were difficult to distinguish on a phone.
For the two latest clips, both using our existing local F16 derivative on Vulkan, seed 44, chunk_tokens 125, speed 1.0 and DiT slots 0/0, the user now reports:
- Our existing reference: a small audible discontinuity.
- Official public reference: a sudden loudness increase. Its exact timestamp and cause have not yet been localized.
For context, the measured callback-join steps in those same seed-44 files are:
| Reference | 4.72 s | 9.72 s |
|---|---|---|
| Our reference | 0.039269 | 0.007022 |
| Official reference | 0.000626 | 0.006042 |
Both outputs are 14.80 s long; there is no 14.72 s callback join in these particular files. A smaller adjacent-sample step therefore should not be interpreted as a listening pass: the official-reference clip still has the reported loudness problem. We have not established whether it is related to a streaming boundary.
This Vulkan/F16 loudness report is separate from the F32/CPU + official-reference loudness increase around 3.8 s described above. The F32 Vulkan model-load failure (single requested buffer of 2,867,917,336 bytes exceeding the device buffer-size limit) also remains unresolved; we did not obtain F32/Vulkan audio.
No new synthesis or runtime changes were made for this listening update. The audio, float PCM, callback offsets, phase/mel logs and model/reference identities are retained locally for further diagnosis. Production remains unchanged; no private audio or model/reference files are attached.
Thanks — two answers.
1. Vulkan F32 load failure
This is a per-device, per-driver single-allocation limit, not VRAM exhaustion. The Vulkan backend rejects a buffer whose size exceeds the device's reported maximum buffer size: with maintenance4 available that is maxBufferSize, otherwise the device's maxMemoryAllocationSize (which is itself the smaller of the two when maintenance4 exists). The check is a per-allocation size check, not a total-memory check.
Our loader packs every weight except the embedding tables into a single buffer, so the model needs one allocation covering the whole weight set. If the driver reports a limit below that, the load fails at that allocation; on a driver that allows it, the same model loads. That matches what we see on our side: the same F32 model loads on Vulkan through an external ggml-vulkan build on an NVIDIA GPU, and fails on your AMD setup.
To confirm on your machine:
- read the device's
maxBufferSize/maxMemoryAllocationSize(vulkaninfo or a small probe); - run once with
GGML_VK_FORCE_MAX_BUFFER_SIZEset above the model's weight-buffer size. That bypasses ggml's own check only, so if the Vulkan allocation still fails, the cap is in the driver. (GGML_VK_FORCE_MAX_ALLOCATION_SIZEis the related override.)
The fix is on our side: split the weight buffer into several allocations below the limit instead of one block. There is no flag for that today. It is independent of streaming, so we can handle it separately.
2. Separating the loudness change from the boundary-step measurement
The loudness rise you located is inside the first callback's span, so it cannot be a join. Two checks separate them:
- per-frame mel RMS from
COSYVOICE_DUMP_MEL. If the mel energy jumps at the rise, it is content/DiT; if the mel is smooth while the audio RMS jumps, it is the vocoder. The same comparison across a join tells you which side a boundary discontinuity comes from — something a single adjacent-sample step cannot tell you. - the same text in a single chunk (large
--chunk-tokens) or non-streaming. One caveat: changing the chunking can change the sampled token stream, so compare the mel dumps first to confirm both runs are the same realization; only then compare the audio. If the rise survives that, it is unrelated to chunking.
Agreed that a smaller adjacent-sample step is not a listening pass.
Separate sampler finding: silent-token retries can shrink the nucleus
A separate synthesis failure surfaced in our v0.2.0-derived integration. This concerns the LLM sampling loop; it does not explain or fix the HiFT joins/loudness changes discussed above.
Code path: the baseline calls llm_prepare_probs() before each draw. After more than five consecutive silent/breath tokens, the rejection path retries without accepting a token or decoding new logits. But preparation sorts, top-p truncates and normalizes nucleus_probs in place. Repeating it can therefore change the distribution despite unchanged logits.
A small test using the actual prepare/sampler function bodies demonstrates the mechanism: initial probabilities [0.75, 0.11, 0.09, 0.05], top_p=0.8, top_k=4 produce two normalized candidates [0.872093, 0.127907]; preparing again leaves only the first candidate with probability 1. If it is a rejected silent token and does not trigger the accepted-history repetition fallback, advancing the RNG cannot escape it. Preparing once per logits state avoids this artificial collapse. This example uses synthetic probabilities, separately from the real-model test below.
Real-model replay
We recovered the actual provider input/instruction, cached reference GGUF and observed seed from a failed request. Tests call the native C API with the built-in sampler, without silent-token injection.
Controls: Windows x64, RX 9070 / Vulkan0, local CosyVoice3-2512 F16 derivative, same cached reference, 8 threads / AVX-512, balanced buffers, strict_seed=0, chunk_tokens=125, Q8_0 K / Q4_0 V, DiT slots 0/0, ASMR adapter off. Third-segment seed: 1909441579.
| Control | Result |
|---|---|
| Baseline, third segment alone, two independent process starts × three attempts | 6/6 failures, each at 113 accepted tokens with no PCM |
| Prepare-once fix, third segment alone, three attempts | 3/3 successful nonempty, finite PCM outputs |
| First two segments followed by the third, sequence repeated three times | Both versions succeeded on all nine segments; corresponding PCM files were byte-identical |
Our integration has a local bounded-rejection guard: the failing baseline reaches its 128-rejection limit, clears KV and returns failure. The guard/error wording is not claimed as an upstream feature. The original HTTP incident produced only a WAV header, before any PCM callback.
The sequence control is important: historical worker warm-up state was not fully recovered, and strict_seed=0 does not guarantee identical results across context histories. This is a repeatable native trigger, not a complete live/HTTP replay. A limited search with seeds 1909441578, 1909441580 and 42 produced nine successful attempts; a seed alone is not a reliable predictor. The exact real-model text/reference are private, so this is not a portable reproduction package.
Local correction
We prepare the nucleus only on the first draw for a logits state, then reuse it during silent-token rejection. Acceptance/decode restores the normal preparation path. In our loop, which already tracks consecutive rejected draws:
if (silent_resamples == 0)
llm_prepare_probs(n > min_len);
Cancellation, stop-token gating and bounded failure remain intact. This does not guarantee success if the original distribution itself only offers rejected tokens, and is not a listening-quality or streaming-continuity result.
Would you confirm that retries should preserve the prepared distribution, or rebuild it from an immutable copy of the original probabilities?
Thanks — your mechanism is correct, and we can confirm it against the code.
fetch_llm_probs()copies the raw top-k candidates intoworker->nucleus_probs, andllm_prepare_probs()sorts, top-p truncates and normalizes that same buffer in place (src/cosyvoice-llm.cpp).- The silent-token rejection path re-samples without accepting a token or decoding new logits, so it runs
llm_prepare_probs()a second time over the already normalized nucleus (src/cosyvoice-llm-job.cpp). - Re-applying top_p to a distribution that already sums to one is what collapses it: for
[0.75, 0.11, 0.09, 0.05]with top_p 0.8 the first prepare gives[0.872, 0.128]and the second leaves a single candidate at 1.0 — exactly your example. We reproduced it end to end by injecting a second prepare per step: for one logits state the nucleus shrank from 8 candidates with top 0.402 to 4 candidates with top 0.486.
Answer to your question: retries must see the same prepared distribution. Keeping it and rebuilding it from an immutable copy are equivalent; we rebuild from the copy, because cosyvoice_llm_prepare_probs() is also public, so integrations that call it repeatedly get the same guarantee.
Fixed in 24ef435 (fix/hift-streaming-phase, PR #37):
fetch_llm_probs()stores the top-k candidates in anucleus_rawsnapshot;llm_prepare_probs()rebuilds the nucleus from it, so repeated prepares for one logits state are idempotent.- The full-vocabulary fallback distribution is stop-masked once per logits state instead of on every prepare.
- An empty nucleus is reported instead of dividing by zero, and the silent-token drop path is bounded (64 retries), so a degenerate distribution fails the request instead of looping.
Verification here: same text and seeds, the PCM is byte-identical to the previous build for both the streamed no-KV and the DiT KV-cache configurations, and an injected second prepare per step is byte-identical to a single prepare. We have not run your Vulkan/F16 setup or the third-segment trigger; your 128-rejection guard should no longer be reachable through this path, but please tell us if it still trips.
Independently of the HiFT join/loudness measurements in this thread, two correctness fixes are in the same work: the NSF oscillator phase no longer restarts at every streaming chunk (same branch, part of PR #37), and the mel tensor no longer overlaps the DiT context tensors in the token2wav buffer (PR #38, 112a8c5). Neither is claimed to explain the join or loudness observations. The Vulkan F32 single-allocation failure (splitting the weight buffer) is still open on our side.
Vulkan F32 load failure: fixed in 0940f4c.
The weights are no longer allocated as one big buffer, so the device limit is no longer hit. Verified here with a forced 256 MiB cap: it loads and the PCM is bit-identical to the single-buffer run.
Could you retry the F32/Vulkan load on the RX 9070? If it still fails, the log now prints the effective cap plus the tensor/allocation size, so we can see what the remaining limit is. COSYVOICE_MAX_WEIGHT_BUFFER_SIZE=<bytes> (0 = unlimited) overrides the cap if you want to test a specific value.
Thanks for the fixes. We confirmed that 0940f4c resolves the F32/Vulkan loading problem on the RX 9070. We also found a way to reproduce a separate synthesis failure using the original F16 weights and the official public reference recording, so the failing example no longer depends on our custom voice reference.
Reproduction: original F16 model, official reference, emotional instruction
Result: the basic instruction stops normally; adding the emotional prefix reaches the generation limit and returns no PCM. This was tested through the native C API on our modified local core, not a clean upstream core.
Exact instructions and target text
Base instruction (UTF-8, Traditional Chinese):
年輕女聲,音色偏冷,咬字清晰,句尾俐落,語氣平穩,帶著大小姐的矜持傲氣和自信,自然切換語言說話。
Emotional instruction (one ASCII space follows the first 。):
帶一點開心而羞澀的情緒自然說話。 年輕女聲,音色偏冷,咬字清晰,句尾俐落,語氣平穩,帶著大小姐的矜持傲氣和自信,自然切換語言說話。
Target text (UTF-8, Simplified Chinese, including the final full stop):
见到你很开心。
These are the instruction body and text arguments passed separately to cosyvoice_tts_instruct_stream(). We did not concatenate the instruction into the text to be spoken.
Model, reference and settings
- Original
CosyVoice3-2512_F16.gguf, not fine-tuned. SHA-256:66f77746c066c6144ad48deae30c06b38a98bec2835aeb5bfe827b70c9254c24. - Official reference:
asset/zero_shot_prompt.wav, 3.48 seconds, mono, 24 kHz. Its transcript is希望你以后能够做的比我还好呦。WAV SHA-256:c7b31d6dbe7cc6a716dded00550db5b50940bf209e424e4ad207b12e657c8ff6. - We converted that reference with the existing
--frontend-only,--speech-tokenizer,--campplus,--prompt-audio,--prompt-textand--prompt-speech-outputCLI path. The resulting reference GGUF is 57,088 bytes, SHA-25691f995c1935de65c0e4a2ab76b663c7e85fe36196914e27481a2fdbea0c673ab. - Windows x64, RX 9070, Vulkan0, 8 CPU threads, AVX-512 selected, one worker, dedicated buffer policy, strict seed enabled, speed 1, chunk size 125.
- Effective LLM K=F16, V=Q4_0; Flash Attention=true;
n_batch=256,n_max_seq=4096. DiT fixed/offloadable slots=0/0; selecting DiT Q8_0 K / Q4_0 V did not enable DiT caching. - Temperature=1, top-k=25, top-p=0.8,
win_size=10,tau_r=0.1, minimum/maximum token-to-text ratios=2/20.
Sequence and lifetime
Start a fresh process for each instruction condition. Load the model and reference once. Set the initial context seed to 1838544680. Run the following four segments sequentially, without an additional warm-up:
| Segment | Text, exactly as passed | Sampler seed | Instruction |
|---|---|---|---|
| 1 | 哼,你总算来了。我是克劳德的陪用助手——本小姐,有什麽要说的吗? |
706409028 |
Base instruction |
| 2 | 第一段测试。 |
1525131626 |
Base instruction |
| 3 | 第二段测试。 |
4153587441 |
Base instruction |
| 4 | 见到你很开心。 |
1838544680 |
Base or emotional instruction (only changed field) |
Before each segment we free/recreate the TTS context with the same loaded model context and reference prompt, then call cosyvoice_set_sampler_seed() with the listed seed. We do not unload/reload the model between segments. Thus this is a four-segment reproduction; we have not established that the last sentence alone fails in a fresh context.
| Official-reference run | First three segments | Final segment |
|---|---|---|
| Base instruction | All complete; 161 / 29 / 26 generated tokens | Normal EOS; 37 generated/emitted tokens, 35,520 PCM frames (1.48 s at 24 kHz) |
| Emotional instruction | All complete; same generated token sequences | generated_token_limit; 140 generated, 136 emitted tokens, 0 PCM frames |
The target has 7 native text tokens, so ratio 20 gives a 140-token limit. The failure is not cancellation or exhaustion of same-logits silent-token retries. All four generated-token files in each condition match the earlier control using our custom Japanese female speech reference, even though PCM naturally differs with the reference.
We did not run a null-reference test: the current cosyvoice_prompt_init_from_prompt_speech() implementation dereferences the supplied speech asset. Passing null would not be a valid reference-free synthesis mode.
Which parts are our changes, and which parts are yours?
Our local integration separates the LLM's generated history from tokens sent to Flow. Excess consecutive silence is omitted from the audio input, but the generated token is still accepted into LLM history and decoded so the model advances. We implemented this C++ behavior following the separation in the official Python pipeline. The consecutive-silence counter persists across chunks; cancellation, reset and total-generation limits remain in place. We do not force EOS.
We adopted your 24ef43566a864ee46f9bafebb7364c3367b9adaf raw-probability snapshot, empty-candidate check and once-per-logits full-distribution stop mask. We retain our generated/output separation instead of your same-logits silent-token retry loop. We also locally marked the softmax and CPU-copy tensors as graph outputs to prevent their storage from being reused before readback. That lifetime fix alone did not resolve all incorrect-speech cases.
Build identification: c182… is a DLL SHA-256, not a Git commit. Our combined source is based on upstream 67d45feb2f654bbc66cca25bff78464b3ec08fa1 plus local patches and the adopted changes above; there is no single upstream commit representing this combined build.
- Local functional DLL SHA-256:
c182cf59ebebb69405a046f28f1b310c68e9e61b2f1c5d360652874e6890991d. - The exact base-model reproduction above used its log-only diagnostic derivative, SHA-256
28d83075612e9eb1ab85860532dd665dc0a343c2593ce3dabe4fa7d1945ec1ed. The added diagnostics do not change sampling arithmetic. In the original failing fine-tuned control, this diagnostic build and the functional build produced byte-identical tokens and float PCM; that equality is not a blanket validation of every input.
What the small instruction tests showed
The original and fine-tuned F16 weights can both hit the limit with the emotional prefix, so fine-tuning is not necessary for this example. Wording and placement matter in our small test set. Changing only the intermediate full stop to a comma did not help. Raising the generation limit produced more incorrect speech, not a fix. These results do not establish that all emotional instructions fail.
Exact wording variants and results (earlier fine-tuned F16/custom-reference control)
These variants used the same final target and seed above, but the earlier local fine-tuned F16 weights and custom Japanese female speech reference—not the original-model/official-reference experiment above. “Normal stop” is not a listening-quality pass.
| Full instruction body | Final-segment result |
|---|---|
年輕女聲,音色偏冷,咬字清晰,句尾俐落,語氣平穩,帶著大小姐的矜持傲氣和自信,自然切換語言說話。 |
Normal stop, 26 tokens |
帶一點開心而羞澀的情緒自然說話。 年輕女聲,音色偏冷,咬字清晰,句尾俐落,語氣平穩,帶著大小姐的矜持傲氣和自信,自然切換語言說話。 |
Generation limit, 140 tokens |
帶一點開心的情緒自然說話。 年輕女聲,音色偏冷,咬字清晰,句尾俐落,語氣平穩,帶著大小姐的矜持傲氣和自信,自然切換語言說話。 |
Generation limit, 140 tokens |
帶一點羞澀的情緒自然說話。 年輕女聲,音色偏冷,咬字清晰,句尾俐落,語氣平穩,帶著大小姐的矜持傲氣和自信,自然切換語言說話。 |
Normal stop, 30 tokens |
年輕女聲,音色偏冷,咬字清晰,句尾俐落,語氣平穩,帶著大小姐的矜持傲氣和自信,自然切換語言說話。 帶一點開心而羞澀的情緒自然說話。 |
Normal stop, 28 tokens |
開心又羞澀地說話。 年輕女聲,音色偏冷,咬字清晰,句尾俐落,語氣平穩,帶著大小姐的矜持傲氣和自信,自然切換語言說話。 |
Normal stop, 38 tokens |
請用清晰自然且平穩的方式來朗讀。 年輕女聲,音色偏冷,咬字清晰,句尾俐落,語氣平穩,帶著大小姐的矜持傲氣和自信,自然切換語言說話。 |
Normal stop, 26 tokens; ASR content mismatch |
The successful-stop neutral-prefix variant still had an ASR content mismatch. The punctuation-only control retained 75 native prompt tokens in both versions and hit 140 in both.
F32/Vulkan load-fix confirmation
Separately, a fresh upstream 0940f4cac56dd95f87c1de065a3d5783c135cb63 core loaded the original F32 model successfully. Automatic cap: 10 buffers, 2735 MiB total, maximum 1024 MiB per buffer. Forced 256 MiB cap: 30 buffers, same total. Both four-segment runs completed; corresponding generated tokens and float PCM were byte-identical. This is separate from our combined local-core reproduction, and is not a listening pass for the earlier HiFT click/loudness issue.
Synthesis counts
We count one actual native synthesis segment once, including functional tests with changed conditions. Only deliberate reruns of an already observed failure are excluded. Empty PCM and partial audio followed by failure are counted separately. These limited record sets are not a controlled before/after comparison or a complete historical failure rate.
Counts and record-coverage limits
| Record set | Syntheses | Failed with no PCM | Produced PCM, then failed |
|---|---|---|---|
Earlier local 9a26 conditional-resampling patch, 25-request AIVT batch |
38 | 1 (2.63%) | Not fully classified |
Combined local c182, two confirmed loaded processes |
13 | 0 | 1 |
| Earlier external functional/diagnostic controls, multiple cores/weights | 112 | 4 (3.57%) | 6 |
Later F16 derivative validation on c182 |
12 | 0 | 1 |
| New original-F16/official-reference control described above | 8 | 1 (12.5% in this small control) | 0 |
The old empty-PCM case reports silent_resample_exhausted. The current local-core partial failure reports generated_token_limit after 216,524 bytes. All ten failures in the 112-synthesis external set reached the generation limit; 16 deliberate replay segments were excluded from that set. These outcomes are not interchangeable, and they do not measure clicks or loudness.
The older 38-synthesis batch has 37 successful segments from its contemporary summary plus one precisely identified failure; not all original request IDs remain. Another 90 older native segments cannot be assigned to a particular core hash. The 803 timing IDs overlap delivery records and lack reliable segment joins, so adding them would double-count some syntheses. We cannot give a reliable all-time denominator. Load failures before synthesis are separate; cancellations after synthesis starts count in the denominator but are not classified as non-cancelled empty-audio faults. Missing fields are unknown, not zero incidents.
Would you recommend first repeating this four-segment test on your current core with original F16 weights, then comparing F32, or checking a particular instruction/token-boundary invariant? We have not isolated whether the remaining termination failure is due to model conditioning or an inference difference.
Silence handling aligned with the reference in 3d7547c.
Upstream dropped excess silent tokens by re-sampling against the same logits, so the model never advanced past them. Excess silence is now decoded into the KV cache and only omitted from the output, matching your separation. The drop path is also bounded by the generation limit, so a long silence run terminates normally.
On your question: since your generated tokens are identical across reference audio, the reference/flow path is not involved. I would compare the token stream against the official Python pipeline first (same text, instruction, seed, temperature, top_k/top_p, win_size/tau_r). If it matches, it is model conditioning and the remaining fix belongs at the application level (e.g. stop after N consecutive silent tokens with a clear error); if it diverges, it is an inference difference and the logits/sampling path is where to look next. F16/F32 would be the step after that.
Thanks for confirming the Vulkan split — your buffer counts match ours exactly.
A follow-up on the utterance-onset click discussed in #33 / QwenAudio/CosyVoice#1786, separate from the internal streaming joins originally reported here.
Reference-tail trimming helped in our local listening tests. We find the last sample in the reference recording with abs(sample) > 0.001 (−60 dBFS for normalized float PCM), retain the original recording through that sample plus 50–80 ms of its ORIGINAL tail, discard the remainder, and rebuild the reference features. The trim-only operation adds no silence, gain, fade or resampling; it does not trim the synthesized output.
We checked the saved test records:
- 80 ms trim-only control: a 5.41025 s reference had its last above-threshold sample at 4.700083 s. Trimming to 4.780125 s removed 630.125 ms. The listener did not hear the target onset click in that candidate. This was an isolated CPU Flow/HiFT replay using fixed body speech tokens.
- Normal text→LLM→Flow→HiFT control: three sentences × three reference variants, nine successful CPU syntheses in total. For the first two short sentences, the original reference had the click; the 50 ms trim did not; the 50 ms trim followed by 200 ms of digital silence had the click again. For the longer third sentence, neither the original nor the 50 ms trim had the click; the padded condition's listening result remains pending. Generated/emitted token sequences were byte-identical across the three reference variants for each sentence.
The normal-TTS control used our local F16 derivative and modified core, CPU 8 threads, one worker, 24 kHz, and retained our existing 160 ms onset treatment. Output gain was 1, with no normalization or additional fades. Thus this is not evidence that trimming alone fixes a clean upstream build.
Our practical observation is that 50–80 ms has been a useful retained-tail range, while approximately 200 ms can still leave a small click depending on the case. Please distinguish this listening observation from the explicitly tested 50 ms original tail + 200 ms added digital silence condition above.
This is an empirical mitigation, not a confirmed root cause or universal threshold. Reference feature lengths and embeddings change after trimming, and the control did not capture Flow noise tensors. The −60 dBFS cutoff may also miss very quiet breath/speech tails. No private reference audio is attached.
We tried to reproduce this locally with our own reference, and the direction matches yours, though we could not reproduce the click itself.
Our baseline: the first 20 ms are silent and the onset rises smoothly; the largest adjacent-sample step in the first 40 ms is 0.0011. No click. Our reference's last mel frames are active speech (RMS ~5-10), not silence, so your condition (a reference ending in silence) is not present here — and our prompt file is not your reference.
Reference tail does condition the onset. Trimming the prompt tail at 2 mel frames per speech token (so the emitted window and token count are unchanged, duration stays 2.4 s):
| prompt tail removed | max step, first 40 ms | peak, first 20 ms |
|---|---|---|
| none | 0.0011 | 0.0000 |
| 10 tokens / 20 frames | 0.0088 | 0.0192 |
| 20 tokens / 40 frames | 0.0054 | 0.0147 |
So the last frames of the reference set how abrupt the onset attack is, which is consistent with what you hear. In our case trimming makes the attack steeper (it removes a leading fade), i.e. we would expect trimming to help only when the retained reference actually ends in low-level/silent frames.
One caution if you trim: in our implementation the prompt feature length also determines how many leading frames are cut from the Flow output, so trimming the mel without the matching speech tokens is not a valid operation here. Trimming the mel only gave 2.8 s instead of 2.4 s and a loud burst (~0.14 peak) in the first 80 ms. Your "original tail kept" approach should keep the 2 frames/token relation.
Two questions: is your -60 dBFS tail true digital silence (or very low-level noise), and is the trim applied before resampling and feature extraction? We did not change any code for this; our reference simply does not show the click.
Thanks for checking. We inspected the saved WAV samples and preprocessing scripts to answer both questions; no new synthesis was run for this reply.
1. The original low-level tail is not entirely digital silence. The source is 24 kHz, mono, signed PCM16. In the 50 ms trim condition, the discarded 660.125 ms contains 15,843 samples: 14,633 zeros and 1,210 nonzero samples. Its peak is 3 PCM16 units (−80.77 dBFS), with RMS −99.36 dBFS, using 32768 as full scale. These numbers establish a very low-level nonzero residual, without identifying its acoustic origin.
By contrast, the separately tested 200 ms padding is true digital silence: exactly 4,800 zero-valued PCM16 samples appended after the 50 ms trim.
2. We trim the waveform before subsequent frontend resampling and feature extraction. The existing source WAV was already 24 kHz. We locate the last sample with abs(sample)/32768 > 0.001, retain that sample and the next 1,200 original samples, then write the exact PCM prefix. This changes 5.410250 s to 4.750125 s, without gain, fade, padding or resampling in the trim operation itself. Each resulting WAV is then passed independently to the native --frontend-only path, rebuilding speech tokens, mel features and speaker embedding from that waveform, with the same reference transcript. We do not slice an existing mel tensor or reuse the original reference tokens with a shortened mel.
The rebuilt prompt lengths were:
| Reference | Speech tokens | Mel frames |
|---|---|---|
| Original | 136 | 270 |
| Trim retaining 50 ms | 118 | 236 |
| Same trim + 200 ms digital silence | 123 | 246 |
The original frontend output is not exactly 2:1; we report it as observed rather than manually adjusting it. Both rebuilt variants are 2:1, yet the padded variant still had the target onset click in the first two sentences while the trim-only variant did not. Thus the observation is not explained solely by a mel-only trimming mismatch.
As previously noted, the generated/emitted body token sequences were byte-identical across reference variants for each sentence. This still does not isolate which changed reference feature, output-window geometry, or Flow noise realization is responsible. The tests retain our modified core and existing onset treatment, so we are not claiming a clean-upstream reproduction or a confirmed root cause.
A correction to our previous comment: the 0.0011 → 0.0088 numbers came from an experiment that removed tokens and mel frames together, so that run was comparing different generated content, not the onset conditioning. We re-did it with clean controls on the same text/seed:
- Fixed length (174 frames / 87 tokens), only the last 20 mel frames replaced by the prompt's per-bin floor ("silence") or by the loudest frame: onset max step 0.0011 (original) → 0.0002 (both variants), duration 2.400 s in all three. The mel-tail content alone does not change the onset.
- Mel untouched, only the last 10 prompt speech tokens replaced with silence ids (1 and 2): 0.0011 → 0.0007 → 0.0002, duration unchanged. The token-tail content does not change the onset either.
So in our environment we cannot produce an onset transient by changing the reference tail in either way; all onsets stay smooth fade-ins. We are not able to reproduce your click with the reference we have.
That leaves your data as the more informative experiment: trim (118 tokens) vs trim + 200 ms of digital zeros (123 tokens) differ by exactly 5 prompt speech tokens, since the padding gets re-tokenized. Your suggested control would settle it: pad the trimmed waveform with 200 ms of the original low-level residual you measured (the 1,210 nonzero samples) instead of zeros — same length, same token count, different content. If that still clicks, the extra 5 tokens are the suspect; if not, the zeros themselves are.
No code changes were made for any of this.
Thanks again for your earlier checks. Two brief observations from our recent tests:
- In a 3 x 3 spoken-language/emotion-description matrix, one Japanese emotion description produced extra speech or token-limit failures across Chinese, English and Japanese targets. The English/Chinese descriptions did not show the same extra-content pattern in this one-seed test. The token-limit failure also occurred with untuned F16 weights, the official public reference and F16 K/V. Our diagnostic controls showed the expected input-token boundaries and byte-identical output to the installed runtime. The cause remains unconfirmed. These instruction tests used our locally patched v0.2.0 build.
- In a separate build of upstream commit 3d7547ce4076cf098203ef8d7de739078e85272c with unchanged C++ sources, adding 200 ms of digital silence to the official reference increased the first-120-ms peak in all six streaming comparisons. Non-streaming durations were unchanged. These waveform measurements do not by themselves confirm an audible click or a common cause with the instruction results.
Sharing these as additional observations; no specific code change is proposed.
Follow-up on the peak measurement: we reproduced your streaming observation on the merged main + 3d7547c build, with one addition.
Emulating your 200 ms pad (5 extra prompt speech tokens + 10 silent mel frames, 2:1, kept consistent with the tokenizer output):
| mode | first-120-ms peak | first-40-ms max sample step | duration |
|---|---|---|---|
| streaming, original prompt | 0.0760 | 0.0011 | 2.400 s |
| streaming, +200 ms silent pad | 0.0801 (+5.4%) | 0.0002 | 2.400 s |
| non-streaming, original prompt | 0.0837 | 0.0021 | 2.360 s |
| non-streaming, +200 ms silent pad | 0.0902 (+7.8%) | 0.0002 | 2.360 s |
So the pad raises the first-120-ms peak on our build too, and not only in streaming — but the adjacent-sample step goes down, i.e. the onset becomes earlier/taller and smoother, not harder. Duration is unchanged in both modes. On our reference the onset is a smooth fade-in and we still cannot reproduce an actual click, so we are not changing any code for it.
We also merged main into the branch (the buffer-overlap fix from #38 and the embedding-index lifetime fix are included) and pushed it.