Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:5617] asio/coreaudio code for full duplex on single device

Date2005-01-02 19:34
FromVictor Lazzarini
Subject[CSOUND-DEV:5617] asio/coreaudio code for full duplex on single device
Attachmentspa_blocking.h  pa_blocking.c  libsnd.c  rtpa.c  
Here's the asio/coreaudio code for full-duplex on
a single device, thanks to one of these wonders of
new technology, an USB keyring memory!

Anyway, as I said before, I have not tested this
with ASIO, but it works with coreaudio, so I suppose
it will do so. Can anyone please test it (Michael?)?

Here's the list of attached files and what was added to
them:

libsnd.c: just added a __MACH__ ifdef, so that we can say
-iadc1 or -idevaudio1 in the command line
(before it tried to look for a file instead of opening 
the device) on OS X, as in the other platforms

pa_blocking.h/.c: added a new device opening
function, to open it full-duplex, one-streaam only.
Added the callback to handle input and output.
Commented out call to Pa_AbortStream() on
OS X in the device close function. 

rtpa.c: added code to call the new device opening
function, if the user tries to open the same 
device number (except -odac -iadc, the default
devices).

What needs to be done now: incorporate John Ffitch's
'intermediary buffer' fix for OS X in the
full-duplex call back (if necessary, it might not need
any change).

See what's really the matter with Pa_AbortStream(),
and see if it can be fixed. One of the error messages
I get when exiting csound with that function commented out
comes from csoundPerformKsmps(),
which is really odd, as it prints first the message
'score finished...', so it should actually not be called
again. Anyway, perhaps John Ff might have a better
idea about it.

All the best,

Victor