Sound delay on WinXP && MinGW

Hi,

I’m trying to compile a small game I wrote on my linux box on windows xp
using mingw and msys. I got every dependency to compile fine (SDL 1.2.7,
smpeg 0.4.4, SDL_mixer 1.2.5, libogg 1.1 and libvorbis 1.0.1), however I
have a problem with the audio output under windows xp: the sound is
delayed for about half a second.

Although I’m using SDL_mixer I think it’s a problem related to SDL +
MinGW because if I copy in the precompiled sdl.dll from libsdl.org
(which as far as I know is not compiled using mingw) the problem
disappears! However those procompiled dlls don’t really help me because
the precompiled smpeg.dll seems to have problems with the precompiled
sdl.dll (black screen on videos).

There was a similar report in the past
(http://twomix.devolution.com/pipermail/sdl/2004-June/062942.html) but
the suggestion that the problem was fixed in SDL>1.2.6 doesn’t seem to
be true. I even tried the cvs version of SDL+SDL_mixer but it doesn’t
solve this either.

My problem should easily be reproducable, I only installed the following
packages:

  • MSYS-1.0.11-2004.04.30-1.exe
  • MinGW-3.1.0-1.exe
  • msysDTK-1.0.1.exe
    Just try to compile SDL and then any audio example on that.

I hope someone can help me with this, as it’s working absolutly awesome
under linux and I’d hate to redo the whole audio part to use a different
library than SDL for audio.–
Bye,
Michael Prager

THe MingW version may be using WaveOut, where the VC version may be
using DirectSound. SDL’s WaveOut implementation enforces 250ms buffering.
I’ve found that at 44.1khz, an 8k frame buffer is needed, which is
about 185ms. DirectSound doesn’t need as much–2k usually works fine.
WaveOut should only ever be used as a compatibility, fallback interface.On Sat, Sep 11, 2004 at 01:59:02AM +0200, Michael Prager wrote:

Although I’m using SDL_mixer I think it’s a problem related to SDL +
MinGW because if I copy in the precompiled sdl.dll from libsdl.org
(which as far as I know is not compiled using mingw) the problem
disappears! However those procompiled dlls don’t really help me because
the precompiled smpeg.dll seems to have problems with the precompiled
sdl.dll (black screen on videos).


Glenn Maynard

Wow thx, that helped a lot :slight_smile:

Never realized that there was a check for directx headers when compiling
SDL. After a couple of hours I figured out that I had to use the headers
from http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz,
recompiled SDL with directX support and now the sound is playing nicely.

I’m however running into a different problem now. In fact, it’s the same
problem I get when using the precompiled dlls: smpeg doesn’t display
anything anymore. Neiter the code in my app nor the plaympeg example
supplied with smpeg have a graphical output anymore, just a black screen.

any ideas?–
bye,
Michael Prager

Glenn Maynard wrote:

On Sat, Sep 11, 2004 at 01:59:02AM +0200, Michael Prager wrote:

Although I’m using SDL_mixer I think it’s a problem related to SDL +
MinGW because if I copy in the precompiled sdl.dll from libsdl.org
(which as far as I know is not compiled using mingw) the problem
disappears! However those procompiled dlls don’t really help me because
the precompiled smpeg.dll seems to have problems with the precompiled
sdl.dll (black screen on videos).

THe MingW version may be using WaveOut, where the VC version may be
using DirectSound. SDL’s WaveOut implementation enforces 250ms buffering.
I’ve found that at 44.1khz, an 8k frame buffer is needed, which is
about 185ms. DirectSound doesn’t need as much–2k usually works fine.
WaveOut should only ever be used as a compatibility, fallback interface.

Finally figured out why smpeg is broken using SDL 1.2.7 under Windows:
Smpeg seems to use DirectX overlay which however has been turned of
since 1.2.7 by default. A simple

export CFLAGS="$CFLAGS -DUSE_DIRECTX_OVERLAY" && ./configure
make
make install

did the trick for me. Hope that helps all those guys out there who want
to make use of this great library :-)–
Bye,
Michael Prager

Michael Prager wrote:

Wow thx, that helped a lot :slight_smile:

Never realized that there was a check for directx headers when
compiling SDL. After a couple of hours I figured out that I had to use
the headers from
http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz,
recompiled SDL with directX support and now the sound is playing nicely.

I’m however running into a different problem now. In fact, it’s the
same problem I get when using the precompiled dlls: smpeg doesn’t
display anything anymore. Neiter the code in my app nor the plaympeg
example supplied with smpeg have a graphical output anymore, just a
black screen.

any ideas?


bye,
Michael Prager

Glenn Maynard wrote:

On Sat, Sep 11, 2004 at 01:59:02AM +0200, Michael Prager wrote:

Although I’m using SDL_mixer I think it’s a problem related to SDL +
MinGW because if I copy in the precompiled sdl.dll from libsdl.org
(which as far as I know is not compiled using mingw) the problem
disappears! However those procompiled dlls don’t really help me
because the precompiled smpeg.dll seems to have problems with the
precompiled sdl.dll (black screen on videos).

THe MingW version may be using WaveOut, where the VC version may be
using DirectSound. SDL’s WaveOut implementation enforces 250ms
buffering.
I’ve found that at 44.1khz, an 8k frame buffer is needed, which is
about 185ms. DirectSound doesn’t need as much–2k usually works fine.
WaveOut should only ever be used as a compatibility, fallback interface.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl