-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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): set the bits-per-sample of Steam Streaming Speakers to 16-bit when the default audio device is 16-bit #3704
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3704 +/- ##
==========================================
- Coverage 11.61% 11.60% -0.02%
==========================================
Files 92 92
Lines 17337 17353 +16
Branches 8100 8109 +9
==========================================
Hits 2013 2013
- Misses 14727 14743 +16
Partials 597 597
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I'm going to rewrite this as a method that returns the default device format and actually matches the SSS to the device. It doesn't need to be specific to 16 bits. |
This may have a bad bug :( I somehow caused it to run into some errors. I realized I'm not sure that I'm safely calling
|
7859814
to
e7df2a3
Compare
OK, this is cleaned up and squashed to 1 commit. I discovered that the last patch I made to this file, removing f32 and s32 from stereo, would break this new logic if you had a 32-bit default device. The correct fix for that previous issue is just to put these at the bottom of the list so they aren't preferred over 24 and 16. This now works well for me and I can't reproduce the issue I had. I have also added extra logging that may prove helpful if this doesn't solve the issue for people. Specifically I log the bps and samplerate of the internal mixer format, with a note about auto-resampling if it's not 48k. |
… format * Match the virtual device's bits-per-sample to the default audio device, as a mismatch could cause audio glitches. * Add back f32 and s32 stereo formats which are now needed to support devices set to 32-bit. They are now lower priority than 24 and 16-bit to avoid regressing the fix for spatial audio settings. * Add more detailed logging around the virtual audio settings. Some users may be having problems caused by the internal mixer format, so that is now logged as well.
e7df2a3
to
754a825
Compare
|
// The list of virtual formats are sorted in preference order and the first valid format will be used. | ||
// All bits-per-sample options are listed because we try to match this to the default audio device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good opportunity to document the template better. Could you document this template using a doxygen comment block?
/**
* @brief ...
* @tparam ...
*/
}; | ||
} else if (channel_count == 6) { | ||
auto channel_mask1 = waveformat_mask_surround51_with_backspeakers; | ||
auto channel_mask2 = waveformat_mask_surround51_with_sidespeakers; | ||
auto channel_mask2 = waveformat_mask_surround51_with_sidespeakers; // XXX will never be used, but is probably the better 5.1 layout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is XXX
indicating here? Just calling extra attention to the note?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's actually true either. I thought 5.1 with surrounds as back speakers was pretty universal. @andygrundman did you have more context to add here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back in the DVD era, 5.1 had the 2 rear speakers on the side walls at 90 degrees and also they were a few feet above ear level. In the modern 5.1 layout for Atmos, Dolby says it's anywhere between 110 and 120 degrees, and everything is at ear level now. One thing that was never an actual thing is 5.1 with 180 degree rear wall speakers. Those speakers are what you add to the side speakers to get a 7.1 system (where sides are back to 90 degrees). So the right 5.1 would be putting them at 120, splitting the difference, but Microsoft is stuck with their legacy options, and an Atmos option that we can't really use.
I think in practice, it doesn't matter where the rear speakers are as long as it's sort of behind you a little bit. My comment preferring 5.1-side is partly because I'm old, but mostly referring to the way the ordering works in Sunshine, those other options won't ever be used and the user can't choose them. Really I'm happy if the channels are all lined up correctly on the client side. 7.1 was different from Windows in SDL for years and nobody noticed until we got it patched recently. (That was actually a Mac issue and don't get me started about Apple, with probably a hundred weird speaker layouts in their header files).



audio::prop_t prop; | ||
prop_var_t current_device_format; | ||
|
||
// clang-format off: easier to read this split over 2 lines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's not ideal to have this on a long line, but I'd prefer not to have clang-format exceptions for this. I'm open to different clang-format rules though to help make things more readable.
Description
fix(audio): set the bits-per-sample of Steam Streaming Speakers to 16-bit when the default audio device is 16-bit. This may help with audio glitches when enabling the virtual device.
Screenshot
Issues Fixed or Closed
Resolves https://github.com/orgs/LizardByte/discussions/682
Type of Change
.github/...
)Checklist