Low-latency audio?

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?

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 :frowning:

– Timo Suoranta – @Timo_K_Suoranta

Hi All!

I’ve discovered that probably the RH RPMs are not working properly on some
machines (I face two from 5 machines I’ve met until now). I’ve been
playing with the CVS SDL12/configure file and after I commented out the
USE_ASMBLIT directive definition I finaly got SDL working.
I’ve the suspicion that it is caused by RH gcc 2.96, but I don’t have it
confirmed. Is it know issue or not? Do you compile the www.libsdl.org/RPMs
with gcc 2.96? Would the USE_ASMBLIT commenting out noticable performance
slowdown? Do you know anybody about this bug?

regards

STan

---------------------- Cut ------------------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1026 (LWP 1026)]
0x4005efd3 in _Hermes_X86_CPU () at eval.c:41
41 eval.c: No such file or directory.
in eval.c
(gdb) bt
#0 0x4005efd3 in _Hermes_X86_CPU () at eval.c:41
#1 0x00000084 in __strtol_internal (nptr=0x8216fa0 “”, endptr=0x0,
base=136408312, group=1073934622) at eval.c:73
#2 0x4002f2bd in SDL_CalculateBlit () at eval.c:41
#3 0x400416ad in SDL_MapSurface () at eval.c:41
#4 0x40041d63 in SDL_LowerBlit () at eval.c:41
#5 0x400442dd in SDL_UpdateRects () at eval.c:41
#6 0x4004416d in SDL_UpdateRect () at eval.c:41
(gdb)

Standa Opichal wrote:

I’ve discovered that probably the RH RPMs are not working properly on some
machines (I face two from 5 machines I’ve met until now). I’ve been
playing with the CVS SDL12/configure file and after I commented out the
USE_ASMBLIT directive definition I finaly got SDL working.

This is likely the problem I had with SDL built with NASM 0.98
(the redhat-packaged NASM). Either build without the asm routines
or get a new nasm (0.98.08 seems to work)

(I wrote about the bug on this list a couple of days ago, so this should
not come as a surprise)

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 :frowning:

Hey, AmigaDOS was a microkernel, almost an RTOS, and you could even
bypass it entirely! :slight_smile: 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 -’

Hey, AmigaDOS was a microkernel, almost an RTOS, and you could even
bypass it entirely! :slight_smile: 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)

Yeah =D–
Trick


Linux User #229006 * http://counter.li.org