Skip to content

Reduce streaming delay - #1216

Merged
0xShug0 merged 1 commit into
mainfrom
perf/voice-chat-startup-latency
Nov 6, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
perf/voice-chat-startup-latency

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Reduces avoidable waiting before streamed avatar playback while preserving generated reply text and audio.

  • Let LFM3-Audio streaming S2S emit available text without waiting for the next native speech frame. This lets selected-voice synthesis start earlier. Generated steps, audio-frame batching, offline inference and standalone TTS remain unchanged.
  • Write Base64 artifact payloads directly inside JSON quotes instead of copying them through the general JSON string escaper. Base64 contains no characters requiring escaping; output contents remain identical. IDs and metadata still use normal escaping. This server optimization applies to binary artifacts in ordinary results and streaming events, with the largest benefit for video payloads.

Measurement

Actual WebUI interaction on RTX 5090 CUDA, Debug build, Q8 LFM3-Audio and SoulX Lite, OWSM Base Q8, and cuDNN VAE. One complete warmup, followed by the same two-turn conversation with identical seed, voice, portrait and speaking speed. Measurements were serial.

Submission to speaking playback Main PR, first run PR, repeat
Turn 1 1,037 ms 998 ms 981 ms
Turn 2 985 ms 898 ms 948 ms

The gain is modest, approximately 40–90 ms in these requests. These measurements exclude cold startup and the time spent recording the question; they measure actual browser playback, not just model first-audio time.

Validation

  • Complete reply text and WAV bytes match main exactly in both measured PR runs.
  • Both browser turns completed without errors, retained conversation history, and kept the audio/video start gap below one frame.
  • LFM3-Audio session tests pass, including streaming/offline audio and reply-artifact parity and text-only stream events.
  • Server runtime selection tests pass, including artifact serialization checks for empty payloads, all byte values, Base64 padding, escaped IDs/metadata, ordinary results and streaming events.

No new options, precision changes or TTS chunk-boundary changes.

@0xShug0
0xShug0 merged commit e674711 into main Nov 6, 2026
12 checks passed
@0xShug0
0xShug0 deleted the perf/voice-chat-startup-latency branch November 6, 2026 03:37
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