https://bugs.winehq.org/show_bug.cgi?id=41007
Bug ID: 41007 Summary: Regression in minimum sound latency / HelBuflen value Product: Wine Version: 1.9.15 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: lolisamurai@tfwno.gf Distribution: ---
In versions 1.9.10 and earlier, I was able to bring the massive sound latency down to a decent 25ms by setting HelBuflen to 512 without any sound glitching or stuttering.
I believe that somewhere between 1.9.10 and 1.9.11 there was a regression, because starting from 1.9.11 I get massive sound glitching unless I up the HelBuflen to around 8192, which adds like 50ms of sound latency.
This is most definitely a regression in minimum sound latency.
I am running linux gentoo 64-bits, the wine prefix is 32-bits and I'm using pulseaudio. I'm specifically testing this with the game "osu!". I'm using the built-in dsound and native .NET 4.5.
Steps to reproduce:
git clone git://source.winehq.org/git/wine.git cd wine mkdir build cd build ../configure make WINEARCH=win32 WINEPREFIX=~/test winetricks -q dotnet45 # no, osu! doesn't run without native .NET 4.5 so you have to install it either # through winetricks or manually wget 'https://m1.ppy.sh/r/osu!install.exe' --no-check-certificate WINEARCH=win32 WINEPREFIX=~/test regedit # set HKCU\Software\Wine\DirectSound\HelBuflen (string) to 512 WINEARCH=win32 WINEPREFIX=~/test ./wine 'osu!install.exe'
Wait for it to install and start up. The game also seems to be occasionally freezing or crashing when this sound glitching happens. I couldn't manage to get a log for this crash because it seems to be stuck loading info, but I'm pretty sure you can reproduce it on your end easily. If I switch to native dsound, I just always get glitching even at 8192 HelBuflen.
If you perform these very steps on the stable version or 1.9.10, you will get proper audio.
All I can notice in terminal output is this error spamming: err:ole:CoInitializeEx Attempt to change threading model of this apartment from multi-threaded to apartment threaded
Not sure if it's related to this problem or not.
https://bugs.winehq.org/show_bug.cgi?id=41007
--- Comment #1 from Franc[e]sco lolisamurai@tfwno.gf --- after some git disect'ing I found the patch that causes the problem:
4fbe6f3e7601f7b39f7f672ffe43553eee92ab1b is the first bad commit commit 4fbe6f3e7601f7b39f7f672ffe43553eee92ab1b Author: Andrew Eikum aeikum@codeweavers.com Date: Thu May 19 09:11:08 2016 -0500
dsound: Allow inactive devices to change the primary format.
Signed-off-by: Andrew Eikum aeikum@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
:040000 040000 e4511ac904218b34603ae73bd2cdd3d5eec0e89e 69022780bf259181e84fe6ab187ea37427525214 M dlls
reverting this fixes the sound glitching
https://bugs.winehq.org/show_bug.cgi?id=41007
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |4fbe6f3e7601f7b39f7f672ffe4 | |3553eee92ab1b Keywords| |regression CC| |aeikum@codeweavers.com, | |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=41007
--- Comment #2 from Andrew Eikum aeikum@codeweavers.com --- Thanks for the nice bug report, I'll look into this soon. See also Bug 40716, possibly related.
https://bugs.winehq.org/show_bug.cgi?id=41007
--- Comment #3 from Andrew Eikum aeikum@codeweavers.com --- I've reverted this commit. Please retest with current wine-git or with Wine 1.9.17 when it is released.
commit b25e1aefc7b868266042f842955a001618ef3b1d Author: Andrew Eikum aeikum@codeweavers.com Date: Mon Aug 15 09:02:36 2016 -0500
Revert "dsound: Allow inactive devices to change the primary format.".
https://bugs.winehq.org/show_bug.cgi?id=41007
Ivan Molodetskikh yalterz@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |yalterz@gmail.com
--- Comment #4 from Ivan Molodetskikh yalterz@gmail.com --- Hello, I'd like to describe my experience with the added sound latency. I'm the author of https://bugs.winehq.org/show_bug.cgi?id=40716
I'm using ALSA (no PulseAudio), with patched winealsa.drv for reduced latency. The patch is simply changing three constants at the top of mmdevdrv.c (DefaultPeriod, MinimumPeriod, EXTRA_SAFE_RT) to lower values (the ones that work for me: 22000, 22000, 11000 respectively).
On wine 1.9.9 and earlier where everything works fine, this results in an extremely low (almost none) audio latency, which is good. Reducing DefaultPeriod and MinimumPeriod lower makes the sound crackle a lot. Reducing EXTRA_SAFE_RT doesn't seem to change anything.
On wine 1.9.10 and above the "minimal" values of the constants seem to be around 10000 and 10000 for me, below that there's no sound at all (there's no crackling stage). The audio latency is much higher (both on "good" values from wine 1.9.9 and on the new minimal values).
I tested it on wine 1.9.17 where the commit was reverted, and while the bug I reported did get fixed (by the way it was introduced in wine 1.9.11 while the high audio latency one - in 1.9.10), the high audio latency didn't.
https://bugs.winehq.org/show_bug.cgi?id=41007
--- Comment #5 from Franc[e]sco lolisamurai@tfwno.gf --- I'm aware that this doesn't fix the sound latency regression, as I am still looking into what caused that particular regression. This one bug report was mostly about fixing glitching on small buffer sizes. I'll open a new bug report on the increased latency when I get more time to test and git bisect.
Also, will check whether this bug is resolved ASAP, kinda busy with other stuff right now, thanks for the attention!
https://bugs.winehq.org/show_bug.cgi?id=41007
Franc[e]sco lolisamurai@tfwno.gf changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #6 from Franc[e]sco lolisamurai@tfwno.gf --- yep, this regression is solved.
https://bugs.winehq.org/show_bug.cgi?id=41007
Andrew Eikum aeikum@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |b25e1aefc7b868266042f842955 | |a001618ef3b1d
--- Comment #7 from Andrew Eikum aeikum@codeweavers.com --- Thanks for retesting!
https://bugs.winehq.org/show_bug.cgi?id=41007
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.9.18.