| It works!
[Michael, you see, I had modified PaBlockingRead() to take in the number of
samples
in the csound buffer and use pabs->currentIndex to see if it was full, but
forgot
to use currentIndex as the pabs->actualBuffer index.]
OK: I have the full-duplex audio solution for OS X, now I need a way of
calling the right code (I have it hard-coded at the moment). The problem is
that:
1. on linux and non-ASIO windows, we generally open the device separately.
On MME/WDM
windows specifically the same logic device *cannot* be open for both read
and write.
2. on CoreAudio and ASIO, you have to open it only once for read and write,
this is
the only way of getting full-duplex
3. We also want to give the user the option to read from one device and
write to
another (possibly?)
Solutions(?):
(a) add an extra interface; we have recopen() and playopen(), so we
add a recplayopen() to deal with full-duplex on a single device. This would be
called only when the same portaudio device is selected for In & Out (or
CoreAudio device or ASIO, if we decide to write dedicated plugins, but
at the moment Michael's paBlocking.c & portaudio are working OK).
(b) always open it full-duplex when opening it for reading, checking then
if the selected portaudio device is the same, so to call the write code.
At the moment, as I said, I have added a paBlockingReadWriteOpen() and
a paBlockingReadWriteStreamCallback() to pa_blocking.c and I have
hard-coded rtpa.c to call only the former. The code works with the
paBlockignWrite() as is and with a new version of paBlockingRead() that
is a mirror of the Write() function.
So, we now need to decide what to do. I expect that the CoreAudio solution
should work with ASIO as well (but haven't tested).
Let me know what you think, please!
Victor
PS.: still a couple of little things are funny, if you don't use the input
signal in your instrument, then the output gets lots of dropouts, but
I'd say we can iron those problems out.
At 16:50 27/04/2005, you wrote:
>In fact, I had my locks mixed, stupid me, now I have it working with the
>locks, but
>there are regular dropouts in the input signal, but a synthesised signal
>output at the same time is OK. I'm keeping at it.
>
>Victor
>At 15:16 27/04/2005, you wrote:
>>Why wouldn't it work in Csound? The locks are used to simulate blocking.
>>Without the locks, the driver should call csoundPerformKsmps as many
>>times as required to fill the buffer; if the buffer sizes don't go into
>>each other evenly, double-buffering is required, but if they are even it
>>shouldn't be necessary.
>>
>>-----Original Message-----
>>From: Victor Lazzarini
>>Sent: Apr 27, 2005 4:25 AM
>>To: csound-devel@lists.sourceforge.net
>>Subject: Re: [Cs-dev] OSX build report
>>
>>I managed to do some full-duplex tests with a hacked rtpa.c and
>>pablocking.c; I got
>>audio in and out, as I expected, but there's a problem with the locks which
>>I have not
>>identified yet. I had to comment them out, which of course gave me regular
>>dropouts.
>>Basically, the locks don't seem to work (they never unlock); but I really
>>have to
>>try and understand the mechanism better. I'll keep at it.
>>
>>A possible alternative, if this doesn't work is to use double-buffering,
>>without the
>>locks. I have done CoreAudio, Jack and ASIO clients that way before and it
>>works.
>>Not sure whether it would work in Csound though.
>>
>>Victor
>>
>>At 17:28 26/04/2005, you wrote:
>> >We can do it, but let's do it properly, using the support from the API,
>> >csoundModuleCreate() and
>> >csoundModuleInit(). I'd say that with CoreAudio sorted, ASIO should be
>> >almost there.
>> >
>> >Victor
>> >
>> >At 16:54 26/04/2005, you wrote:
>> >>That's great. Since you now seem to have CVS access and to be working
>> >>with current sources, do you think that you might be able to return to
>> >>your full-duplex audio driver? If not, can you re-mail me your earlier
>> >>source and maybe I can get it to work?
>> >>
>> >>Regards,
>> >>Mike
>> >>
>> >>-----Original Message-----
>> >>From: Victor Lazzarini
>> >>Sent: Apr 26, 2005 11:30 AM
>> >>To: csound-devel@lists.sourceforge.net
>> >>Subject: Re: [Cs-dev] OSX build report
>> >>
>> >>I just managed to start to test csound 5 build on OSX. The new
>> >>portaudio code does not work. That's because blocking is not
>> >>supported on OS X portaudio (it makes sense, since CoreAudio is
>> >>callback-based).
>> >>
>> >>However, the old rtpa.c & pablocking.c code seems to work fine for
>> >>output, now that -b/-B has been made independent from ksmps.
>> >>I don't expect it to work full-duplex, but I have a fix which I had
>> >>tested before with the old code and hopefully will work now.
>> >>
>> >>FLTK seems a little dodgy, but I need to test it more to see where it
>> >>actually fails.
>> >>
>> >>Victor
>> >>
>> >>At 23:14 25/04/2005, you wrote:
>> >> >A summary of my attempts to build csound5 on OSX tonight and
>> >> >some changes to SConstruct I had to make (sent some
>> >> >messages to the list, but they seemed to have been lost
>> >> >on the way):
>> >> >
>> >> >1. -gstabs stops g++ from compiling FL_graph.cpp,
>> >> >had to remove it from SConstruct
>> >> >
>> >> >2. the dirent-related MACH code had to be commented out
>> >> >as it conflicted with dirent.h and would not compile
>> >> >
>> >> >3. libportmidi.dylib would not build because it could not
>> >> >find the CoreMidi functions; when -framework CoreMidi
>> >> >was added, one function from CoreMidi conflicted with
>> >> >libportmidi; solution was to use -flat_namespace and
>> >> >-undefined warning, to force the build; not sure if it will
>> >> >work;
>> >> >
>> >> >4. pv_export cannot be built, linker complains of not
>> >> >finding cenviron
>> >> >
>> >> >Victor
>> >> >
>> >> >
>> >> >-------------------------------------------------------
>> >> >SF email is sponsored by - The IT Product Guide
>> >> >Read honest & candid reviews on hundreds of IT Products from real users.
>> >> >Discover which products truly live up to the hype. Start reading now.
>> >> >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>> >> >_______________________________________________
>> >> >Csound-devel mailing list
>> >> >Csound-devel@lists.sourceforge.net
>> >> >https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >>
>> >>Victor Lazzarini
>> >>Music Technology Laboratory
>> >>Music Department
>> >>National University of Ireland, Maynooth
>> >>
>> >>
>> >>
>> >>-------------------------------------------------------
>> >>SF email is sponsored by - The IT Product Guide
>> >>Read honest & candid reviews on hundreds of IT Products from real users.
>> >>Discover which products truly live up to the hype. Start reading now.
>> >>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>> >>_______________________________________________
>> >>Csound-devel mailing list
>> >>Csound-devel@lists.sourceforge.net
>> >>https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>-------------------------------------------------------
>> >>SF.Net email is sponsored by: Tell us your software development plans!
>> >>Take this survey and enter to win a one-year sub to SourceForge.net
>> >>Plus IDC's 2005 look-ahead and a copy of this survey
>> >>Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
>> >>_______________________________________________
>> >>Csound-devel mailing list
>> >>Csound-devel@lists.sourceforge.net
>> >>https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >
>> >Victor Lazzarini
>> >Music Technology Laboratory
>> >Music Department
>> >National University of Ireland, Maynooth
>> >
>> >
>> >-------------------------------------------------------
>> >SF.Net email is sponsored by: Tell us your software development plans!
>> >Take this survey and enter to win a one-year sub to SourceForge.net
>> >Plus IDC's 2005 look-ahead and a copy of this survey
>> >Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
>> >_______________________________________________
>> >Csound-devel mailing list
>> >Csound-devel@lists.sourceforge.net
>> >https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>Victor Lazzarini
>>Music Technology Laboratory
>>Music Department
>>National University of Ireland, Maynooth
>>
>>
>>
>>-------------------------------------------------------
>>SF.Net email is sponsored by: Tell us your software development plans!
>>Take this survey and enter to win a one-year sub to SourceForge.net
>>Plus IDC's 2005 look-ahead and a copy of this survey
>>Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
>>_______________________________________________
>>Csound-devel mailing list
>>Csound-devel@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>SF.Net email is sponsored by: Tell us your software development plans!
>>Take this survey and enter to win a one-year sub to SourceForge.net
>>Plus IDC's 2005 look-ahead and a copy of this survey
>>Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
>>_______________________________________________
>>Csound-devel mailing list
>>Csound-devel@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>Victor Lazzarini
>Music Technology Laboratory
>Music Department
>National University of Ireland, Maynooth
>
>
>-------------------------------------------------------
>SF.Net email is sponsored by: Tell us your software development plans!
>Take this survey and enter to win a one-year sub to SourceForge.net
>Plus IDC's 2005 look-ahead and a copy of this survey
>Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel
Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth
-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |