sgl-project/sglang · error · ValueError

unsupported MiniMax H3 audio material chain {material_chain!

Error message

unsupported MiniMax H3 audio material chain {material_chain!r}

What it means

_load_waveform only accepts specific material chains: 'audio', 'video.reference_preserve', and 'video_audio.reference_preserve'. Any other chain string is rejected because the decoder does not know how to source audio for it.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/reference_encoding.py:244

    if max_duration_seconds is not None:
        max_duration_seconds = float(max_duration_seconds)
        if not math.isfinite(max_duration_seconds) or max_duration_seconds <= 0:
            raise ValueError("reference audio duration bound must be positive")
    start_time_seconds = float(start_time_seconds)
    if not math.isfinite(start_time_seconds) or start_time_seconds < 0:
        raise ValueError("reference audio start time must be non-negative")

    if material_chain == "audio":
        if source_sample_rate is None or int(source_sample_rate) <= 0:
            raise ValueError("reference audio sample rate must be positive")
        source_rate = int(source_sample_rate)
    elif material_chain in {
        "video.reference_preserve",
        "video_audio.reference_preserve",
    }:
        source_rate = 44100
    else:
        raise ValueError(
            f"unsupported MiniMax H3 audio material chain {material_chain!r}"
        )

    command = [
        "ffmpeg",
        "-v",
        "error",
    ]
    if start_time_seconds > 0:
        command += ["-ss", f"{start_time_seconds:.9g}"]
    command += [
        "-i",
        str(path),
        "-map",
        "0:a:0",
        "-vn",
        "-ac",
        str(MINIMAX_H3_AUDIO_CHANNELS),

View on GitHub (pinned to 0132848349)

Solutions

  1. Use one of the exact supported strings: audio, video.reference_preserve, video_audio.reference_preserve
  2. Check for the constant/enum defining chain names instead of raw strings
  3. If you added a new chain, extend the elif set and the corresponding decode parameters

Example fix

// before
minimax_h3_encode_reference_audio_rows(rows, material_chain="video")

// after
minimax_h3_encode_reference_audio_rows(rows, material_chain="video.reference_preserve", ...)
Defensive patterns

Strategy: type-guard

Validate before calling

SUPPORTED = {"audio", "video.reference_preserve", "video_audio.reference_preserve"}

def chain_ok(chain) -> bool:
    return chain in SUPPORTED

Type guard

def is_supported_chain(chain: str) -> bool:
    return chain in {"audio", "video.reference_preserve", "video_audio.reference_preserve"}

Prevention

When it happens

Trigger: Passing a material_chain like 'image.reference_preserve', 'video', or a typo like 'audio.reference' to minimax_h3_encode_reference_audio_rows.

Common situations: New material types added without updating this allowlist, or a typo/rename of chain identifiers between versions.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/05334591f3d49965. Report an issue: GitHub.