[Bug 42074] New: osu! - Audio latency regression (ALSA)
https://bugs.winehq.org/show_bug.cgi?id=42074 Bug ID: 42074 Summary: osu! - Audio latency regression (ALSA) Product: Wine Version: 2.0-rc3 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: yalterz(a)gmail.com Distribution: --- Introduced in wine 1.9.10, still present in 2.0-rc3. Copying my description from a comment on another issue. 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) which makes the game feel much worse. Arch Linux x64 32-bit wine prefix -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 Ivan Molodetskikh <yalterz(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yalterz(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 Ivan Molodetskikh <yalterz(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Hardware|x86 |x86-64 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 Ivan Molodetskikh <yalterz(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |directx-dsound --- Comment #1 from Ivan Molodetskikh <yalterz(a)gmail.com> --- Did regression testing, this seems to be the bad commit: 569ed159b0ab31121d9aab95bf1d3ac49675f1ca is the first bad commit commit 569ed159b0ab31121d9aab95bf1d3ac49675f1ca Author: Maarten Lankhorst <wine(a)mblankhorst.nl> Date: Thu May 12 08:43:23 2016 -0500 dsound: Use AudioClient buffer statistics. Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> :040000 040000 87546253bd4a401be4757d8f9b4ff4aaab80754d 31288b14ad6d14f9f7bcbf956613ff82a23b0d2a M dlls -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 Jeff Zaroyko <jeffz(a)jeffz.name> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, regression Regression SHA1| |569ed159b0ab31121d9aab95bf1 | |d3ac49675f1ca CC| |wine(a)mblankhorst.nl URL| |https://osu.ppy.sh/p/downlo | |ad -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aeikum(a)codeweavers.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #2 from Andrew Eikum <aeikum(a)codeweavers.com> --- Thanks for the report, Ivan. Could you attach a log showing the problem with the channels from <https://wiki.winehq.org/Sound>? Just a few seconds should be fine, the log will get large quickly. Also, please attach the diff you use when gathering the log. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #3 from Ivan Molodetskikh <yalterz(a)gmail.com> --- (In reply to Andrew Eikum from comment #2)
Also, please attach the diff you use when gathering the log.
What does "diff" mean here? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #4 from Andrew Eikum <aeikum(a)codeweavers.com> --- (In reply to Ivan Molodetskikh from comment #3)
(In reply to Andrew Eikum from comment #2)
Also, please attach the diff you use when gathering the log.
What does "diff" mean here?
The changes to winealsa that you are making. "git diff" should show you, if you haven't committed them. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #5 from Ivan Molodetskikh <yalterz(a)gmail.com> --- Created attachment 56647 --> https://bugs.winehq.org/attachment.cgi?id=56647 Wine log: good (crackling, no latency) The mmdevdrv.c values are set very low for good comparison. This produces severe crackling in the good version. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #6 from Ivan Molodetskikh <yalterz(a)gmail.com> --- Created attachment 56648 --> https://bugs.winehq.org/attachment.cgi?id=56648 Wine log: bad (no crackling, big latency) The mmdevdrv.c values are set very low for good comparison. This produces severe crackling in the good version. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #7 from Ivan Molodetskikh <yalterz(a)gmail.com> --- (In reply to Andrew Eikum from comment #2)
Thanks for the report, Ivan. Could you attach a log showing the problem with the channels from <https://wiki.winehq.org/Sound>? Just a few seconds should be fine, the log will get large quickly.
Also, please attach the diff you use when gathering the log.
Attached the logs. Here's the mmdevdrv.c patch I used: 56,58c56,58 < static const REFERENCE_TIME DefaultPeriod = 100000; < static const REFERENCE_TIME MinimumPeriod = 50000; < #define EXTRA_SAFE_RT 40000 ---
static const REFERENCE_TIME DefaultPeriod = 13000; static const REFERENCE_TIME MinimumPeriod = 13000; #define EXTRA_SAFE_RT 8000
Note that the values are set extremely low for good comparison which produces severe crackling in the good version. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #8 from Andrew Eikum <aeikum(a)codeweavers.com> --- Created attachment 56649 --> https://bugs.winehq.org/attachment.cgi?id=56649 dsound: Don't queue more than three periods Thanks, I think I see the problem. Can you try applying this patch on top of latest Wine and see if it helps? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #9 from Ivan Molodetskikh <yalterz(a)gmail.com> --- (In reply to Andrew Eikum from comment #8)
Created attachment 56649 [details] dsound: Don't queue more than three periods
Thanks, I think I see the problem. Can you try applying this patch on top of latest Wine and see if it helps?
It seems to have fixed the latency! And there's no crackling, too (even on even lower values than the ones I tested). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #10 from Andrew Eikum <aeikum(a)codeweavers.com> --- (In reply to Ivan Molodetskikh from comment #9)
(In reply to Andrew Eikum from comment #8)
Created attachment 56649 [details] dsound: Don't queue more than three periods
Thanks, I think I see the problem. Can you try applying this patch on top of latest Wine and see if it helps?
It seems to have fixed the latency! And there's no crackling, too (even on even lower values than the ones I tested).
So, just to be clear, that patch fixes this bug for you, right? I plan to send it, but I need to test it some more as it changes timing in dsound, which is a really fragile area. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #11 from Ivan Molodetskikh <yalterz(a)gmail.com> --- (In reply to Andrew Eikum from comment #10)
(In reply to Ivan Molodetskikh from comment #9)
(In reply to Andrew Eikum from comment #8)
Created attachment 56649 [details] dsound: Don't queue more than three periods
Thanks, I think I see the problem. Can you try applying this patch on top of latest Wine and see if it helps?
It seems to have fixed the latency! And there's no crackling, too (even on even lower values than the ones I tested).
So, just to be clear, that patch fixes this bug for you, right?
I plan to send it, but I need to test it some more as it changes timing in dsound, which is a really fragile area.
Yes, I've been playing osu! with this patch for the past 5 days and it works really well. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #12 from Ivan Molodetskikh <yalterz(a)gmail.com> --- (In reply to Andrew Eikum from comment #10)
(In reply to Ivan Molodetskikh from comment #9)
(In reply to Andrew Eikum from comment #8)
Created attachment 56649 [details] dsound: Don't queue more than three periods
Thanks, I think I see the problem. Can you try applying this patch on top of latest Wine and see if it helps?
It seems to have fixed the latency! And there's no crackling, too (even on even lower values than the ones I tested).
So, just to be clear, that patch fixes this bug for you, right?
I plan to send it, but I need to test it some more as it changes timing in dsound, which is a really fragile area.
I also tried measuring audio latency and it seemed to be about the same as the good 1.9.9 version. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 fjfrackiewicz(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fjfrackiewicz(a)gmail.com --- Comment #13 from fjfrackiewicz(a)gmail.com --- Looks like the patch got committed: http://source.winehq.org/git/wine.git/commit/0190c50a8ca14e21355befc212b60f6... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #14 from Andrew Eikum <aeikum(a)codeweavers.com> --- Yup. If you have a minute, Ivan, please test the latest wine-git or Wine 2.0-rc4 when it's released and confirm it's fixed for you. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 --- Comment #15 from Ivan Molodetskikh <yalterz(a)gmail.com> --- (In reply to Andrew Eikum from comment #14)
Yup. If you have a minute, Ivan, please test the latest wine-git or Wine 2.0-rc4 when it's released and confirm it's fixed for you.
Tried dsound & mmdevdrv from latest git (da5a0b76117f938aaeca3471ed69c5e50b73c19c) ontop of 2.0-rc3 (so I don't have to compile everything else (that's also how I tested before)), works fine. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 winetest(a)luukku.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest(a)luukku.com --- Comment #16 from winetest(a)luukku.com --- (In reply to Ivan Molodetskikh from comment #15)
(In reply to Andrew Eikum from comment #14)
Yup. If you have a minute, Ivan, please test the latest wine-git or Wine 2.0-rc4 when it's released and confirm it's fixed for you.
Tried dsound & mmdevdrv from latest git (da5a0b76117f938aaeca3471ed69c5e50b73c19c) ontop of 2.0-rc3 (so I don't have to compile everything else (that's also how I tested before)), works fine.
Since you are the original author of this bug report, could you solve this as fixed? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 Ivan Molodetskikh <yalterz(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED --- Comment #17 from Ivan Molodetskikh <yalterz(a)gmail.com> --- (In reply to winetest from comment #16)
(In reply to Ivan Molodetskikh from comment #15)
(In reply to Andrew Eikum from comment #14)
Yup. If you have a minute, Ivan, please test the latest wine-git or Wine 2.0-rc4 when it's released and confirm it's fixed for you.
Tried dsound & mmdevdrv from latest git (da5a0b76117f938aaeca3471ed69c5e50b73c19c) ontop of 2.0-rc3 (so I don't have to compile everything else (that's also how I tested before)), works fine.
Since you are the original author of this bug report, could you solve this as fixed?
Sure. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 Andrew Eikum <aeikum(a)codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |0190c50a8ca14e21355befc212b | |60f6409594aec --- Comment #18 from Andrew Eikum <aeikum(a)codeweavers.com> --- Thanks a lot, Ivan! Glad we got this resolved for 2.0 :) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42074 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #19 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 2.0-rc4. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org