Problem with Soundblaster Live and Wine

Francois Gouget fgouget at
Tue Jun 22 13:04:38 CDT 2004


Constantin Bergemann wrote:
> Hi,
> I have a problem with my Soundblaster Live and Wine. When running Windows 
> Applications, they often set the mixer level for the PCM channel to 100%. 
> However, the Soundblaster Live under Linux tends to sound a bit dirty at 
> these levels, you have to use values under 80%.
> Is there anything I can do to tell wine to let this value unchanged? I am 
> using ALSA and the OSS module of wine. Is anyone even aware of this problem?

This is most likely caused by DirectSound. Currently calling 
DirectSoundCreate() has the side-effect of setting the sound volume to 
100%. In fact anything that causes the creating of a primary buffer does 
that so that some applications repeteadly reset the volume to 100% which 
is very annoying.

Based on my test it's also wrong. On Windows starting a DirectSound 
application does not change the volume. One way to verify this is with 
the DirectSound regression test. Do:

dsound_crosstest.exe dsound

This should play the test tones at the current volume. When the same 
test is run in Wine it first sets the volume to the max and then plays 
the tones.

The attached hack should fix this problem but probably not in the right 
way. I'm not sure of the exact Windows behavior. I believe it just 
initializes the DirectSound volume to whatever is the current volume. 
That means we should query the current volume from wineoss and set it 
that way. We should really add a trace in the dsound test to make it 
possible to test that theory.

Francois Gouget
fgouget at

-------------- next part --------------
Index: dlls/dsound/primary.c
RCS file: /var/cvs/wine/dlls/dsound/primary.c,v
retrieving revision 1.23
diff -u -r1.23 primary.c
--- a/dlls/dsound/primary.c	13 Feb 2004 20:22:02 -0000	1.23
+++ b/dlls/dsound/primary.c	20 May 2004 14:28:55 -0000
@@ -74,8 +74,6 @@
 	HRESULT err = DS_OK;
-	DSOUND_RecalcVolPan(&(This->volpan));
 	/* are we using waveOut stuff? */
 	if (!This->driver) {
 		LPBYTE newbuf;
@@ -135,11 +133,6 @@
 		if ((err == DS_OK) && (merr != DS_OK))
 			err = merr;
-		if (!err) {
-			DWORD vol = (This->volpan.dwTotalLeftAmpFactor & 0xffff) | (This->volpan.dwTotalRightAmpFactor << 16);
-			err = mmErr(waveOutSetVolume(This->hwo, vol));
-		}
 	} else {
 		if (!This->hwbuf) {
 			err = IDsDriver_CreateSoundBuffer(This->driver,&(This->wfx),
@@ -154,7 +147,6 @@
 			if (dsound->state == STATE_PLAYING) dsound->state = STATE_STARTING;
 			else if (dsound->state == STATE_STOPPING) dsound->state = STATE_STOPPED;
-		err = IDsDriverBuffer_SetVolumePan(This->hwbuf, &(This->volpan));
 	return err;

More information about the wine-devel mailing list