https://bugs.winehq.org/show_bug.cgi?id=46104
Bug ID: 46104 Summary: winepulse-PulseAudio_Support patch cause application to hang with native dsound.dll Product: Wine-staging Version: 3.13 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: lorenzofer@live.it CC: leslie_alistair@hotmail.com, z.figura12@gmail.com Distribution: ---
Hi. Recently I wanted to play to some old games that were using DirectMusic. In particular "Imperivm Great Battles of Rome" So following the procedures I installed the directmusic component and the native dsound.dll
However when I tried the game I was encountered by an hanged application. (the application opened it's window and rendered the cursor, but nothing else) I was on wine-staging as I have some games that require staging patches.
However as I recalled this game worked before, so I tried vanilla wine. It worked almost flawless (encountering bug Bug 44540 with quartz.dll as native).
Then I tried with older wine-staging version. I started with the wine-staging 3.3 that was the older one in my pacman package cache, and worked flawless.
I then discovered that the first bad wine-staging release is the 3.13 release.
After checking the patch modified between the 3.12 and 3.13 releases, I found that if I compile wine-staging from source without applying the winepulse-PulseAudio_Support the issue disappears.
Unfortunatly Imperivm GBR doesn't have an aviable demo, but recently an udated version was released on steam, and you can ask for a key at FX Interactive for free. Check the FAQ in the Imperium World forum on Discord.
Normal Log is totally unhelpful as the only thing it give is a: 0009:fixme:thread:create_user_shared_data_thread Creating user shared data update thread.
Two others affected application are: Rise of Nation Rise of Nation Throne and Patriots
Others bug associated with winepulse-PulseAudio_Support and 3.13 Release (potentially not duplicates): Bug 45582 - Bug 45623 - Bug 45502
https://bugs.winehq.org/show_bug.cgi?id=46104
--- Comment #1 from Lorenzo Ferrillo lorenzofer@live.it --- Created attachment 62736 --> https://bugs.winehq.org/attachment.cgi?id=62736 Log with WINEDEBUG=+pulse
https://bugs.winehq.org/show_bug.cgi?id=46104
--- Comment #2 from Lorenzo Ferrillo lorenzofer@live.it --- Created attachment 62750 --> https://bugs.winehq.org/attachment.cgi?id=62750 Log with WINEDEBUG=+pulse and patchset disabled on 3.19
https://bugs.winehq.org/show_bug.cgi?id=46104
Lorenzo Ferrillo lorenzofer@live.it changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |aeikum@codeweavers.com
--- Comment #3 from Lorenzo Ferrillo lorenzofer@live.it --- Partially unsurprisingly, the offending subpatch is: [PATCH 2/7] winepulse: Don't rely on pulseaudio callbacks for timing
https://bugs.winehq.org/show_bug.cgi?id=46104
--- Comment #4 from Andrew Eikum aeikum@codeweavers.com --- Thanks. There are some additional patches on Bug 45623, but there are still some known issues. I'm hoping to have time to work on this again soon. Following that bug will be the best way to get updates on this.
https://bugs.winehq.org/show_bug.cgi?id=46104
--- Comment #5 from Lorenzo Ferrillo lorenzofer@live.it --- Created attachment 62761 --> https://bugs.winehq.org/attachment.cgi?id=62761 Tentative patch
Ok, I was able to investigate more. Native dsound.dll request a Buffer (using AudioRenderClient_GetBuffer) with NumFramesRequested 2. After writing to it, it's released. This is were things start to differ. Without the patchset then dsound request againg the position, and the AudioClock_GetPosition return 4. Then the audio stream is stopped, and the game that is using dsound start the video playback. This seems actually consistent with the MSDN specifications.
With the patchset instead, AudioClock_GetPosition it's returing 0 even after having requested and released a buffer with NumFramesRequested 2.
The issue seems the fact that in the AudioClock_GetPosition if the current position (getted from the current_clock var subtracted by the held_bytes), is setted to 0 if the position is minor then the period.
I attached a patch that allow callers to see the actual stream position, in this case. I run the mmdevapi testcase for render and it succeed. With this patch applyied the game start and it's almost playable, but there is a bit of cracking sound from Bug 45623, and also the audio seems to be a little late for one second (But this seem to be present also without the entire winepulse-PulseAudio_Support, even if a lesser way).
I'm wondering what's the rationale between setting *pos to 0 in that case.
https://bugs.winehq.org/show_bug.cgi?id=46104
--- Comment #6 from Andrew Eikum aeikum@codeweavers.com --- I'm wondering if we can just remove that entire if-block of pretending to absorb a period. I'll play around with this idea a bit.
https://bugs.winehq.org/show_bug.cgi?id=46104
--- Comment #7 from Andrew Eikum aeikum@codeweavers.com --- Lorenzo, I attached a patchset including remove that if block entirely onto Bug 45623. Please give it a shot.
https://bugs.winehq.org/show_bug.cgi?id=46104
--- Comment #8 from Lorenzo Ferrillo lorenzofer@live.it --- (In reply to Andrew Eikum from comment #7)
Lorenzo, I attached a patchset including remove that if block entirely onto Bug 45623. Please give it a shot.
Sorry for the delay.
The issue is solved
https://bugs.winehq.org/show_bug.cgi?id=46104
Sergey Isakov isakov-sl@bk.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |isakov-sl@bk.ru
--- Comment #9 from Sergey Isakov isakov-sl@bk.ru --- I am macOS user and don't use Pulse audio. Applying staging patchset I didn't avoid the patch even though i commented it out from the patchinstall.sh script. The sound absent. Should I remove the folder winepulse.drv or there are more dependencies somewhere?
https://bugs.winehq.org/show_bug.cgi?id=46104
--- Comment #10 from Sergey Isakov isakov-sl@bk.ru --- OK,I am not sure what is the reason of my bug. Now I removew the driver and I have sound. Not sure if related.
https://bugs.winehq.org/show_bug.cgi?id=46104
Lorenzo Ferrillo lorenzofer@live.it changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #11 from Lorenzo Ferrillo lorenzofer@live.it --- Sergey yours is a totally different issue.
This issue is actually fixed in recent wine-stagings
https://bugs.winehq.org/show_bug.cgi?id=46104
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing Fixed Staging bugs.