|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
API and Instability (Crashes, Java)Hi All,
I've been trying to debug what is going on here with blue and the Csound API. It seem that after running a project a few times, after the project finishes rendering Csound crashes and it takes down blue with it. I'm not sure if I'm doing something wrong with using the API though. Currently, I'm creating a new Csound object for each render, and calling csound.Reset() after it is finished. The ksmps loop part of the code, then the Reset call is shown below. I tried also by using the CsoundCallbackWrapper and setting a YieldCallBack, but that didn't quite work. When the crash occurs, I do get an error log from Java and it seems that the error might be from PerformKsmps. I did try putting in a print out to system.err after the ksmps loop but before the Reset call and it did not show when Csound crashed. Any ideas? Thanks, Steven while (csound.PerformKsmps() == 0 && keepRunning) { counter++; float scoreTime = (float) csound.GetScoreTime(); if (counter > updateRate) { RenderTimeManager.getInstance().updateTimePointer(scoreTime); counter = 0; } Parameter param; float currentTime = 0.0f; if(startTime >= 0.0f) { if (mapper != null) { float renderStartSeconds = mapper.beatsToSeconds(startTime); currentTime = mapper.secondsToBeats(scoreTime + renderStartSeconds); currentTime -= startTime; } else { currentTime = startTime + scoreTime; } } if(blueData != null) { currentTime = blueData.getRenderStartTime(); } for (int i = 0; i < parameters.size(); i++) { param = (Parameter) parameters.get(i); String varName = param.getCompilationVarName(); if(blueData != null) { float value = param.getValue(currentTime); csound.SetChannel(varName, (double) value); } else { csound.SetChannel(varName, param.getFixedValue()); } } } csound.Reset(); ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Csound-devel mailing list Csound-devel@... https://lists.sourceforge.net/lists/listinfo/csound-devel |
|
|
|
|
|
Re: API and Instability (Crashes, Java)Hi Michael,
Thanks! I changed my code to keep the Csound reference around. I think it actually may have had more to do with the CsoundCallbackWrapper class, which I haven't really looked at. But now just keeping that around and creating only one CsoundCallbackWrapper seems to have stabilized everything and also fixed up another problem where some output wasn't being captured. Thanks! steven On Sun, Aug 17, 2008 at 9:26 PM, Michael Gogins <gogins@...> wrote: > I keep the object around. As far as I know the API examples in the examples directory all work for repeated renderings, at least they do on Windows and they once did and still may do on Linux. > > Regards, > Mike > > -----Original Message----- >>From: Steven Yi <stevenyi@...> >>Sent: Aug 17, 2008 8:03 PM >>To: Developer discussions <csound-devel@...> >>Subject: [Cs-dev] API and Instability (Crashes, Java) >> >>Hi All, >> >>I've been trying to debug what is going on here with blue and the >>Csound API. It seem that after running a project a few times, after >>the project finishes rendering Csound crashes and it takes down blue >>with it. I'm not sure if I'm doing something wrong with using the API >>though. Currently, I'm creating a new Csound object for each render, >>and calling csound.Reset() after it is finished. The ksmps loop part >>of the code, then the Reset call is shown below. I tried also by >>using the CsoundCallbackWrapper and setting a YieldCallBack, but that >>didn't quite work. When the crash occurs, I do get an error log from >>Java and it seems that the error might be from PerformKsmps. I did >>try putting in a print out to system.err after the ksmps loop but >>before the Reset call and it did not show when Csound crashed. >> >>Any ideas? >> >>Thanks, >>Steven >> >> >> >> >> while (csound.PerformKsmps() == 0 && keepRunning) { >> counter++; >> >> float scoreTime = (float) csound.GetScoreTime(); >> >> if (counter > updateRate) { >> >>RenderTimeManager.getInstance().updateTimePointer(scoreTime); >> counter = 0; >> } >> >> Parameter param; >> >> float currentTime = 0.0f; >> >> if(startTime >= 0.0f) { >> if (mapper != null) { >> float renderStartSeconds = >>mapper.beatsToSeconds(startTime); >> currentTime = mapper.secondsToBeats(scoreTime >>+ renderStartSeconds); >> currentTime -= startTime; >> } else { >> currentTime = startTime + scoreTime; >> } >> } >> >> if(blueData != null) { >> currentTime = blueData.getRenderStartTime(); >> } >> >> for (int i = 0; i < parameters.size(); i++) { >> param = (Parameter) parameters.get(i); >> String varName = param.getCompilationVarName(); >> >> if(blueData != null) { >> float value = param.getValue(currentTime); >> csound.SetChannel(varName, (double) value); >> } else { >> csound.SetChannel(varName, param.getFixedValue()); >> } >> } >> } >> >> csound.Reset(); >> >>------------------------------------------------------------------------- >>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>Build the coolest Linux based applications with Moblin SDK & win great prizes >>Grand prize is a trip for two to an Open Source event anywhere in the world >>http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>_______________________________________________ >>Csound-devel mailing list >>Csound-devel@... >>https://lists.sourceforge.net/lists/listinfo/csound-devel > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Csound-devel mailing list > Csound-devel@... > https://lists.sourceforge.net/lists/listinfo/csound-devel > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Csound-devel mailing list Csound-devel@... https://lists.sourceforge.net/lists/listinfo/csound-devel |
|
|
Re: API and Instability (Crashes, Java)Steven Yi wrote:
> I've been trying to debug what is going on here with blue and the > Csound API. It seem that after running a project a few times, after > the project finishes rendering Csound crashes and it takes down blue > with it. I'm not sure if I'm doing something wrong with using the API > though. Currently, I'm creating a new Csound object for each render, > and calling csound.Reset() after it is finished. The ksmps loop part > of the code, then the Reset call is shown below. I tried also by > using the CsoundCallbackWrapper and setting a YieldCallBack, but that > didn't quite work. When the crash occurs, I do get an error log from > Java and it seems that the error might be from PerformKsmps. I did > try putting in a print out to system.err after the ksmps loop but > before the Reset call and it did not show when Csound crashed. > still have) with AVSynthesis. That program will run stably as long as I don't render anything via the Csound side, but as soon as I render audio the system is unstable. Sometimes it will continue to work without troubles, but most of the time it's a safe bet that at some point AVS will crash, and the only message I ever receive is a segfault from Csound, usually with a Pt_stop message before the segfault. I work with AVS much like you might in blue, i.e. I'm calling and recalling Csound performance many times during a session. At some point it appears that Csound simply gives up the ghost, but I don't really know why yet. Btw, I can look into the AVS sources now, I'll see if the Csound code is similar to your examples. And as Michael G indicates, this problem appears to cause no troubles on Windows. I should also note that I've seen the same behaviour with Rubato when I've run its Csound rubettes, i.e. the system becomes unstable and prone to wild segfaults. Best, dp ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Csound-devel mailing list Csound-devel@... https://lists.sourceforge.net/lists/listinfo/csound-devel |
|
|
Re: API and Instability (Crashes, Java)Hi Dave,
I remember the AVSynthesis crashes and trying to help earlier but at the time wasn't of much use as I hadn't done much with the API. I could probably be a little more helpful now, so maybe we should discuss off list. The latest code I've done for blue is a bit more in depth than what I last posted but it's also a big file so I can send a copy off-list or can take another look at AVSynthesis and maybe we can discuss with Jean-Pierre. Also to note, the problems I was having were on Windows and the stabilization also was only tested on Windows. I haven't tested on Linux yet, so I'm not sure if the solution for blue will apply to your situation on Linux. Thanks! steven On Mon, Aug 18, 2008 at 4:53 AM, Dave Phillips <dlphillips@...> wrote: > Steven Yi wrote: >> I've been trying to debug what is going on here with blue and the >> Csound API. It seem that after running a project a few times, after >> the project finishes rendering Csound crashes and it takes down blue >> with it. I'm not sure if I'm doing something wrong with using the API >> though. Currently, I'm creating a new Csound object for each render, >> and calling csound.Reset() after it is finished. The ksmps loop part >> of the code, then the Reset call is shown below. I tried also by >> using the CsoundCallbackWrapper and setting a YieldCallBack, but that >> didn't quite work. When the crash occurs, I do get an error log from >> Java and it seems that the error might be from PerformKsmps. I did >> try putting in a print out to system.err after the ksmps loop but >> before the Reset call and it did not show when Csound crashed. >> > Steven, this problem sounds suspiciously like the problem I've had (and > still have) with AVSynthesis. That program will run stably as long as I > don't render anything via the Csound side, but as soon as I render audio > the system is unstable. Sometimes it will continue to work without > troubles, but most of the time it's a safe bet that at some point AVS > will crash, and the only message I ever receive is a segfault from > Csound, usually with a Pt_stop message before the segfault. I work with > AVS much like you might in blue, i.e. I'm calling and recalling Csound > performance many times during a session. At some point it appears that > Csound simply gives up the ghost, but I don't really know why yet. > > Btw, I can look into the AVS sources now, I'll see if the Csound code is > similar to your examples. And as Michael G indicates, this problem > appears to cause no troubles on Windows. I should also note that I've > seen the same behaviour with Rubato when I've run its Csound rubettes, > i.e. the system becomes unstable and prone to wild segfaults. > > Best, > > dp > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Csound-devel mailing list > Csound-devel@... > https://lists.sourceforge.net/lists/listinfo/csound-devel > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Csound-devel mailing list Csound-devel@... https://lists.sourceforge.net/lists/listinfo/csound-devel |
|
|
|
|
|
Re: API and Instability (Crashes, Java)Well there's not too much to discuss as I pretty much just kept a
reference to the Csound object around and called Reset() on it after running. The code for the latest is here: http://bluemusic.cvs.sourceforge.net/bluemusic/blue/src/main/java/blue/render/APIRunner.java?revision=1.9&view=markup You can see how the APIRunner class only creates the Csound object once, as well as sets the CallBackwrapper only once as well. I think that actually had a bigger impact as I had tried earlier commenting out that callbackWrapper when I was creating a Csound object per-render and it didn't crash, but that's not really an option as I need to override to get the MessageCallback. If anyone has any questions, please feel free to ask! steven On Tue, Aug 19, 2008 at 1:54 AM, Victor Lazzarini <Victor.Lazzarini@...> wrote: > I think this is probably useful to all of us, why not discuss it here? > > At 18:38 18/08/2008, you wrote: >>Hi Dave, >> >>I remember the AVSynthesis crashes and trying to help earlier but at >>the time wasn't of much use as I hadn't done much with the API. I >>could probably be a little more helpful now, so maybe we should >>discuss off list. The latest code I've done for blue is a bit more in >>depth than what I last posted but it's also a big file so I can send a >>copy off-list or can take another look at AVSynthesis and maybe we can >>discuss with Jean-Pierre. >> >>Also to note, the problems I was having were on Windows and the >>stabilization also was only tested on Windows. I haven't tested on >>Linux yet, so I'm not sure if the solution for blue will apply to your >>situation on Linux. >> >>Thanks! >>steven >> >> >>On Mon, Aug 18, 2008 at 4:53 AM, Dave Phillips <dlphillips@...> wrote: >> > Steven Yi wrote: >> >> I've been trying to debug what is going on here with blue and the >> >> Csound API. It seem that after running a project a few times, after >> >> the project finishes rendering Csound crashes and it takes down blue >> >> with it. I'm not sure if I'm doing something wrong with using the API >> >> though. Currently, I'm creating a new Csound object for each render, >> >> and calling csound.Reset() after it is finished. The ksmps loop part >> >> of the code, then the Reset call is shown below. I tried also by >> >> using the CsoundCallbackWrapper and setting a YieldCallBack, but that >> >> didn't quite work. When the crash occurs, I do get an error log from >> >> Java and it seems that the error might be from PerformKsmps. I did >> >> try putting in a print out to system.err after the ksmps loop but >> >> before the Reset call and it did not show when Csound crashed. >> >> >> > Steven, this problem sounds suspiciously like the problem I've had (and >> > still have) with AVSynthesis. That program will run stably as long as I >> > don't render anything via the Csound side, but as soon as I render audio >> > the system is unstable. Sometimes it will continue to work without >> > troubles, but most of the time it's a safe bet that at some point AVS >> > will crash, and the only message I ever receive is a segfault from >> > Csound, usually with a Pt_stop message before the segfault. I work with >> > AVS much like you might in blue, i.e. I'm calling and recalling Csound >> > performance many times during a session. At some point it appears that >> > Csound simply gives up the ghost, but I don't really know why yet. >> > >> > Btw, I can look into the AVS sources now, I'll see if the Csound code is >> > similar to your examples. And as Michael G indicates, this problem >> > appears to cause no troubles on Windows. I should also note that I've >> > seen the same behaviour with Rubato when I've run its Csound rubettes, >> > i.e. the system becomes unstable and prone to wild segfaults. >> > >> > Best, >> > >> > dp >> > >> > >> > ------------------------------------------------------------------------- >> > This SF.Net email is sponsored by the Moblin Your Move >> Developer's challenge >> > Build the coolest Linux based applications with Moblin SDK & win >> great prizes >> > Grand prize is a trip for two to an Open Source event anywhere in the world >> > http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> > _______________________________________________ >> > Csound-devel mailing list >> > Csound-devel@... >> > https://lists.sourceforge.net/lists/listinfo/csound-devel >> > >> >>------------------------------------------------------------------------- >>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>Build the coolest Linux based applications with Moblin SDK & win great prizes >>Grand prize is a trip for two to an Open Source event anywhere in the world >>http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>_______________________________________________ >>Csound-devel mailing list >>Csound-devel@... >>https://lists.sourceforge.net/lists/listinfo/csound-devel > > Victor Lazzarini > Music Technology Laboratory > Music Department > National University of Ireland, Maynooth > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Csound-devel mailing list > Csound-devel@... > https://lists.sourceforge.net/lists/listinfo/csound-devel > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Csound-devel mailing list Csound-devel@... https://lists.sourceforge.net/lists/listinfo/csound-devel |
| Free Forum Powered by Nabble | Forum Help |