I’ve no idea, but I think SDL has been using shared buffer style I/O on
some targets for a good while - which means that most of the low level
work is already done.
However, an API extension would be required, as “zero latency mixing” is
done in a pretty different way to the normal method. Something like:
/* Get info on the circular hardware audio buffer */
SDL_AudioSpec *SDL_GetAudioBuffer();
/* Get current audio output positionOn Monday 15 October 2001 13:18, Timo K Suoranta wrote:
What is the current situation of low-latency audio driver
support in SDL? Will there be such thing in 1.3, or do I
need to wait for 2.x? Or have miracles happened and is
it already available?
*
* Start mixing low latency sound events slightly
* ahead of this position, and it will be played
* with practically no latency. Don't start right
* *at* this position, as that will cause the first
* few samples to be lost - how many depends on
* driver, OS, hardware and CPU speed.
*/
int SDL_GetAudioPlayPosition();
/* Get current audio clalback mixing position
*
* The old style callback writes it's data in
* front of this position, and then bumps it
* forward. Don't mix ahead beyond this position,
* or you data will be overwritten!
*/
int SDL_GetAudioMixPosition();
Obviously, using this API, you lose automatic format and rate conversion,
as you’re dealing directly with the hardware DMA buffer. As to systems
without this kind of audio API, the SDL_GetAudioBuffer() call should
return NULL, IMHO - it could be emulated, but that would result in
worse performance than the current API when done on this level.
When I used Amiga, audio latency was not an issue. Now
that I have otherwise superior setup, it seems that audio
drivers have made progress backwards
Hey, AmigaDOS was a microkernel, almost an RTOS, and you could even
bypass it entirely! Not a fair comparison - although I do agree that
some things are much worse these days, despite hundreds of times more
power. (In fact, some things are so bad you can hardly tell that a P-III
933 really is faster than an Amiga… What good is 800 fps rendering
power without retrace sync, for example? Still looks like crap - even a
C64 can do better. heh)
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -’