-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wasapi: Don't use the system's resampler.
- Loading branch information
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b98b5ad
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 bad with it? Does this fix the glitchy playback on Wine? (right now when I run the Windows-built SDL2 application on Wine, the sound gets squashed and played like fast-forwarding when WASAPI is using but works fine when DSound or WinMM is used)
b98b5ad
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 can't speak for Wine (and Wine probably wouldn't be using the same internal resampler that Windows does), but we were finding instances where using AUDCLNT_STREAMFLAGS_RATEADJUST produces distortion in the final resampled output that SDL's resampler does not produce. The only reason we were using this flag is because we assumed Windows would produce better-quality output, and more efficiently, than SDL does, but this does not appear to be the case in reality. At least for now. It seems likely that Windows developers complained that they were required to provide a resampler of their own for any reasonable use of WASAPI, so Microsoft added a basic resampler into the API for these cases but probably aimed for speed over quality. But I don't really know. WASAPI originally provided no resampling at all, though.
For Wine specifically: it's possible that Wine doesn't support this flag, and just ignores it...and the absence of resampling at all would very likely produce the result you describe. In that case: this will instead use SDL's resampler and probably fix this problem. Please report back whether it does!
b98b5ad
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.
Just a heads up, I've bisected this commit as the cause of audio problems on resampled audio when I was testing building SDL from source for Citra.
The audio gets distorted, with much higher pitch, and sometimes clipping. The sample rate of the original 3ds audio is 32728 Hz.
I'm not sure what's the policy for bugs only present on the dev build, if they're allowed I may soon put the necessary information together into an issue.
b98b5ad
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.
32728Hz is a weird sample rate. :/
Please open a bug report, even on dev builds; it’s how we know to look at problems!