omi icon indicating copy to clipboard operation
omi copied to clipboard

Desktop: AudioMixer can starve /v4/listen when system audio is disabled or missing

Open waffensam opened this issue 7 months ago • 1 comments

Summary

Desktop conversation capture can reach /v4/listen ready and still produce zero transcript segments for the entire session when system audio is disabled or when the system-audio side stays empty long enough.

User-visible behavior

A typical failing session looks like this:

  • /v4/listen connects successfully and reports initiating -> stt_initiating -> ready
  • no Transcript [SEGMENTS] ever arrive
  • after ~80 seconds the desktop watchdog logs a stale connection and reconnects
  • stopping the recording force-processes a conversation that does not match the local session
  • the backend ends up with an empty or tiny discarded conversation instead of a normal transcript

Why this is distinct

This is not the same issue as #6952.

  • #6952 is about stale conversation IDs / lifecycle events binding the wrong backend conversation to a session
  • this issue is about the client starving /v4/listen of audio before STT ever has a chance to produce segments

This issue can happen even when there is no stale historical conversation ID involved.

Evidence

AppState always routes microphone audio through AudioMixer in desktop conversation mode:

  • desktop/Desktop/Sources/AppState.swift:1273
  • desktop/Desktop/Sources/AppState.swift:1421
  • desktop/Desktop/Sources/AppState.swift:1428

AudioMixer only emits in normal operation when both mic and system buffers have enough data:

  • desktop/Desktop/Sources/AudioMixer.swift:118-129

The mixer also caps each side to roughly one second of buffered audio:

  • desktop/Desktop/Sources/AudioMixer.swift:41

System audio capture only forwards real tap input; it does not synthesize silence frames:

  • desktop/Desktop/Sources/SystemAudioCaptureService.swift:301-404

A recent repro showed:

  • with system audio disabled, /v4/listen reached ready but produced zero segments and ended as a discarded shell conversation
  • after restoring system audio capture and playing continuous YouTube audio, segments started flowing immediately and the session finalized successfully

Most likely root cause

The microphone path is gated behind the presence of a usable system-audio stream.

When the system side is disabled or effectively empty, AudioMixer withholds output, the WebSocket stays in ready, and the session sends little or no sustained audio to /v4/listen until a tiny residual flush at stop.

Expected behavior

Disabling or lacking system audio should not block microphone-only desktop transcription.

A desktop conversation should continue to stream microphone audio normally even when no system-audio stream is present.

Proposed direction

  • if system audio capture is disabled, bypass AudioMixer and stream microphone audio directly to /v4/listen
  • or make the mixer treat a missing system-audio side as silence instead of blocking the mic path
  • or switch dynamically to a true mic-only mode whenever no usable system-audio stream is present

waffensam avatar Apr 22 '26 22:04 waffensam

Retracting this issue. The original diagnosis overstated the AudioMixer/system-audio starvation scenario: the system audio tap may provide silent buffers when healthy, so the broad inactive-source fallback proposed here is not justified. We are reverting that local change and observing before filing a narrower issue for only confirmed system-capture failure cases.

waffensam avatar Apr 24 '26 03:04 waffensam