Skip to content

chore(windows): add audio device-state watcher for headphone dropout diagnosis (#724) - #726

Draft
abduznik wants to merge 1 commit into
getopenscreen:mainfrom
abduznik:fix/windows-headphones-idle-poweroff
Draft

abduznik wants to merge 1 commit into
getopenscreen:mainfrom
abduznik:fix/windows-headphones-idle-poweroff

Conversation

@abduznik

@abduznik abduznik commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Draft PR for #724 — this is diagnostic instrumentation only, not a fix yet.

Per the discussion on the issue, before committing to a keep-alive-stream fix we need real evidence on which of three mechanisms is causing headphones to drop mid-recording: USB selective suspend, WASAPI render-endpoint idle, or the headset's own firmware auto-off timer. A silent keep-alive stream only helps with the first two.

This adds WasapiDeviceWatcher, an IMMNotificationClient that logs render/capture endpoint state transitions as structured JSON events for the duration of a recording. It changes no recording behavior — opt-in only, via OPENSCREEN_WGC_LOG_AUDIO_DEVICE_EVENTS=1.

Opening this as a draft mainly to get Windows CI to compile-check it (my local VS Build Tools install is currently broken and I can't build locally yet). Will report back on the issue once I've captured real device-state events during a reproduction on my hardware.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

…n#724

Before committing to a fix for the headphone-drops-mid-recording issue,
we need real evidence on which of three mechanisms is responsible: USB
selective suspend, WASAPI render-endpoint idle, or the headset's own
firmware auto-off power timer. A silent keep-alive stream only helps
with the first two.

Adds WasapiDeviceWatcher, an IMMNotificationClient that logs render/
capture endpoint state transitions as structured JSON events for the
duration of a recording. Diagnostic only -- no recording behavior
changes. Opt-in via OPENSCREEN_WGC_LOG_AUDIO_DEVICE_EVENTS=1.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@abduznik abduznik changed the title diag(windows): audio device-state watcher for headphone dropout (#724) chore(windows): add audio device-state watcher for headphone dropout diagnosis (#724) Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant