[Csnd] lib_csnd.dylib doubles problem
Date | 2010-05-20 20:23 |
From | Peiman Khosravi |
Subject | [Csnd] lib_csnd.dylib doubles problem |
Hello, I think there is still something wrong with lib_csnd.dylib doubles on OS X as blue crashes when run in api mode. Thanks Peiman |
Date | 2010-05-20 21:07 |
From | Victor.Lazzarini@nuim.ie |
Subject | [Csnd] Re: lib_csnd.dylib doubles problem |
Attachments | None |
Date | 2010-05-21 00:37 |
From | Peiman Khosravi |
Subject | [Csnd] Re: Re: lib_csnd.dylib doubles problem |
I guess it's the one in framework, I think that's the one blue tries to access? Thanks P On 20 May 2010, at 21:07, Victor.Lazzarini@nuim.ie wrote: > yes, there might be a link problem there. Did you try the > lib_csnd.dylib inside the framework or the one in /usr/local/lib? > > ----- Original Message ----- > From: Peiman Khosravi |
Date | 2010-05-21 00:47 |
From | Peiman Khosravi |
Subject | [Csnd] Re: Re: lib_csnd.dylib doubles problem |
I don't know if it's normal but I have these in /usr/local/lib lib_csnd.dylib lib_csnd64.dylib libcsnd.dylib libcsnd64.dylib And only lib_csnd.dylib in CsoundLib64.framework And I get this line in blue's crash report: Thread 23 Crashed: 0 lib_csnd.dylib 0x51266738 CsoundCallbackWrapper::SetMessageCallback() + 24 On 20 May 2010, at 21:07, Victor.Lazzarini@nuim.ie wrote:
|
Date | 2010-05-21 02:06 |
From | Steven Yi |
Subject | [Csnd] Re: lib_csnd.dylib doubles problem |
I've had problems getting the API working on OSX myself. It could be that the lib_csnd.dylib in /usr/local/lib is the issue, but it might also be the symlink in the java lib dir. I don't remember exactly where it is, but I know the installer was symlinking the 32 bit version instead of the doubles version (don't remember if that changed). I've had a note to look further into this but haven't found the time. If you figure it out, would love to know! On 5/20/10, Peiman Khosravi |
Date | 2010-05-21 10:27 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Re: Re: lib_csnd.dylib doubles problem |
yes, the link should be to lib_csnd.dylib inside CsoundLIb64 framework. But Steven is right to say that the Java lib that is installed is linked to the 32 bit framework. I'll see if I can sort all of this out for the next release. Victor On 21 May 2010, at 00:47, Peiman Khosravi wrote:
|
Date | 2010-05-21 10:58 |
From | Peiman Khosravi |
Subject | [Csnd] Re: Re: Re: Re: lib_csnd.dylib doubles problem |
Thanks very much. Peiman On 21 May 2010, at 10:27, Victor Lazzarini wrote:
|
Date | 2010-05-21 11:20 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
I had a quick look this morning and what I found was: the csound module installed in JavaVM.framework/Resources/Libraries is a symlink to the 32-bit framework. I have changed this to point to the 64-bit framework, but blue is still crashing 21/05/2010 11:08:40 com.apple.launchd[119] ([0x0-0x42a42a].blue[39891]) Exited with exit code: 138 21/05/2010 11:09:30 [0x0-0x42f42f].blue[39994] Invalid memory access of location 0x4 eip=0x5170b708 I checked the lib_csnd.jnilib and they are correct (both lib_csnd and CsoundLib are 64bit). Perhaps Steven might be able to cast some light onto this. Victor On 21 May 2010, at 10:58, Peiman Khosravi wrote:
|
Date | 2010-05-21 11:27 |
From | Peiman Khosravi |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
Just to confirm, I tried changing it too and blue still crashes. P On 21 May 2010, at 11:20, Victor Lazzarini wrote:
|
Date | 2010-05-21 11:56 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
Ok, just to complement this discussion. I built the CSDPlayer.java example from examples/java and tested it (the same program, no re-build was needed) with both floats and doubles (by changing the symlink in JavaVM.framework/libraries). Both versions ran without any problems, as I would expect. I think it should not matter whether the link is to floats or doubles, unless you are assuming specific MYFLT sizes in the java code, wrapping pointers or something like that. The same java compiled code should work with both. So I would expect blue to work with the installation as it is (I mean make a sound and not crash). I can change the installation to doubles (as I will probably do for python as well), but that should not matter as far as running the program is concerned. So I guess there might be a problem elsewhere. The Java module seems to be OK. Victor On 21 May 2010, at 11:27, Peiman Khosravi wrote:
|
Date | 2010-05-21 12:16 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
More diagnostics: it seems that the CsoundPerformanceThread class is causing crashes on Java. CSDPlayer uses its own java threading and does not rely on that class, that is one of the reasons it works. Victor On 21 May 2010, at 11:56, Victor Lazzarini wrote:
|
Date | 2010-05-21 12:39 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
Further findings: The problem I identified was in CsoundEditor.java: it seems that a combination of the CppSound class and CsoundPerformanceThread is causing the problem. However, using the Csound class and CsoundPerformanceThread is perfectly fine. I have adapted CSDPlayer to use it and it's OK. So if blue is using CppSound, then the problem might be there. Regards Victor On 21 May 2010, at 12:16, Victor Lazzarini wrote:
|
Date | 2010-05-21 12:55 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
And I bet this is because CppSound is derived from two base classes and I don't think Java likes that. Victor On 21 May 2010, at 12:39, Victor Lazzarini wrote:
|
Date | 2010-05-21 15:09 |
From | Steven Yi |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
Hi Victor, Thanks very much for your time in looking into this! I'll have to look further into what is going on, as blue uses Csound and not CppSound, and it also uses Java threads and does not use CsoundPerformanceThread. I think I'll finally have some time to look into this today and will try to see if I can get anywhere. Thanks! steven On Fri, May 21, 2010 at 7:55 AM, Victor Lazzarini |
Date | 2010-05-21 15:14 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
OK, if that is the case, then take a look at the CSDPlayer example in the sources. That works fine, so it should help you in your diagnosis. On 21 May 2010, at 15:09, Steven Yi wrote: > Hi Victor, > > Thanks very much for your time in looking into this! > > I'll have to look further into what is going on, as blue uses Csound > and not CppSound, and it also uses Java threads and does not use > CsoundPerformanceThread. I think I'll finally have some time to look > into this today and will try to see if I can get anywhere. > > Thanks! > steven > > > On Fri, May 21, 2010 at 7:55 AM, Victor Lazzarini > |
Date | 2010-05-21 19:49 |
From | Steven Yi |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
I haven't had a chance to look at the CSDPlayer example, as I'm still having issues with getting the API to load at all. I think there's an issue having to do with 32bit/64bit versions of Java and trying to load the jnilib (jnilib is i386, but for some reason running blue from the app launcher keeps using the x86_64 version of Java). I think I need to figure out this issue first, then can work on the API issue. On Fri, May 21, 2010 at 10:14 AM, Victor Lazzarini |
Date | 2010-05-21 21:16 |
From | Steven Yi |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
Okay, I've isolated the problem. First problem is the 32bit/64bit. I know of a way to force 32bit Java to run on OS 10.6, but I don't think it works on non-10.6 OSX, so am still searching for the solution for that. (Emailed another mailing list for advice). After running with 32bit Java, I was able to reproduce the problem. Now, the error Victor posted earlier is the source of the problem: 0 lib_csnd.dylib 0x51266738 CsoundCallbackWrapper::SetMessageCallback() + 24 Setting the message callback causes the crash. If I comment that out, blue will run with the API without problems. I don't know of a solution for this yet, though this code works fine on other platforms, so am thinking it may be tricky to figure out the answer for this one. On Fri, May 21, 2010 at 2:49 PM, Steven Yi |
Date | 2010-05-22 11:22 |
From | Peiman Khosravi |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: lib_csnd.dylib doubles problem |
Hello, Just to mention that blue was working in api mode about one year ago when I used it extensively (also on OS X). So either something has changed in blue or in Csound since then. It might be worth trying it with the older version of blue to test. P On 21 May 2010, at 19:49, Steven Yi wrote: > I haven't had a chance to look at the CSDPlayer example, as I'm still > having issues with getting the API to load at all. I think there's an > issue having to do with 32bit/64bit versions of Java and trying to > load the jnilib (jnilib is i386, but for some reason running blue from > the app launcher keeps using the x86_64 version of Java). I think I > need to figure out this issue first, then can work on the API issue. > > On Fri, May 21, 2010 at 10:14 AM, Victor Lazzarini > |