Since apparantly counter strike goes 2 fps or so when alsa is used and capture is enabled, I was looking to see if that can be speed up,.
Since I don't have that game I cannot do it myself, so can someone test attached patch and see if that fixes performance problems?
Maarten
From 7593fcf19ba306d0024048e7a49e87b7c8d5c318 Mon Sep 17 00:00:00 2001
From: Maarten Lankhorst m.b.lankhorst@gmail.com Date: Thu, 5 Jul 2007 00:41:59 +0200 Subject: [PATCH] winealsa: Increase performance of wavein getposition
--- dlls/winealsa.drv/wavein.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/dlls/winealsa.drv/wavein.c b/dlls/winealsa.drv/wavein.c index 5d731eb..412edd2 100644 --- a/dlls/winealsa.drv/wavein.c +++ b/dlls/winealsa.drv/wavein.c @@ -154,7 +154,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) DWORD frames_per_period;
wwi->state = WINE_WS_STOPPED; - wwi->dwTotalRecorded = 0; + InterlockedExchange((LONG*)&wwi->dwTotalRecorded, 0); wwi->lpQueuePtr = NULL;
SetEvent(wwi->hStartUpEvent); @@ -198,7 +198,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) { /* update number of bytes recorded in current buffer and by this device */ lpWaveHdr->dwBytesRecorded += bytesRead; - wwi->dwTotalRecorded += bytesRead; + InterlockedExchangeAdd((LONG*)&wwi->dwTotalRecorded, bytesRead);
/* buffer is full. notify client */ if (lpWaveHdr->dwBytesRecorded == lpWaveHdr->dwBufferLength) @@ -247,7 +247,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
/* update number of bytes recorded in current buffer and by this device */ lpWaveHdr->dwBytesRecorded += dwToCopy; - wwi->dwTotalRecorded += dwToCopy; + InterlockedExchangeAdd((LONG*)&wwi->dwTotalRecorded, dwToCopy); bytesRead -= dwToCopy; pOffset += dwToCopy;
@@ -385,10 +385,6 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) HeapFree(GetProcessHeap(), 0, buffer); ExitThread(0); /* shouldn't go here */ - case WINE_WM_UPDATE: - SetEvent(ev); - break; - default: FIXME("unknown message %d\n", msg); break; @@ -784,8 +780,6 @@ static DWORD widGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) }
wwi = &WInDev[wDevID]; - ALSA_AddRingMessage(&wwi->msgRing, WINE_WM_UPDATE, 0, TRUE); - return ALSA_bytes_to_mmtime(lpTime, wwi->dwTotalRecorded, &wwi->format); }
Maarten Lankhorst wrote:
Since apparantly counter strike goes 2 fps or so when alsa is used and capture is enabled, I was looking to see if that can be speed up,.
Since I don't have that game I cannot do it myself, so can someone test attached patch and see if that fixes performance problems?
Current GIT is much worse then wine-0.9.40. And this patch makes absolutely no difference.
To test, start CS:S and hover over the menu, you should hear clicks. This works fine with 0.9.40, doesn't work at all with GIT. Then go into options menu, this is when DS Capture is being initialized. Everything gets really really slow. And stays this slow until you exit CS:S. This is a bit of improvement over few versions back when things just froze.
Vitaliy
As I don't have that game, can you e-mail me a WINEDEBUG=+wave,+dsound log? The problem is probably somewhere else then. There should probably be a small performance hit, but nothing to the extent that currently happens.