On Fri, 2005-18-03 at 08:24 -0700, Hans Fugal wrote:
I'm writing an application that will use alsa in
the common case, but be
jack-capable. I'm faced with the following design question: Do I wrap
the jack part to emulate the read/write of alsa, or do I wrap the alsa
part to emulate the callback style of jack? In other words, do I push or
pull from the audio segment of the program?
As I understand it, alsa can be asynchronous but it requires using SIGIO
which doesn't excite me. So I'd have to create another thread that
selects and fills a ringbuffer.
To adapt jack, I'd have a ringbuffer which is drained when the program
pulls the audio.
Adapting Jack seems the easier thing to do, but what do you think?
Definitely write everything as a "pulling" callback-based system, and
wrap that for alsa. A callback is simple to wrap in a blocking system,
but the other way around just doesn't work (certainly not with jack's RT