SubtitleEdit/subtitleedit · error · InvalidOperationException

crispasr (cosyvoice3-tts) exited during startup (code {exitC

Error message

crispasr (cosyvoice3-tts) exited during startup (code {exitCode}). Output: {tail}{LaunchCmdSuffix}

What it means

InvalidOperationException from CosyVoice3CrispAsr.EnsureServerRunningAsync: the crispasr (cosyvoice3-tts) process exited before the /health probe succeeded. Unlike Chatterbox's launcher, CosyVoice3 has no signature matchers here — every startup-time exit surfaces as this generic error with the exit code and the captured log tail.

Source

Thrown at src/ui/Features/Video/TextToSpeech/Engines/CosyVoice3CrispAsr.cs:790

            // Local startup is fast; first-run --auto-download (~921 MB minimum, ~2.5 GB for F16)
            // needs a generous timeout for the silent companion fetch behind -m auto.
            var deadline = DateTime.UtcNow.AddMinutes(allLocal ? 5 : 30);
            while (DateTime.UtcNow < deadline)
            {
                ct.ThrowIfCancellationRequested();
                if (process.HasExited)
                {
                    var tail = SnapshotServerLog();
                    var exitCode = process.ExitCode;
                    var exitedLaunchCommand = _serverLaunchCommand;
                    _serverProcess = null;
                    _serverPort = 0;
                    _serverLaunchCommand = null;
                    _serverModelKey = null;
                    _serverVoiceArg = null;
                    _serverRefText = null;
                    throw new InvalidOperationException(
                        $"crispasr (cosyvoice3-tts) exited during startup (code {exitCode}). Output: {tail}"
                        + LaunchCmdSuffix(exitedLaunchCommand));
                }
                if (await ProbeHealthAsync(port, TimeSpan.FromSeconds(2), ct))
                {
                    return;
                }
                await Task.Delay(TimeSpan.FromSeconds(1), ct);
            }

            var lastOutput = SnapshotServerLog();
            var timeoutLaunchCommand = _serverLaunchCommand;
            StopServerInternal();
            throw new TimeoutException(
                $"crispasr (cosyvoice3-tts) did not report healthy within {(allLocal ? 5 : 30)} minutes. Last output: {lastOutput}"
                + LaunchCmdSuffix(timeoutLaunchCommand));
        }
        finally

View on GitHub (pinned to 17a9f07487)

Solutions

  1. Read the 'Output:' tail — it identifies the missing file or the backend's fatal error.
  2. Verify all required model files are present via AreModelsInstalled(modelKey); if any are missing, let --auto-download fetch them.
  3. Confirm the voice arg (preset name or absolute WAV path) is valid and, for clones, that ref-text is provided.
  4. On low-RAM machines, use the Q4K model key instead of F16.
  5. Re-download the CosyVoice3 model bundle if files look corrupt.
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate that all required model siblings are present before launching.
if (!CosyVoice3CrispAsr.AreModelsInstalled(modelKey)) {
    Se.WriteToolsLog("CosyVoice3 model files incomplete; allowing --auto-download.", true);
}

Try / catch

try { await cosyVoice3Engine.Speak(text, out, voice, lang, region, model, ct); }
catch (InvalidOperationException ex) when (ex.Message.Contains("exited during startup", StringComparison.Ordinal))
{
    Se.WriteToolsLog($"CosyVoice3 startup exit: {ex.Message}", true);
    // Surface the 'Output:' tail so the user fixes the named cause; do not blind-retry.
}

Prevention

When it happens

Trigger: Inside the startup loop (deadline = allLocal ? 5 : 30 min), process.HasExited becomes true; the code snapshots the log, nulls all _server* fields, and throws with the exit code and tail.

Common situations: Missing or corrupt LLM/flow/hift/s3tok/campplus/voices files (the comment lists all required siblings); a voice path or preset the backend rejects at boot; the --ref-text was empty for a clone that requires it; a model-key/quant mismatch; insufficient RAM for F16.

Related errors


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