[Csnd] API crash after two or three compile/perform runs
Date | 2011-08-17 02:32 |
From | Casey Mongoven |
Subject | [Csnd] API crash after two or three compile/perform runs |
Hi All, I notice there has been some discussion of stability issues with the csound api. I can't get it to compile and perform more than three times without crashing in a cocoa program. I took a look at the code in the front ends and it does not seem to have helped. Even if I make my code as simple as possible it crashes after a couple runs. Here is what I have in a cocoa application: (header file) %%%%%%%%%%%%%%%%%%%%%%% #import <Cocoa/Cocoa.h> #include "csound.hpp" #define USE_DOUBLE @interface CsoundRealtimeAndNotAppDelegate : NSObject |
Date | 2011-08-17 03:04 |
From | Steven Yi |
Subject | Re: [Csnd] API crash after two or three compile/perform runs |
Hi Casey, I just tried your project here using a CSD I have here as I didn't see a test.csd included with the project. I'm on OSX 10.7 Lion, using a self-compiled Csound64.framework. I was able to render multiple times without crash. The version of Csound I compiled used the instructions in the wiki I wrote: http://sourceforge.net/apps/mediawiki/csound/index.php?title=Building_Csound_on_OSX_Lion This builds an i386/x86_64 build of Csound using doubles. What version of Csound are you using? And what version of OSX and XCode are you using? Thanks, steven On Tue, Aug 16, 2011 at 9:32 PM, Casey Mongoven |
Date | 2011-08-17 03:07 |
From | Steven Yi |
Subject | Re: [Csnd] API crash after two or three compile/perform runs |
Also, could you post the test.csd? And do you have a .csoundrc that may be adding any flags that aren't used in the xcode project? On Tue, Aug 16, 2011 at 10:04 PM, Steven Yi |
Date | 2011-08-17 03:17 |
From | Casey Mongoven |
Subject | [Csnd] Re: API crash after two or three compile/perform runs |
Hi Steven, Thanks very much for the response. I am on Mac OS X 10.6 Snow Leopard and also using a self-compiled Csound64.framework (checked out July 19). The csd file is now at http://misc.caseymongoven.com/test.csd. Thanks for your help again, Steven. Casey -- View this message in context: http://csound.1045644.n5.nabble.com/API-crash-after-two-or-three-compile-perform-runs-tp4706398p4706517.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-08-17 03:23 |
From | Casey Mongoven |
Subject | [Csnd] Re: API crash after two or three compile/perform runs |
If it helps, I am getting a flurry of warnings when it crashes that say something like: "warning: Could not open OSO file /usr/local/csound5/Opcodes/vbap_zak.os to scan for pubtypes for objfile /Library/Frameworks/CsoundLib64.framework/Versions/5.2/Resources/Opcodes64/libvbap.dylib warning: .o file "/usr/local/csound5/Opcodes/Vosim.os" more recent than executable timestamp in "/Library/Frameworks/CsoundLib64.framework/Versions/5.2/Resources/Opcodes64/libvosim.dylib" -- View this message in context: http://csound.1045644.n5.nabble.com/API-crash-after-two-or-three-compile-perform-runs-tp4706398p4706539.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-08-17 03:58 |
From | Casey Mongoven |
Subject | [Csnd] Re: API crash after two or three compile/perform runs |
Strange, I recompiled from the latest source and my error messages have changed a bit. Now I am getting on crash: [Switching to process 2473 thread 0x1a07] [Switching to process 2473 thread 0x1a07] sharedlibrary apply-load-rules all warning: Could not find object file "/Developer/libraries/liblo-0.26/src/.libs/liblo_la-address.o" - no debug information available for "address.c". warning: Could not find object file "/Developer/libraries/liblo-0.26/src/.libs/liblo_la-send.o" - no debug information available for "send.c". warning: Could not find object file "/Developer/libraries/liblo-0.26/src/.libs/liblo_la-message.o" - no debug information available for "message.c". warning: Could not find object file "/Developer/libraries/liblo-0.26/src/.libs/liblo_la-server.o" - no debug information available for "server.c". warning: Could not find object file "/Developer/libraries/liblo-0.26/src/.libs/liblo_la-method.o" - no debug information available for "method.c". warning: Could not find object file "/Developer/libraries/liblo-0.26/src/.libs/liblo_la-server_thread.o" - no debug information available for "server_thread.c". warning: Could not find object file "/Developer/libraries/liblo-0.26/src/.libs/liblo_la-blob.o" - no debug information available for "blob.c". warning: Could not find object file "/Developer/libraries/liblo-0.26/src/.libs/liblo_la-bundle.o" - no debug information available for "bundle.c". warning: Could not find object file "/Developer/libraries/liblo-0.26/src/.libs/liblo_la-timetag.o" - no debug information available for "timetag.c". warning: Could not find object file "/Developer/libraries/liblo-0.26/src/.libs/liblo_la-pattern_match.o" - no debug information available for "pattern_match.c". liblo is for OSC but I am using "sudo scons install=1 useDouble=1 usePortAudio=1 dynamicCsoundLibrary=1 buildInterfaces=1 Lib64=1 Word64=1 buildDSSI=1 noFLTKThreads=1" to build csound, not including osc. Very confused... Casey -- View this message in context: http://csound.1045644.n5.nabble.com/API-crash-after-two-or-three-compile-perform-runs-tp4706398p4706616.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-08-17 04:03 |
From | Steven Yi |
Subject | Re: [Csnd] Re: API crash after two or three compile/perform runs |
Hi Casey, I got a crash when I removed my .csoundrc file. My .csoundrc contains: -+rtaudio=pa_bl -o dac -d -+ignore_csopts=true This brought up an issue I remembered: it seems that using the callback version of PortAudio will crash Csound. I remembered encountering this with blue and using the API and switching to the blocking interface for portaudio (pa_bl) made things stable. Please try using -+rtaudio=pa_bl on your system to see if that fixes up things. Also, it sounds like you have multiple builds of Csound on your system. The warning look like it's checking both /usr/local/csound5/Opcodes and /Library/Frameworks/CsoundLib64.framework/Versions/5.2/Resources/Opcodes64/. Do you have OPCODEDIR64 explicitly set anywhere? Otherwise on OSX, it will default to that folder in the frameworks directory. steven On Tue, Aug 16, 2011 at 10:23 PM, Casey Mongoven |
Date | 2011-08-17 04:09 |
From | Casey Mongoven |
Subject | [Csnd] Re: API crash after two or three compile/perform runs |
Bizarre it works when I use: -+rtaudio=pa_bl -o dac -d -+ignore_csopts=true as you have in your file. Thank you very much for taking the time to help me, Steven. Best, Casey -- View this message in context: http://csound.1045644.n5.nabble.com/API-crash-after-two-or-three-compile-perform-runs-tp4706398p4706646.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-08-17 04:13 |
From | Steven Yi |
Subject | Re: [Csnd] Re: API crash after two or three compile/perform runs |
Fantastic, glad that got you going. I think a further question to ask for the other developers: should we perhaps make the blocking interface the standard for portaudio? At least on OSX? Or is this really just an issue when used from the API, and commandline csound is not affected? Thanks! steven On Tue, Aug 16, 2011 at 11:09 PM, Casey Mongoven |
Date | 2011-08-17 10:06 |
From | Victor Lazzarini |
Subject | Re: [Csnd] API crash after two or three compile/perform runs |
Can we switch this discussion to the csound developer's list? It will be better discussed there. Victor On 17 Aug 2011, at 02:32, Casey Mongoven wrote: > Hi All, > > I notice there has been some discussion of stability issues with the > csound > api. I can't get it to compile and perform more than three times > without > crashing in a cocoa program. I took a look at the code in the front > ends and > it does not seem to have helped. Even if I make my code as simple as > possible it crashes after a couple runs. Here is what I have in a > cocoa > application: > > (header file) %%%%%%%%%%%%%%%%%%%%%%% > > #import <Cocoa/Cocoa.h> > #include "csound.hpp" > #define USE_DOUBLE > > @interface CsoundRealtimeAndNotAppDelegate : NSObject > |
Date | 2011-08-17 10:08 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Re: API crash after two or three compile/perform runs |
No, I wouldn't rush into that. The blocking interface has afaik much higheer latency. Victor On 17 Aug 2011, at 04:13, Steven Yi wrote: > Fantastic, glad that got you going. > > I think a further question to ask for the other developers: should we > perhaps make the blocking interface the standard for portaudio? At > least on OSX? Or is this really just an issue when used from the API, > and commandline csound is not affected? > > Thanks! > steven > > On Tue, Aug 16, 2011 at 11:09 PM, Casey Mongoven > |
Date | 2011-08-17 10:16 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Re: API crash after two or three compile/perform runs |
however, we need to investigate this issue on x86_64. It can be related to the reentrancy problem I mentioned earlier. Victor On 17 Aug 2011, at 10:08, Victor Lazzarini wrote: > No, I wouldn't rush into that. The blocking interface has afaik much > higheer latency. > > Victor > On 17 Aug 2011, at 04:13, Steven Yi wrote: > >> Fantastic, glad that got you going. >> >> I think a further question to ask for the other developers: should we >> perhaps make the blocking interface the standard for portaudio? At >> least on OSX? Or is this really just an issue when used from the >> API, >> and commandline csound is not affected? >> >> Thanks! >> steven >> >> On Tue, Aug 16, 2011 at 11:09 PM, Casey Mongoven |
Date | 2011-08-18 04:46 |
From | Steven Yi |
Subject | Re: [Csnd] API crash after two or three compile/perform runs |
I'll reply to the other emails but will switch over to the dev list. Thanks! steven On Wed, Aug 17, 2011 at 5:06 AM, Victor Lazzarini |
Date | 2011-08-18 04:50 |
From | Steven Yi |
Subject | Re: [Cs-dev] [Csnd] Re: API crash after two or three compile/perform runs |
Hi Victor, Regarding latency, I'd favor not crashing by default over higher latency. I don't know however if the callback interface crashing is only going to manifest with programs using the API vs. csound commandline which always just does a single run before exiting. I don't know if the best solution is to change the default or just document not to use pa_cb if you are going to use the API. Thoughts? steven On Wed, Aug 17, 2011 at 5:08 AM, Victor Lazzarini |
Date | 2011-08-18 04:52 |
From | Steven Yi |
Subject | Re: [Cs-dev] [Csnd] Re: API crash after two or three compile/perform runs |
I thought the reentrancy problem earlier was from portmidi and not portaudio, no? It would be interesting if all along it was portaudio callback that was causing the problem and portmidi was sort of a red herring. I can certainly reproduce crashes with pa_cb, but never did get a crash with portmidi and pa_bl (which I had in my .csoundrc). Are you getting any crashes there with portmidi? If so, does it change if you use pa_bl? Thanks! steven On Wed, Aug 17, 2011 at 5:16 AM, Victor Lazzarini |
Date | 2011-08-18 08:23 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] [Csnd] Re: API crash after two or three compile/perform runs |
I think we cannot release for x86_64 before this is sorted. The blocking interface is not very good at all, the latencies make it not really usable for RT. On i386 there are no such crashes (otherwise we would have heard about it from users). Does my test program crash Csound now with pa_cb? Victor On 18 Aug 2011, at 04:50, Steven Yi wrote: > Hi Victor, > > Regarding latency, I'd favor not crashing by default over higher > latency. I don't know however if the callback interface crashing is > only going to manifest with programs using the API vs. csound > commandline which always just does a single run before exiting. I > don't know if the best solution is to change the default or just > document not to use pa_cb if you are going to use the API. > > Thoughts? > steven > > > > On Wed, Aug 17, 2011 at 5:08 AM, Victor Lazzarini > |
Date | 2011-08-18 14:35 |
From | Steven Yi |
Subject | Re: [Cs-dev] [Csnd] Re: API crash after two or three compile/perform runs |
Tested here with your test program, portmidi and pa_cb, no crashes. I noticed a difference in that your test file creates one instance of Csound then does compile/perform/reset, then a final destroy. The other project did an init/perform/destroy each run. I modified test.c and did not get any crashes there either. Ah... I just tried the original project. It crashed as before, but I realized the code running csound was on the main thread (the UI thread). However, once I modified code to run Csound of the main thread: -(void)doRender { CSOUND *csound = csoundCreate(NULL); char** cmdl = (char **) malloc(sizeof(char*)*(3)); cmdl[0] = "csound"; cmdl[1] = "/Users/stevenyi/Downloads/test.csd"; cmdl[2] = "-odac"; int result = csoundCompile(csound,3,cmdl); if (result == 0) result = csoundPerform(csound); csoundDestroy(csound); } - (IBAction)compileAndRenderRealtime:(id)sender { [self performSelectorInBackground:@selector(doRender) withObject:nil]; } I was able to render multiple times if I did them one after the other. If I tried to do two renders at the same time, I got a crash. Turning back on pa_bl, I could render multiple renders at the same time. Turning back pa_cb after using pa_bl, the render crashes as before. I get the impression pa_cb is going to be fine on commandline, but in the context of a UI project, it's going to be problematic. I don't know understand the details of these crashes as of yet. steven On Thu, Aug 18, 2011 at 3:23 AM, Victor Lazzarini |
Date | 2011-08-18 14:46 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] [Csnd] Re: API crash after two or three compile/perform runs |
Thanks for your analyses. It looks like the situation is more complex than a simple crash. Maybe we will be able at least to have some guidelines of where the csound objects should be etc. Another good test is to see if QuteCsound works. If it does, at least we're in a less precarious situation, as it uses the API more or less how it should be used (in C/C++). I guess blue is another good litmus test, from the Java side. Victor On 18 Aug 2011, at 14:35, Steven Yi wrote: > Tested here with your test program, portmidi and pa_cb, no crashes. I > noticed a difference in that your test file creates one instance of > Csound then does compile/perform/reset, then a final destroy. The > other project did an init/perform/destroy each run. I modified test.c > and did not get any crashes there either. > > Ah... I just tried the original project. It crashed as before, but I > realized the code running csound was on the main thread (the UI > thread). However, once I modified code to run Csound of the main > thread: > > -(void)doRender { > CSOUND *csound = csoundCreate(NULL); > > char** cmdl = (char **) malloc(sizeof(char*)*(3)); > cmdl[0] = "csound"; > cmdl[1] = "/Users/stevenyi/Downloads/test.csd"; > cmdl[2] = "-odac"; > > int result = csoundCompile(csound,3,cmdl); > if (result == 0) result = csoundPerform(csound); > csoundDestroy(csound); > > > } > > - (IBAction)compileAndRenderRealtime:(id)sender { > > [self performSelectorInBackground:@selector(doRender) > withObject:nil]; > > } > > I was able to render multiple times if I did them one after the other. > If I tried to do two renders at the same time, I got a crash. > Turning back on pa_bl, I could render multiple renders at the same > time. > > Turning back pa_cb after using pa_bl, the render crashes as before. > > I get the impression pa_cb is going to be fine on commandline, but in > the context of a UI project, it's going to be problematic. I don't > know understand the details of these crashes as of yet. > > steven > > > On Thu, Aug 18, 2011 at 3:23 AM, Victor Lazzarini > |