| Sorry, it's actually working fine (it's just waiting for keyboard
input)... I need to look at QuteCsound.
Cheers,
Andrés
On Sat, Oct 17, 2009 at 9:31 AM, Andres Cabrera wrote:
> Hi,
>
> I've made some slight changes to Rory's program, which seem to show
> the API is not closing completely, however, I don't get the same
> behavior I get in QuteCsound. I'll have a look.
>
> #include
> #include
>
> //performance thread function prototype
> uintptr_t csThread(void *clientData);
> //userData structure declaration
>
> typedef struct userData_ {
> int result;
> CSOUND* csound;
> int PERF_STATUS;
> } userData;
>
> //------------------------------------------------------------
> int main(int argc, char *argv[])
> {
> int userInput=200;
> void* ThreadID;
> userData* ud;
> ud = (userData *)malloc(sizeof(userData));
> MYFLT* pvalue;
> ud->csound=csoundCreate(NULL);
> csoundInitialize(&argc, &argv, 0);
> ud->result=csoundCompile(ud->csound,argc,argv);
> if(!ud->result)
> {
> ud->PERF_STATUS=1;
> ThreadID = csoundCreateThread(csThread, (void*)ud);
> }
> else{
> printf("csoundCompiled returned an error");
> return 0;
> }
> printf("\nEnter a pitch in Hz(0 to Exit) and type return\n");
> while(userInput!=0)
> {
> if(csoundGetChannelPtr(ud->csound, &pvalue, "pitch",
> CSOUND_INPUT_CHANNEL | CSOUND_CONTROL_CHANNEL)==0);
> *pvalue = (MYFLT)userInput;
> scanf("%d", &userInput);
> }
> ud->PERF_STATUS=0;
> return ud->result;
> }
> //-------------------------------------------------------------
> //definition of our performance thread function
> uintptr_t csThread(void *data)
> {
> printf("Start thread\n");
> userData* udata = (userData*)data;
> if(!udata->result)
> {
> while((csoundPerformKsmps(udata->csound) == 0)
> &&(udata->PERF_STATUS==1));
> csoundCleanup(udata->csound);
> csoundDestroy(udata->csound);
> }
> udata->PERF_STATUS = 0;
> printf("End thread\n");
> return 1;
> }
> //--------------------------------------------------------------------------------------------
>
>
> Cheers,
> Andrés
>
> On Sat, Oct 17, 2009 at 8:35 AM, victor wrote:
>> The thing to do then, I guess, is to write a small program with a perform
>> thread and see if it has a similar problem to qutecsound.
>>
>> Victor
>> ----- Original Message -----
>> From: "Andres Cabrera"
>> To: "Michael Gogins"
>> Cc: "Developer discussions"
>> Sent: Saturday, October 17, 2009 8:20 AM
>> Subject: Re: [Cs-dev] cleanup after performance
>>
>>
>> Hi Michael,
>>
>> Now that I check I am actually using CsPerfThread, I have it ifdef'd
>> and defined by default in the build script, so I missed it. I was
>> having problem with sending score events using the function provided
>> by CsPerfThread, but that's working fine now.
>>
>> The cleanup problem is still there, though, even if I create my own
>> thread (don't define QUTECSOUND_USE_CSOUNDPERFORMANCETHREAD in
>> src.pro)
>>
>> I'm not really sure whether it's my fault, but I don't think anything
>> in QuteCsound has changed in that respect. Maybe Steven or a blue user
>> can chime in to confirm things are fine with the new csound?
>>
>> Cheers,
>> Andrés
>>
>> On Fri, Oct 16, 2009 at 2:46 PM, Michael Gogins
>> wrote:
>>> This is what happens when you don't use the CsPerfThread.
>>>
>>> What problem did you experience using CsPerfThread's own method for
>>> sending in events?
>>>
>>> Regards,
>>> Mike
>>>
>>> On 10/16/09, Andrés Cabrera wrote:
>>>> Hi,
>>>>
>>>> I've finally found the reason for the crashing of QuteCsound, but I'm
>>>> not really sure where it's coming from.
>>>> It would seem that the thread which runs csound is getting called again
>>>> and again, after it has joined and csound has stopped. I'm not really
>>>> sure how this can be fixed, but hopefully someone here will know.
>>>> The thread function is in file qutecsound.cpp line 3145. I'm not
>>>> currently using CsPerfThread as I couldn't get the score messages to be
>>>> sent correctly using it, so I create my own thread in qutecsound.cpp
>>>> line 994, which is part of the runCsound() method.
>>>>
>>>> Aparently, when the thread stops by itself (i.e. Csound score ends), the
>>>> thread keeps calling itself again and again, while if it's forced to
>>>> stop by the stop button, it will stop properly.
>>>>
>>>> I added some debugging messages in svn. Also changed the return value of
>>>> the thread function to 1 to see if there was any change. (BTW what
>>>> should the thread function return on success?)
>>>>
>>>> Does anyone know what's going on here?
>>>>
>>>> Cheers,
>>>> Andrés
>>>>
>>>> El jue, 15-10-2009 a las 23:01 +0100, victor escribió:
>>>>> OK, so what I am reporting is not related to this, because it is on
>>>>> OSX. I am not sure even if it's a problem, but it's something
>>>>> that changed in Csound.
>>>>>
>>>>> Victor
>>>>> ----- Original Message -----
>>>>> From: "Michael Gogins"
>>>>> To: "Developer discussions"
>>>>> Sent: Thursday, October 15, 2009 5:47 PM
>>>>> Subject: Re: [Cs-dev] cleanup after performance
>>>>>
>>>>>
>>>>> > It was used on all systems. I took it out only for Windows.
>>>>> >
>>>>> > Regards,
>>>>> > Mike
>>>>> >
>>>>> > On 10/15/09, Victor Lazzarini wrote:
>>>>> >> Was the atexit() handler only used on Windows or on other systems
>>>>> >> too?
>>>>> >>
>>>>> >> Victor
>>>>> >> On 15 Oct 2009, at 15:52, Michael Gogins wrote:
>>>>> >>
>>>>> >>> There was an atexit handler on Windows that I removed. That could be
>>>>> >>> related. It was causing crashes in QuteCsound and other
>>>>> >>> environments,
>>>>> >>> and in my tests I didn't see any bad effects from not using the
>>>>> >>> atexit
>>>>> >>> handler, probably because I don't usually use temporary files.
>>>>> >>>
>>>>> >>> Regards,
>>>>> >>> Mike
>>>>> >>>
>>>>> >>> On 10/15/09, Victor Lazzarini wrote:
>>>>> >>>> Regarding the latest issues with Qutecsound, I noticed these
>>>>> >>>> changes
>>>>> >>>> (I don't
>>>>> >>>> know when, but...). The command-line frontend finishes with
>>>>> >>>> different
>>>>> >>>> messages
>>>>> >>>> now:
>>>>> >>>>
>>>>> >>>> Score finished in csoundPerform().
>>>>> >>>> inactive allocs returned to freespace
>>>>> >>>> end of score. overall amps: 0.49919
>>>>> >>>> overall samples out of range: 0
>>>>> >>>> 0 errors in performance
>>>>> >>>> Elapsed time at end of performance: real: 0.496s, CPU: 0.275s
>>>>> >>>> 13781 128-byte soundblks of shorts written to /Users/victor/audio/
>>>>> >>>> test.aif (AIFF)
>>>>> >>>> signalflowgraph: CsoundModuleDestroy(0xdc000)
>>>>> >>>>
>>>>> >>>> The last line I guess comes from Mike's new opcodes. But missing
>>>>> >>>> from
>>>>> >>>> these messages are
>>>>> >>>> the three 'removed temporary file ... ' messages. Does this mean
>>>>> >>>> anything?
>>>>> >>>> Has anything changed in the Csound cleanup process?
>>>>> >>>>
>>>>> >>>> Victor
>>>>> >>>>
>>>>> >>>>
>>>>> >>>>
>>>>> >>>>
>>>>> >>>> ------------------------------------------------------------------------------
>>>>> >>>> Come build with us! The BlackBerry(R) Developer Conference in SF,
>>>>> >>>> CA
>>>>> >>>> is the only developer event you need to attend this year. Jumpstart
>>>>> >>>> your
>>>>> >>>> developing skills, take BlackBerry mobile applications to market
>>>>> >>>> and stay
>>>>> >>>> ahead of the curve. Join us from November 9 - 12, 2009. Register
>>>>> >>>> now!
>>>>> >>>> http://p.sf.net/sfu/devconference
>>>>> >>>> _______________________________________________
>>>>> >>>> Csound-devel mailing list
>>>>> >>>> Csound-devel@lists.sourceforge.net
>>>>> >>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> >>>>
>>>>> >>>
>>>>> >>>
>>>>> >>> --
>>>>> >>> Michael Gogins
>>>>> >>> Irreducible Productions
>>>>> >>> http://www.michael-gogins.com
>>>>> >>> Michael dot Gogins at gmail dot com
>>>>> >>>
>>>>> >>> ------------------------------------------------------------------------------
>>>>> >>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>>>> >>> is the only developer event you need to attend this year. Jumpstart
>>>>> >>> your
>>>>> >>> developing skills, take BlackBerry mobile applications to market and
>>>>> >>> stay
>>>>> >>> ahead of the curve. Join us from November 9 - 12, 2009. Register
>>>>> >>> now!
>>>>> >>> http://p.sf.net/sfu/devconference
>>>>> >>> _______________________________________________
>>>>> >>> Csound-devel mailing list
>>>>> >>> Csound-devel@lists.sourceforge.net
>>>>> >>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> >>
>>>>> >>
>>>>> >> ------------------------------------------------------------------------------
>>>>> >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>>>> >> is the only developer event you need to attend this year. Jumpstart
>>>>> >> your
>>>>> >> developing skills, take BlackBerry mobile applications to market and
>>>>> >> stay
>>>>> >> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>>>> >> http://p.sf.net/sfu/devconference
>>>>> >> _______________________________________________
>>>>> >> Csound-devel mailing list
>>>>> >> Csound-devel@lists.sourceforge.net
>>>>> >> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> >>
>>>>> >
>>>>> >
>>>>> > --
>>>>> > Michael Gogins
>>>>> > Irreducible Productions
>>>>> > http://www.michael-gogins.com
>>>>> > Michael dot Gogins at gmail dot com
>>>>> >
>>>>> > ------------------------------------------------------------------------------
>>>>> > Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>>>> > is the only developer event you need to attend this year. Jumpstart
>>>>> > your
>>>>> > developing skills, take BlackBerry mobile applications to market and
>>>>> > stay
>>>>> > ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>>>> > http://p.sf.net/sfu/devconference
>>>>> > _______________________________________________
>>>>> > Csound-devel mailing list
>>>>> > Csound-devel@lists.sourceforge.net
>>>>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>>>> is the only developer event you need to attend this year. Jumpstart your
>>>>> developing skills, take BlackBerry mobile applications to market and
>>>>> stay
>>>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>>>> http://p.sf.net/sfu/devconference
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>>> is the only developer event you need to attend this year. Jumpstart your
>>>> developing skills, take BlackBerry mobile applications to market and stay
>>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>>> http://p.sf.net/sfu/devconference
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>
>>>
>>> --
>>> Michael Gogins
>>> Irreducible Productions
>>> http://www.michael-gogins.com
>>> Michael dot Gogins at gmail dot com
>>>
>>
>>
>>
>> --
>>
>>
>> Andrés
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
>
>
> --
>
>
> Andrés
>
--
Andrés
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |