Skip to content

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

Draft
AlexAllocated wants to merge 1 commit into
masterfrom
codex/windows-external-audio
Draft

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

Conversation

@AlexAllocated

@AlexAllocated AlexAllocated commented Sep 8, 2026

Copy link
Copy Markdown
Owner

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

@AlexAllocated
AlexAllocated force-pushed the codex/windows-external-audio branch 2 times, most recently from e3a6b2f to 894cd10 Compare September 8, 2026 03:26
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Last Updated 2026-09-08 04:12:44 UTC
Source Run CI Run #3
Commit 894cd105c5a8ec4a14bb642e159a895085a43321

Screenshot Comparison

PR #1 screenshots vs screenshots baseline.

Matrix: AppImage-aarch64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: AppImage-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-AMD64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-ARM64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-arm64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

@AlexAllocated
AlexAllocated force-pushed the codex/windows-external-audio branch 7 times, most recently from 23ecf7d to 7383096 Compare September 8, 2026 06:27
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