On Thu Jan 8 21:47:26 2026 +0000, Paul Gofman wrote:
I am afraid the period can't be arbitrary changed like that, that is exposed to applications and changing it this way will break apps' expectations. I didn't look at the patch at full though. Just FYI, there is also https://gitlab.winehq.org/wine/wine/-/merge_requests/8628 which is largely orthogonal to your changes and didn't get any attention yet, but I believe that is something needed to be done and introducing arbitrary timer adjustments would be unfortunate. Overall, it could probably help if you described the conditions / steps how the actual problem can be reproduced. As it is not like we observe audio crackling with winepulse anywhere often, that is probably something winepulse setup specific or happens with specific app? What if we should approach this entirely differently. It took a gargantuan amount of effort, but I believe my logic is looking pretty good right now. Programs are not overwhelmed with requests for audio, I did consider this scenario. Audio tests seem to pass (winmm:mci failed for the first time, not sure if it's related at all?) and audio is consistently good in games. Of course, I might be missing something.
Unfortunately, I don't believe it is matter of config, I am running Fedora KDE 43 with pipewire and RT audio permissions. It's nothing too far from the default, my CPU just seems to be quite jittery and that causes crackling. Honkai: Star Rail is the worst game in terms of crackling by far, but crackling happens in every single game with winepulse, and there is no crackling at all with winealsa. Honkai is forcing 44.1k sample rate, so it gives audio in 441 chunks and it's consumed in chunks of 471 (with 48k quant at 512). I don't quite understand why Honkai specifically acts like this, but the crackling happens every 20-30 seconds with 512 quant and it's actually better with 256. Maybe something with tlength to minreq scenario? with winepulse it varies between 2.5:1-3.5:1 depending on quant. If I am not mistaken, winealsa is always 4:1 if used with alsa pulse plugin (standard with Proton, as Steam runtime doesn't have pipewire libraries yet) The issue is definitely not exclusive to my setup, because I have seen mentions of crackling of similar nature when it came to Honkai. Although, setting quant to 256 might have helped that person (they reported it worked, but crackles can appear 20-30 minutes into the session). There is a mention of Balatro crackling on r/linux_gaming as well, and I believe it is definitely related to CPU jitter as well, because I can't think of any other explanation. In my case, every single game crackles under winepulse, even with quant set at 1024-2048. Games never crackle with winealsa on my setup. So far, with my patch even Honkai is perfect, though I can't quite get quant as low as with winealsa. I can go down to 220 at 48k with winealsa and 240 crackles with my patched winepulse (512 is fine). I don't like that I use an arbitrary number either, but I believe the root of the problem is insufficient safety margin and it needs to be addressed in some way. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9840#note_126570