Repository navigation
Closed
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExempts this issue from stale automation.
Description
Bug: Voice recording freezes the app (UI hang + 100% CPU) when input device delivers no WASAPI data
Environment
- OpenClaw Tray WinUI: 0.6.12.0 (.NET 10.0.9)
- OS: Windows 10 19045 (x64)
- Input device: generic USB microphone ("K69 Audio Device", VID_31B2&PID_0011) using Microsoft's generic USB audio driver (
wdma_usb.inf)
Symptom
Clicking the voice-recording (STT) button in the chat page:
Audio pipeline started: 48000Hz 32bit 2ch → 16kHz mono, VAD=energy, STT=loadedis logged- A single thread spins at ~100% CPU (observed 87s of CPU in one thread, state = Running)
- The UI becomes unresponsive (freezes) until the process is killed
- No audio is ever detected (VAD never triggers; "cannot detect audio")
Root cause analysis
The TTS/STT pipeline uses WASAPI capture (via NAudio). On this machine the capture device opens successfully (an audio session appears on the device) but never delivers any data through WASAPI:
- WASAPI shared mode, formats 48k 16/24/32-bit float, mono/stereo: 0 packets / 0 bytes in 3s polls (verified with raw
IAudioClient/IAudioCaptureClientpolling, and NAudioWasapiCapturewith both event and poll paths) - MME (
waveInOpen) on the same device: normal signal (RMS -41 dBFS) - Device claims
IsFormatSupported(Shared, 48k/2ch float) = true, but capture silently returns nothing
So this is a device/driver quirk (generic USB audio class driver, WASAPI data path broken, MME works). Many USB microphones behave this way under wdma_usb.inf.
The bug in the Tray app
The pipeline never detects the zero-data condition:
- It starts the capture successfully (no error is logged)
- The capture thread apparently busy-spins waiting for data (100% CPU on one thread) instead of blocking or timing out
- The UI thread is starved → total freeze
- No timeout, no error message, no fallback
Expected behavior:
- If WASAPI capture produces no data within a timeout (e.g. 2-3s), the pipeline should stop, log a clear error (device opened but no data), and surface it in the UI instead of spinning forever
- The capture loop should not busy-spin; it should block on the device event / use
GetNextPacketSizepolling with a timeout
Reproduction
- Use any USB microphone whose WASAPI path delivers no data (generic USB audio class devices with broken WASAPI; MME still works)
- Start Tray, click the record button
- Observe freeze + single-thread 100% CPU
Suggested fix
- Add a data-timeout watchdog to the capture loop; on timeout, fail gracefully with a user-visible message
- Ensure the capture thread blocks (event wait /
Sleepwith timeout) instead of spinning whenGetNextPacketSizereturns 0 repeatedly
Log excerpt
[INFO] Whisper model loaded: %APPDATA%\OpenClawTray\models\ggml-small.bin
[INFO] Audio pipeline started: 48000Hz 32bit 2ch → 16kHz mono, VAD=energy, STT=loaded
(no further audio logs; UI frozen; process must be killed)
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExempts this issue from stale automation.
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon Aug 5, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 7, 2026, 4:59 PM ET / 20:59 UTC.
Summary
Keep open. Current main still has no first-audio timeout when WASAPI starts successfully but produces no nonempty callbacks, leaving the chat request waiting until its broad 120-second timeout.
Reproducibility: yes. for the missing recovery path: current source starts capture without a first-data deadline and chat waits 120 seconds. The particular driver-induced CPU spin still needs Windows runtime proof.
Root-cause cluster
Relationship:
canonicalCanonical: #1097
Summary: This is the canonical report for the missing WASAPI no-data recovery path; the linked wake-phrase PR is adjacent feature work.
Members:
adjacent_distinct: feat: add wake phrase voice assistant preview #1071 - It adds a wake-phrase assistant preview but does not own the no-data WASAPI failure path.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
No open PR owns this source-proven failure path, and one focused repair can add detection, teardown, a user-visible recovery path, and regression coverage.
Review details
Best possible solution:
Add a short first-audio watchdog in the shared capture owner, tear down capture on expiry, and route a clear recoverable microphone diagnostic to chat while preserving ordinary silence after audio begins.
Do we have a high-confidence way to reproduce the issue?
Yes for the missing recovery path: current source starts capture without a first-data deadline and chat waits 120 seconds. The particular driver-induced CPU spin still needs Windows runtime proof.
Is this the best way to solve the issue?
Yes. A first-data deadline at the shared capture boundary is the narrowest maintainable repair and avoids device-specific settings or fallback policy.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 89666df49eb9.
Label changes
Label justifications:
P1: A voice-recording action can hang the active Tray app and prevent a user from continuing chat until they terminate it.impact:crash-loop: The report and current failure boundary concern an application hang with sustained CPU use in the capture path.impact:ux-friction: The current voice flow provides no targeted in-product recovery when a microphone opens but yields no audio.Evidence reviewed
Acceptance criteria:
What I checked:
src/OpenClaw.Tray.WinUI/Services/AudioPipeline.cs:124, 89666df49eb9)src/OpenClaw.Tray.WinUI/Services/AudioPipeline.cs:285, 89666df49eb9)src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs:990, 89666df49eb9)src/OpenClaw.Tray.WinUI/Services/VoiceService.cs:291, 89666df49eb9)src/OpenClaw.Tray.WinUI/Services/AudioPipeline.cs:124, 01bacff715c0)Likely related people:
src/OpenClaw.Tray.WinUI/Chat/OpenClawReactorChatRoot.cs)src/OpenClaw.Tray.WinUI/Chat/OpenClawReactorChatRoot.cs)src/OpenClaw.Tray.WinUI/Services/AudioPipeline.cs)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.