RE: Streaming WAVE audio

"Jon Watte" <[email protected]>
Newsgroups gmane.games.devel.windows
Message-ID <[email protected]>
This is one of the few reasons to have a second thread in your application,
in my opinion. If you set your process priority to above normal, and the
thread priority to real time (permissions willing), then you can get 20 ms
latency on NT based kernels, and 50 ms or so on DOS based kernels. This is
with three buffers, each of which is 20 milliseconds.

Communication of sound events to the sound playing thread can be done using
a non-blocking queue, so you interlock penalties need apply. Adding
interlock would be dangerous, anyway, as you would be subject to priority
inversion.

Cheers,

			/ h+


-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of
Brian Hook
Sent: Wednesday, July 14, 2004 7:37 AM
To: [email protected]
Subject: RE: [GD-Windows] Streaming WAVE audio


As it turns out I ended up going with many multiple small buffers and
using an event to do the mixing, which is the ickiest way (the old
method was really elegant -- sleep/wake/read position/write/sleep).

The granularity for notifications absolutely sucks.  I'll get signaled
and sometimes find 0, 1, or N buffers waiting to be filled.  I ended
up going with 8 small buffers instead of 1 large buffer, and now it
seems reasonably robust but I can't get my latency much below 50ms (if
that) without having it crackle, whereas with my old code I think I
could go below 40ms (since it wasn't dependent on being signaled by
the sound backend).

Thanks,

Brian





-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU5



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=555
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.