From e746f665ef61448ac3fe19c4ef53a29425b9ccc0 Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Wed, 21 Mar 2001 03:37:33 +0000 Subject: [PATCH] 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). --- dlls/winmm/wineoss/audio.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/winmm/wineoss/audio.c b/dlls/winmm/wineoss/audio.c index 67bcfb34956..2be8ea7c252 100644 --- a/dlls/winmm/wineoss/audio.c +++ b/dlls/winmm/wineoss/audio.c @@ -865,11 +865,17 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) /* 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 @@ static HRESULT WINAPI IDsDriverBufferImpl_Stop(PIDSDRIVERBUFFER iface) 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 =