[PATCH] dsound: Tune some variables for pulseaudio

Maarten Lankhorst m.b.lankhorst at gmail.com
Mon Aug 18 14:00:26 CDT 2008


It works *slightly* better with pulseaudio now, still not the way I would like it to be, though.
---
 dlls/dsound/capture.c     |    2 +-
 dlls/dsound/dsound_main.c |    6 +++---
 dlls/dsound/primary.c     |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c
index c9444a4..7cf7b83 100644
--- a/dlls/dsound/capture.c
+++ b/dlls/dsound/capture.c
@@ -1140,7 +1140,7 @@ IDirectSoundCaptureBufferImpl_Start(
 
         if (device->buffer) {
             int c;
-            DWORD blocksize = DSOUND_fraglen(device->pwfx->nSamplesPerSec, device->pwfx->nBlockAlign);
+            DWORD blocksize = 4 * DSOUND_fraglen(device->pwfx->nSamplesPerSec, device->pwfx->nBlockAlign);
             device->nrofpwaves = device->buflen / blocksize + !!(device->buflen % blocksize);
             TRACE("nrofpwaves=%d\n", device->nrofpwaves);
 
diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c
index 31078cb..dddcf28 100644
--- a/dlls/dsound/dsound_main.c
+++ b/dlls/dsound/dsound_main.c
@@ -90,9 +90,9 @@ HRESULT mmErr(UINT err)
 
 /* All default settings, you most likely don't want to touch these, see wiki on UsefulRegistryKeys */
 int ds_emuldriver = 0;
-int ds_hel_buflen = 32768;
-int ds_snd_queue_max = 10;
-int ds_snd_queue_min = 6;
+int ds_hel_buflen = 32768 * 2;
+int ds_snd_queue_max = 20;
+int ds_snd_queue_min = 14;
 int ds_snd_shadow_maxsize = 2;
 int ds_hw_accel = DS_HW_ACCEL_FULL;
 int ds_default_playback = 0;
diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c
index 112bb39..7ad561f 100644
--- a/dlls/dsound/primary.c
+++ b/dlls/dsound/primary.c
@@ -46,13 +46,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound);
  */
 DWORD DSOUND_fraglen(DWORD nSamplesPerSec, DWORD nBlockAlign)
 {
-    DWORD fraglen = 512 * nBlockAlign;
+    DWORD fraglen = 256 * nBlockAlign;
 
     /* Compensate for only being roughly accurate */
     if (nSamplesPerSec <= 26000)
         fraglen /= 2;
 
-    if (nSamplesPerSec <= 12000)
+    if (nSamplesPerSec <= 10000)
         fraglen /= 2;
 
     if (nSamplesPerSec >= 80000)
-- 
1.5.6.3


--------------060608080502000709000906--



More information about the wine-patches mailing list