tonhowtf/omniget · warning

[omnidisc] volume failed

Error message

[omnidisc] volume failed

What it means

Logged in the fire-and-forget catch of setVolume() when `omnidisc_voice_set_volume` rejects. The local volumes map is already updated and persisted, so UI shows the new volume but the backend audio stream keeps the old gain until success. Non-fatal warning.

Solutions

  1. Read errorText(e) output to identify the backend reason (likely unknown user or mixer not ready).
  2. Ignore failures for userIds no longer in the channel; prune volumes for departed users.
  3. Confirm `omnidisc_voice_set_volume` is registered and accepts { userId, gain } with gain in [0,2].
  4. Ensure the audio engine/mixer is initialized before applying per-user volume.
  5. Remove or disable volume controls for users not present in the voice channel.

Example fix

// before
invoke("omnidisc_voice_set_volume", { userId, gain: clamped }).catch((e: unknown) => {
  console.warn("[omnidisc] volume failed", errorText(e));
});
// after
if (!participants.has(userId)) return; // skip volume for departed users
invoke("omnidisc_voice_set_volume", { userId, gain: clamped }).catch((e: unknown) => {
  console.warn("[omnidisc] volume failed", errorText(e));
  revertLocalVolume(userId);
});
Defensive patterns

Strategy: try-catch

Validate before calling

if (!Number.isFinite(gain) || gain < 0 || gain > 2) gain = 1; // clamp before invoke
if (!participants.has(userId)) return;

Type guard

function isValidTarget(userId: string): boolean {
  return typeof userId === "string" && participants.has(userId);
}

Try / catch

invoke("omnidisc_voice_set_volume", { userId, gain: clamped }).catch((e: unknown) => {
  console.warn("[omnidisc] volume failed", errorText(e));
  revertLocalVolume(userId);
});

Prevention

When it happens

Trigger: Calling setVolume(userId, gain) where the backend per-user gain apply fails: unknown/ departed userId in the voice mixer, audio pipeline error, or command not registered.

Common situations: Dragging a per-user volume slider for a user who just left the channel; audio engine not yet initialized; Rust handler returned Err applying gain to the mixer.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/96440aa0a9583d7d. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/stores/omnidisc-voice-store.svelte.ts:633

  } catch (e) {
    deafened = !next;
    console.warn("[omnidisc] deafen failed", errorText(e));
  }
}

export function setVolume(userId: string, gain: number) {
  loadVolumes();
  const clamped = Math.min(2, Math.max(0, Number.isFinite(gain) ? gain : 1));
  if (clamped === 1) {
    const next = { ...volumes };
    delete next[userId];
    volumes = next;
  } else {
    volumes = { ...volumes, [userId]: clamped };
  }
  persistVolumes();
  invoke("omnidisc_voice_set_volume", { userId, gain: clamped }).catch((e: unknown) => {
    console.warn("[omnidisc] volume failed", errorText(e));
  });
}

export async function refreshDevices(): Promise<void> {
  devicesLoading = true;
  try {
    devices = await invoke<AudioDevices>("omnidisc_voice_devices");
  } catch (e) {
    console.warn("[omnidisc] device list failed", errorText(e));
  } finally {
    devicesLoading = false;
  }
}

export async function setDevice(kind: DeviceKind, id: string | null): Promise<string | null> {
  const key = kind === "input" ? "input_device" : "output_device";
  try {
    await invoke("omnidisc_voice_set_device", { kind, id });

View on GitHub (pinned to 8600b91f42)