Skip to content

feat(windows): add externally managed audio capture - #5647

Open
AlexAllocated wants to merge 1 commit into
LizardByte:masterfrom
AlexAllocated:codex/windows-external-audio
Open

feat(windows): add externally managed audio capture#5647
AlexAllocated wants to merge 1 commit into
LizardByte:masterfrom
AlexAllocated:codex/windows-external-audio

Conversation

@AlexAllocated

Copy link
Copy Markdown

Description

I use an audio mixer to route applications to different outputs, including a dedicated output for Moonlight. I want Sunshine to capture that output without changing the Windows default device. Otherwise, applications that follow the default can end up on the wrong output, or Sunshine and the mixer can keep undoing each other's changes.

This adds an Externally Managed Audio option on Windows. With it enabled, Sunshine captures the configured audio_sink and leaves default devices and device formats alone. It requires an explicit sink and won't fall back to another device if that sink is unavailable. Playback stays under the mixer's control, so the Virtual Sink and Moonlight host-playback settings don't affect routing in this mode.

The option is off by default. This builds on the direct capture support in #5408, which intentionally kept default-device switching for existing setups. This PR lets external mixers opt out without changing that behavior for everyone else.

Testing

Built and tested on Windows x64 and ARM64. The native test suites, frontend build, and browser checks pass.

Tested stereo playback and reconnecting from Moonlight while the mixer kept a separate local output. Added regression tests for sink selection, unavailable endpoints, endpoint reactivation, and compatibility with the option disabled.

Real-device unplug/replug and surround playback haven't been tested.

Screenshot

Externally Managed Audio option in the Windows Audio/Video settings

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T05:22:20.761810Z ee91444 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ee9144461d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/platform/windows/audio.cpp
@AlexAllocated
AlexAllocated force-pushed the codex/windows-external-audio branch 5 times, most recently from 23ecf7d to 7383096 Compare September 8, 2026 06:27
@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

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