Sorry, forgot to mention that this supersedes 208050 (but it doesn't supersede 208051).
Giovanni.
Il 22/06/21 12:13, Giovanni Mascellani ha scritto:
The IAudioClient implementation from both Windows and winepulse.drv never sets the event more than once per period, which is usually around 10 ms long. Some codecs produce audio samples shorter than 10 ms, which currently result into the SAR not being able to keep up with the audio client, because the SAR never requests more than a sample per event cycle.
This patch causes the event to be set each time a sample is received; this way the queue is immediately processed, and if required a new sample is immediately requested, instead of having to wait for the next IAudioClient period.
Of course it would be even better if the codecs didn't generate too short samples, because they uselessly require more CPU cycles, but we should handle them properly anyway.
This patch fixes audio stuttering problems in the logo videos of Borderlands 3, Deep Rock Galactic and Mutant Year Zero.
Signed-off-by: Giovanni Mascellanigmascellani@codeweavers.com
v2: Remove some changes that didn't really help the solution and update the description accordingly.