Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(audio/windows): don't set virtual speakers higher than 24-bit mode #3294

Merged

Conversation

andygrundman
Copy link
Contributor

Description

When the Moonlight "Mute host PC speakers" option is selected, Sunshine will change the audio device to Steam Speakers. The changed block of code cycles through some settings in order and stops on the first one found, which happens to be the 32-bit signed int format. What we really want to happen is to have 24-bit as the highest supported format because this mode won't unset an existing spatial audio mode (Atmos for Headphones only supports 16 and 24-bit at <= 48k.

This patch simply removes the F32 and S32 checks for stereo. F32 isn't supported by Steam Speakers, but S32 is and that's the one we want to avoid.

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

@ReenigneArcher ReenigneArcher changed the title Windows: don't set Steam speakers to 32-bit mode to play nice with spatial audio settings fix(audio/windows): don't set virtual speakers higher than 24-bit mode Oct 12, 2024
@cgutman
Copy link
Collaborator

cgutman commented Oct 12, 2024

@ns6089 thoughts?

@ReenigneArcher
Copy link
Member

Here's the related thread on discord: https://discord.com/channels/804382334370578482/1293704798574743625

@ns6089
Copy link
Contributor

ns6089 commented Oct 12, 2024

@cgutman Should be fine I think.

@cgutman cgutman force-pushed the andyg.steam-speakers-no-32bit branch from b4b4ad8 to 3bd6a56 Compare October 14, 2024 00:39
@cgutman cgutman enabled auto-merge (squash) October 14, 2024 00:39
Copy link

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.13%. Comparing base (5b435fd) to head (3bd6a56).
Report is 81 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3294      +/-   ##
==========================================
- Coverage   11.14%   11.13%   -0.02%     
==========================================
  Files          99       99              
  Lines       17213    17211       -2     
  Branches     8023     8023              
==========================================
- Hits         1918     1916       -2     
  Misses      12737    12737              
  Partials     2558     2558              
Flag Coverage Δ
Linux 8.42% <ø> (ø)
Windows 5.19% <ø> (-0.03%) ⬇️
macOS-13 13.59% <ø> (-0.04%) ⬇️
macOS-14 12.60% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/windows/audio.cpp 26.10% <ø> (-0.29%) ⬇️

@cgutman cgutman merged commit 3744c43 into LizardByte:master Oct 14, 2024
36 checks passed
qiin2333 pushed a commit to qiin2333/Sunshine-Foundation that referenced this pull request Oct 15, 2024
LizardByte#3294)

Windows: don't try to set Steam speakers to 32-bit mode to avoid clobbering spatial audio settings
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.

4 participants