[PATCH 1/2] winepulse.drv: Make timer thread time-critical.

Torge Matthies openglfreak at googlemail.com
Fri Mar 5 19:27:13 CST 2021


Signed-off-by: Torge Matthies <openglfreak at googlemail.com>
---
These two patches help applications that need very low audio latency.
They make sense individually, but are related so I'm sending them as one set.

This first patch does nothing on vanilla Wine, but helps on Wine Staging and
other patched Wine versions.

 dlls/winepulse.drv/mmdevdrv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c
index 417067f0bf8..4609b2851ed 100644
--- a/dlls/winepulse.drv/mmdevdrv.c
+++ b/dlls/winepulse.drv/mmdevdrv.c
@@ -2045,8 +2045,10 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface)
         This->started = TRUE;
         This->just_started = TRUE;
 
-        if(!This->timer)
+        if(!This->timer) {
             This->timer = CreateThread(NULL, 0, pulse_timer_cb, This, 0, NULL);
+            SetThreadPriority(This->timer, THREAD_PRIORITY_TIME_CRITICAL);
+        }
     }
     pthread_mutex_unlock(&pulse_lock);
     return hr;
-- 
2.30.1




More information about the wine-devel mailing list