RE: [GD-Windows] Streaming WAVE audio
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2004-07-14 15:49:44
|
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: gam...@li... [mailto:gam...@li...]On Behalf Of Brian Hook Sent: Wednesday, July 14, 2004 7:37 AM To: gam...@li... 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 Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU5 |