wineoss patch
Ove Kaaven
ovehk at ping.uio.no
Tue Mar 20 03:19:54 CST 2001
Many OSS drivers cannot pause playback once mmap-ed for direct access, so
the device has to unmapped, closed, then reopened and re-mapped, in order
to stop/pause the playback. Since the dsound layer is now able to handle
that, let's make it so (and detect failure to set small fragment sizes
while we're at it).
Log:
Ove Kaaven <ovek at transgaming.com>
Show an error if small enough fragment sizes couldn't be set.
Force a complete close/reopen of the sound device if pause is requested in
DirectSound mode (many drivers require this).
Index: dlls/winmm/wineoss/audio.c
===================================================================
RCS file: /cvsroot/winex/wine/dlls/winmm/wineoss/audio.c,v
retrieving revision 1.1.1.11
retrieving revision 1.11
diff -u -r1.1.1.11 -r1.11
--- dlls/winmm/wineoss/audio.c 2001/03/02 11:33:54 1.1.1.11
+++ dlls/winmm/wineoss/audio.c 2001/03/02 11:44:57 1.11
@@ -865,11 +865,17 @@
/* even if we set fragment size above, read it again, just in case */
IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, fragment_size);
if (fragment_size == -1) {
- WARN("IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n");
+ ERR("IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n");
close(audio);
wwo->unixdev = -1;
return MMSYSERR_NOTENABLED;
}
+ if ((fragment_size > 1024) && (LOWORD(audio_fragment) <= 10)) {
+ /* we've tried to set 1K fragments or less, but it didn't work */
+ ERR("fragment size set failed, size is now %d\n", fragment_size);
+ MESSAGE("Your Open Sound System driver did not let us configure small enough sound fragments.\n");
+ MESSAGE("This may cause delays and other problems in audio playback with certain applications.\n");
+ }
wwo->dwFragmentSize = fragment_size;
wwo->msg_toget = 0;
@@ -1470,7 +1476,11 @@
return DSERR_GENERIC;
}
#endif
- return DS_OK;
+ /* Most OSS drivers just can't stop the playback without closing the device...
+ * so we need to somehow signal to our DirectSound implementation
+ * that it should completely recreate this HW buffer...
+ * this unexpected error code should do the trick... */
+ return DSERR_BUFFERLOST;
}
static ICOM_VTABLE(IDsDriverBuffer) dsdbvt =
More information about the wine-patches
mailing list