https://bugs.winehq.org/show_bug.cgi?id=56702
Bug ID: 56702 Summary: Resampler cutoff frequency for upsampling seems too low Product: Wine Version: 9.8 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: dsound Assignee: wine-bugs@winehq.org Reporter: ttacwh+fgpjlj0hrlk5k@pokemail.net Distribution: ---
When you use wine directsound and mix in a secondary buffer whose sample rate is below your device sample rate (for example, upsampling 8000/11025 to 44100/48000), the resampled output has a frequency cutoff at around 1/4 of the secondary buffer's sample rate (1/2 nyquist frequency) instead of where it's supposed to be - around 1/2 the sample rate (or ~85% of nyquist freq, going by make_fir). You can also visually verify this if you view the spectrum of the resampled output.
This can be very noticeable especially if your input sounds are of a lower sample rate but still have higher frequencies present.
Other related aspects seem to be working correctly (mmdev opening the device at requested sample rate, pulseaudio negotiating sample format correctly according to logs, no other resampling in the chain).
It seems that the fir resampler logic (mixer.c, fir.h, make_fir) hasn't substantially changed since it was first added over a decade ago, so this seems less likely to be a regression.
Additionally, I confirmed that the linear resampler from DSound-Fast_Mixer patch (from wine-staging) does not have this issue - you can force it to always use the linear resampler by setting HQBuffersMax reg key to 0.
I don't have a test case to upload, but it should be fairly simple to reproduce. Tested on wine-devel 9.8 and 9.9 (linux mint 21.3 / ubuntu 22.04)
Thanks!