Re: [Csnd] CSound6 Fluidsynth opcode
Date | 2013-08-08 09:54 |
From | Jacques Leplat |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
Hello Steven, I found that playing a CSD works first time. The second run crashes the app. This happens in CSD player as well as my app. All the best, Jacques Steven Yi |
Date | 2013-08-08 10:25 |
From | Steven Yi |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
Hi Jacques, Thanks for confirming. I'll see if I can find some time to look into this today. steven On Thu, Aug 8, 2013 at 10:54 AM, Jacques Leplat |
Date | 2013-08-12 15:21 |
From | Steven Yi |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
Hi Jacques, I think I've found the problem. I saw some code that was deleting all fluid engine instances when csound destroyed modules at end of run. However, the way it was coded, it looked like it didn't take into account if there was another Csound instance loaded. I think it's a condition that would depend on timing of loading. I think if an API app, not just on Android, had two instances of Csound using fluid opcodes, stopped one instance, it would cause the other to crash. I've rewritten the module cleanup code and at least here on my Nexus 4 I am now able to load/run/stop/re-run/stop/etc. multiple times without crash. I zipped up a compiled version of the fluidsynth plugin here: https://www.dropbox.com/s/k3uf1nb7z9sth9y/fluid-android.zip If you could try that out that'd be great. Michael: If you have chance, could you review the code change? Thanks! steven On Thu, Aug 8, 2013 at 10:54 AM, Jacques Leplat |
Date | 2013-08-12 16:17 |
From | Michael Gogins |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
Thanks. Yes, I will look at this tonight. BTW, I looked at the Java loading problem and am completely baffled. I will take another look at that tonight also. All the parts appear to be in place for this to work...
=========================== Michael GoginsIrreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Mon, Aug 12, 2013 at 10:21 AM, Steven Yi <stevenyi@gmail.com> wrote: Hi Jacques, |
Date | 2013-08-12 17:27 |
From | Jacques Leplat |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
Hello Steven, Thanks for the fix! I built csd player with it, and it runs csd's that use fluidsynth fine, more than once. Tried it on a Nexus 4 and a tablet running Android 4.0.4. All the best, Jacques On 12 Aug 2013, at 15:21, Steven Yi |
Date | 2013-08-12 17:27 |
From | Steven Yi |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
Hi Michael, Thanks on both accounts. Just FYI, for the Java issue, I tried running nm on both Csound5's library and Csound6's. CS5 oddly gave no symbols, and CS6's looks very different than what I expected. I don't know if that's useful information or not. I'm unable to compile Csound on Windows at the moment (still looking into this one) so am not sure what other info I can help with. Otherwise, if there's anything you want me to test, I'll be happy to do so. Thanks! steven On Mon, Aug 12, 2013 at 5:17 PM, Michael Gogins |
Date | 2013-08-12 17:33 |
From | Steven Yi |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
Hi Jacques, Thanks for confirming! Assuming Michael's review goes well, sounds like we'll have this fixed for future releases. Thanks! steven On Mon, Aug 12, 2013 at 6:27 PM, Jacques Leplat |
Date | 2013-08-13 03:17 |
From | Michael Gogins |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
I think your fix is correct, Steven. I rebuilt both Csound 6 and the Csound 6 android app, and both run (for me) as before. I can let the fluid test on Android run to completion and re-run it, or I can stop it and re-run it. Thanks, Mike =========================== Michael GoginsIrreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Mon, Aug 12, 2013 at 12:33 PM, Steven Yi <stevenyi@gmail.com> wrote: Hi Jacques, |
Date | 2013-08-13 08:05 |
From | Steven Yi |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
Hi Michael, Thanks for reviewing and testing this out! Steven On Aug 13, 2013 4:18 AM, "Michael Gogins" <michael.gogins@gmail.com> wrote:
|
Date | 2013-08-15 10:30 |
From | Jacques Leplat |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
Hello, I have managed to get the fluid synth opcode to run in my own app now, using Steven's shared library. Really happy with this, thanks again guys. I have noticed that some extra code needs to be added just to load the shared libraries. I am wondering if this could be better placed inside the CSound Android jar file somehow, as this looks like code that all android apps need to have in order to use the shared libraries. All the best, Jacques Below is the initialisation method I have written by pulling the code out of csd player, and placed in a CsoundObj wrapper class that I use: public void init(Context ctx) { // We ask for the data directory in case Android changes on // us without warning. try { packageInfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0); } catch (NameNotFoundException e) { MyLogger.e(TAG, "Failed to get package info", e); } OPCODE6DIR = ctx.getApplicationInfo().nativeLibraryDir; SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ctx); OPCODE6DIR = sharedPreferences.getString("OPCODE6DIR", OPCODE6DIR); SSDIR = packageInfo.applicationInfo.dataDir + "/samples"; SSDIR = sharedPreferences.getString("SSDIR", SSDIR); SFDIR = sharedPreferences.getString("SFDIR", SFDIR); SADIR = sharedPreferences.getString("SADIR", SADIR); INCDIR = sharedPreferences.getString("INCDIR", INCDIR); File file = new File(OPCODE6DIR); File[] files = file.listFiles(); MyLogger.d(TAG, "Loading Csound plugins..."); for (int i = 0; i < files.length; i++) { String pluginPath = files[i].getAbsoluteFile() .toString(); try { MyLogger.d(TAG, pluginPath); System.load(pluginPath); } catch (Throwable e) { MyLogger.e(TAG, "Error loading plugin " + pluginPath, e); } } // Evidently, this has to be set before // the very first Csound object is created. csnd6.csndJNI.csoundSetGlobalEnv("OPCODE6DIR", OPCODE6DIR); csnd6.csndJNI.csoundSetGlobalEnv("SFDIR", SFDIR); csnd6.csndJNI.csoundSetGlobalEnv("SSDIR", SSDIR); csnd6.csndJNI.csoundSetGlobalEnv("SADIR", SADIR); csnd6.csndJNI.csoundSetGlobalEnv("INCDIR", INCDIR); } On 13 Aug 2013, at 08:05, Steven Yi <stevenyi@gmail.com> wrote:
|
Date | 2013-08-19 03:32 |
From | Steven Yi |
Subject | Re: [Csnd] CSound6 Fluidsynth opcode |
Hi Jacques, Could you put a ticket into the Csound 6 tracker on Sourceforge for this? (include the information from this email) Thanks! steven On Thu, Aug 15, 2013 at 5:30 AM, Jacques Leplat |