[Xbox] WASAPI: improves/fix 48000 Hz sample rate detection #21155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
WASAPI: improves/fix 48000 Hz sample rate detection.
Fixes DTS passthrough switch is not displayed in Xbox audio settings (still DTS works).
Motivation and context
Samples rates detection is based on
KSDATAFORMAT_SUBTYPE_PCM
test. Since WASAPI on Xbox only supports passthrough, PCM test fails but 48000 is implicit supported ifKSDATAFORMAT_SUBTYPE_IEC61937_DTS
orKSDATAFORMAT_SUBTYPE_IEC61937_DOLBY_DIGITAL
are supported.The error was hidden because apart from the DTS switch not being displayed in GUI, the DTS audio PT was still working.
Although it has never been reported before (far as I know), the same could happen in Windows x64 if a device does not support 16 bit / PCM / 48 KHz specifically but instead supports the RAW format corresponding to DTS or AC3.
It seems strange but an HDMI device could only support 32/24 bits in PCM and fail because only 16 bits are tested.
How has this been tested?
Runtime tested Xbox Series S.
Tested that DTS PT works same as before but also tested with DTS switch disabled and DTS is played as multichannel PCM.
Previously it was not possible to specifically disable the DTS format.
What is the effect on users?
[Xbox] fixes DTS passthrough switch is not displayed in GUI audio settings.
[Xbox] fixes DTS passthrough format cannot be disabled.
[Xbox] probably on systems that only supports 48KHz and not 192KHz (ARC ?), fixes passthrough didn't work at all. (not tested)
Screenshots (if appropriate):
Before (no DTS switch)
After
Types of change
Checklist: