SubtitleEdit/subtitleedit · error · InvalidOperationException

MOSS-TTS (CrispASR) — the crispasr server crashed during syn

Error message

MOSS-TTS (CrispASR) — the crispasr server crashed during synthesis.

What it means

InvalidOperationException from the HttpRequestException catch in MossTtsCrispAsr.Speak when the POST to `/v1/audio/speech` fails AND the server process has exited (`died == true`). The MOSS-TTS crispasr server crashed mid-synthesis; StopServerInternal is called, the inner HttpRequestException is chained, and the server log + launch command are appended so the next call starts a fresh server.

Source

Thrown at src/ui/Features/Video/TextToSpeech/Engines/MossTtsCrispAsr.cs:476

            response = await HttpClient.PostAsync($"{ServerBaseUrl}/v1/audio/speech", content, cancellationToken);
        }
        catch (HttpRequestException ex)
        {
            var serverLog = SnapshotServerLog();
            var launchCommand = _serverLaunchCommand;
            var died = _serverProcess?.HasExited == true;
            if (died)
            {
                StopServerInternal();
            }

            var failMsg = $"MOSS-TTS (CrispASR) request failed — Voice: {mossVoice}, Text: {text}, "
                + $"RequestJson: {body}, ServerExited: {died}, ServerLog: {serverLog}"
                + LaunchCmdSuffix(launchCommand);
            Se.LogError(ex, failMsg);
            Se.WriteToolsLog(failMsg);

            throw new InvalidOperationException(
                (died
                    ? "MOSS-TTS (CrispASR) — the crispasr server crashed during synthesis."
                    : "MOSS-TTS (CrispASR) request failed — the connection to the crispasr server was dropped.")
                + (string.IsNullOrEmpty(serverLog) ? string.Empty : $"{Environment.NewLine}Server log:{Environment.NewLine}{serverLog}")
                + LaunchCmdSuffix(launchCommand),
                ex);
        }

        using (response)
        {
            if (!response.IsSuccessStatusCode)
            {
                var errorBody = await SafeReadErrorAsync(response, cancellationToken);
                var serverLog = SnapshotServerLog();
                var launchCommand = _serverLaunchCommand;
                var errMsg = $"MOSS-TTS (CrispASR) server error {(int)response.StatusCode} {response.StatusCode} — "
                    + $"Voice: {mossVoice}, Text: {text}, RequestJson: {body}, "
                    + $"ResponseBody: {errorBody}, ServerLog: {serverLog}"

View on GitHub (pinned to 17a9f07487)

Solutions

  1. Inspect the appended `Server log:` tail — the backend crash reason is logged before exit.
  2. Retry once; EnsureServerRunningAsync starts a fresh server. Repeated death on the same input points to the reference WAV or model.
  3. Re-encode the reference WAV to mono PCM at the expected sample rate.
  4. Free VRAM/RAM at failure time; close other GPU workloads.
  5. Chunk very long input text and retry per chunk.
Defensive patterns

Strategy: retry

Validate before calling

// Before batch synth, confirm server alive and reference WAV valid
if (engine.IsServerDown() || !File.Exists(mossVoice.FilePath)) { WarnUser(...); return; }

Try / catch

try { await mossEngine.Speak(...); }
catch (InvalidOperationException ex) when (ex.Message.Contains("server crashed during synthesis"))
{
    // Server auto-stopped; next call starts fresh. Retry once.
    await mossEngine.Speak(...);
}

Prevention

When it happens

Trigger: Reference WAV malformed so the moss backend segfaults during cloning; OOM/GPU fault killing the server mid-inference; corrupt model GGUF aborting on first synth; CUDA driver crash during generation.

Common situations: Reference WAV wrong sample rate/channel layout; VRAM exhausted by another process mid-render; truncated model download; backend bug on specific input.

Related errors


AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13). Data as JSON: /api/errors/3455c44ac87c3b50. Report an issue: GitHub.