| Anthony and Matt,
I think I have a good handle on thread safe FLTK usage for Csound 4,
and tests on XP and Linux support this assertion. Anthony, would you
check out the current contents of the repository, and give it a whirl
on OS X? I also made it so that the GBS distribution uses the Csound
API to implement console Csound by moving some code from
csound/rtcore.c into csound/main.c. I think I got it right. Matt,
please look at this code and see if I'm on the right track.
John
Anthony Kozar writes:
> I am not really sure how to answer your questions. I took another look at
> the code and this is what I know:
>
> * real-time audio was not working on OS X when ccsound.c main() was used.
>
> * it was working when compiling with jpff's makefile which does not use
> ccsound.c.
>
> This is why I switched to using the main() in rtcore.c. Further:
>
> * MacOS X's CoreAudio library uses a callback approach to getting the audio
> and the rtcore.c main() appears to be a simple wrapper that does nothing
> after csoundMain() returns. This means that all of the work (musmon) is
> being run in a different thread via the CoreAudio callback.
>
> * I assume the reason that ccsound.c main() causes a bus error is because
> there are two threads simultaneously trying to run musmon.
>
> * Yes, this all implies that libcsound does not work on OS X because,
> clearly, the API must be broken.
>
> * Perhaps the fix is to move the "do nothing" code in rtcore.c main() when
> doing real-time into the appropriate place within the API routines.
>
> I want to say that since I did not write this code, I really do not fully
> understand it. Matt or John ff. may be able to shed more light on all of
> this than I can. If they don't provide an answer, then I will look into a
> solution. But for now, using the main() in rtcore.c seems to be providing
> OS X user's with a working GBS csound binary for real-time audio.
>
> Anthony
>
>
> On 12/23/04 2:59 PM, John D. Ramsdell etched in stone:
>
> > Anthony,
> >
> > I took a close look at csound/rtcore.c and csound/ccsound.c.
> > Something is very wrong. The fact that the main in routine ccsound.c
> > is omitted when MacOS and RTAUDIO is defined tells me the Csound
> > library is busted when used under those conditions. Otherwise, why
> > not use the interface presented by the Csound API to start csound
> > using the main routine in ccsound.c? There is no problem building the
> > Csound library with RTAUDIO defined on Windows and Lunix. Is there
> > some reason why libcsound must be deficient in this area on OS X?
> >
> > The flCsound program obtains csound support solely through the
> > interface provided by the Csound API. If the library is broken on OS
> > X when RTAUDIO is defined, then so is flCsound.
> >
> > John
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |