Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] internal callback

Date2006-10-28 20:32
FromVictor Lazzarini
SubjectRe: [Cs-dev] internal callback
My suggestion is to keep the GUI stuff in the same
thread which csoundPerformKsmps() is running. That seems
to be main problem: having FLTK code in two or more separate
threads, and also calling FL::wait from a thread other
than the main one (this is why multithreaded FLTK widgets
do not work well). If you keep everything in the same
thread and do not call FL::wait from a non-main thread,
it should be OK. At least, the FLTK code guidelines will be
followed.

I'd suggest putting all the GUI event processing in a
Yield callback.

 Victor
> CsoundVST as a plugin runs in two threads, both managed by
> the VST ghost,  one for the GUI, one for the audio and
> MIDI processing callbacks. In the  AEffect::idle callback,
> I call Fl::wait to handle FLTK events.
>
> CsoundVST as a standalone runs in the Fl::run thread, then
> creates a new  thread for each Csound or Python run.
>
> Do you have any suggestions on how to manage these? I'm
> willing to do a bit  of rewriting to make things work.
>
> Does csound5gui run in the FLTK thread, then in a callback
> run a Csound  performance that calls Fl::wait to dispatch
> FLTK events? I could probably do  that in standalone mode,
> but I can't do it in VST plugin mode, because the  host is
> managing the callbacks and threads. FLTK events have to be
> dispatched both when Csound is running, and when it is not
> running.
>
> Regards,
> Mike
>
> ----- Original Message -----
> From: "Victor Lazzarini" 
> To: "Developer discussions"
>  Sent: Saturday,
> October 28, 2006 9:11 AM Subject: Re: [Cs-dev] internal
> callback
>
>
> > yes, but is the GUI (using FLTK) for your host in a
> > separate thread from Csound? If it is, that is the
> problem. >
> > Winsound uses Yield to update its GUI and therefore
> > is completely single-threaded.
> >
> > Victor
> >
> >> But I have the same problem (dead widget windows) with
> or >> without FLTK  threads. I may have yet another thread
> in >> there, it was so long ago I have  forgotten. Would
> that >> cause a problem?
> >>
> >> Regards,
> >> Mike
> >>
> >> ----- Original Message -----
> >> From: "Victor Lazzarini" 
> >> To: "Developer discussions"
> >>  Sent: Saturday,
> >> October 28, 2006 4:26 AM Subject: Re: [Cs-dev] internal
> >> callback
> >>
> >>
> >> > No FLTK threads fixes it for widgets and graphs,
> >> > but not widgets, graphs and keyboard.
> >> >
> >> > As for CsoundVST, if you use FLTK on a separate
> >> > thread inside it for its GUI, then that's why it
> >> > does not work. Winsound works because it's
> >> single-threaded. >
> >> > Victor
> >> >
> >> >>
> >> >> Hi All,
> >> >>
> >> >> I just wanted to say I tried compiling with
> >> noFLTKThreads >> last night and was able to run the
> >> keyboard or widget >> windows, but not the graph
> displays. >> >>
> >> >> For CsoundVST, what happens when you try to run
> CSD's >> with >> FLTK widgets?  (No Windows, dead windows,
> etc.) >> >>
> >> >> steven
> >> >>
> >> >> On 10/28/06, Michael Gogins 
> >> wrote: >> > Could you either take a look at the
> >> CsoundVST.cpp and >> > CsoundVstFltk.cpp code (it is
> >> currently built with >> > noFLTKThreads=0), or explain
> to >> me what I would need to >> do to get FLTK widgets to
> work >> in CsoundVST? > >> > Regards,
> >> >> > Mike
> >> >> >
> >> >> > ----- Original Message -----
> >> >> > From: "Victor Lazzarini"
>  >> >> > To:
>  >> >> > Sent: Friday,
> October 27, 2006 8:32 AM >> >> > Subject: [Cs-dev]
> internal callback >> >> >
> >> >> >
> >> >> > >I have made the changes and tested on Windows,
> all >> >> > seems OK, now in CVS. >Now
> >> >> > > we need to test more carefully to see if this
> has >> >> > > actuall fixed anything. But
> >> >> > > I think this *at least* will prevent future
> issues >> >> > > with host yield callbacks.
> >> >> > >
> >> >> > > Victor
> >> >> > >
> >> >> > > Victor Lazzarini
> >> >> > > Music Technology Laboratory
> >> >> > > Music Department
> >> >> > > National University of Ireland, Maynooth
> >> >> > >
> >> >> > >
> >> >> > >
> >> >>
> >>
> ----------------------------------------------------------
> >> >> > > --------------- Using Tomcat but need to do
> more? >> Need >> > > to support web services, security?
> Get stuff >> done >> > > quickly with pre-integrated
> technology to make >> your >> > > job easier Download IBM
> WebSphere Application >> Server >> > > v.1.0.1 based on
> Apache Geronimo >> >>
> >> >
> >>
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >> >> > > _______________________________________________
> >> >> > > Csound-devel mailing list
> >> >> > > Csound-devel@lists.sourceforge.net
> >> >> > >
> >> >>
> >>
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >> >> > > >> > >> >>
> >>
> ----------------------------------------------------------
> >> >> > --------------- Using Tomcat but need to do more?
> >> Need >> > to support web services, security? Get stuff
> >> done >> quickly with pre-integrated technology to make
> >> your job >> > easier Download IBM WebSphere Application
> >> Server v.1.0.1 >> > based on Apache Geronimo >> >>
> >> >
> >>
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >> >> > _______________________________________________
> >> >> > Csound-devel mailing list
> >> >> > Csound-devel@lists.sourceforge.net
> >> >> >
> >> >>
> >>
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >> >> > >> >> >>
> >>
> ----------------------------------------------------------
> >> >> --------------- Using Tomcat but need to do more?
> Need >> to >> support web services, security? Get stuff
> done >> quickly >> with pre-integrated technology to make
> your job >> easier >> Download IBM WebSphere Application
> Server >> v.1.0.1 based on >> Apache Geronimo
> >> >>
> >> >
> >>
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >> >> _______________________________________________
> >> >> Csound-devel mailing list
> >> >> Csound-devel@lists.sourceforge.net
> >> >>
> >>
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >> > > >>
> ----------------------------------------------------------
> >> > --------------- Using Tomcat but need to do more?
> Need >> > to support web services, security? Get stuff
> done >> > quickly with pre-integrated technology to make
> your job >> > easier Download IBM WebSphere Application
> Server v.1.0.1 >> > based on Apache Geronimo
> >>
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >> > _______________________________________________
> >> > Csound-devel mailing list
> >> > Csound-devel@lists.sourceforge.net
> >> >
> >>
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >> >>
> >>
> ----------------------------------------------------------
> >> --------------- Using Tomcat but need to do more? Need
> to >> support web services, security? Get stuff done
> quickly >> with pre-integrated technology to make your job
> easier >> Download IBM WebSphere Application Server
> v.1.0.1 based on >> Apache Geronimo
> >>
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >> _______________________________________________
> >> Csound-devel mailing list
> >> Csound-devel@lists.sourceforge.net
> >>
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> > >
> ----------------------------------------------------------
> > --------------- Using Tomcat but need to do more? Need
> > to support web services, security? Get stuff done
> > quickly with pre-integrated technology to make your job
> > easier Download IBM WebSphere Application Server v.1.0.1
> > based on Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Csound-devel mailing list
> > Csound-devel@lists.sourceforge.net
> >
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
>
> ----------------------------------------------------------
> --------------- Using Tomcat but need to do more? Need to
> support web services, security? Get stuff done quickly
> with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on
> Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net