[Cs-dev] Csound 6 on Android
Date | 2013-06-05 12:24 |
From | Michael Gogins |
Subject | [Cs-dev] Csound 6 on Android |
Attachments | None None |
I have added instructions for building on Android to the android directory.
I have also added an install_libs.sh script for copying "local" libs, which the NDK uses for building the Android Csound 6 shared library, to the "installation" libs directories. These libraries are then automatically packed up by the CsoundAndroid and CSDPlayer projects, and end up in the CsoundApp.apk archive's libs directory.
I do not know if this is sufficient for Csound to pick up plugin opcodes, but I will know pretty soon. I found this script much easier than the canonical approach, which I tried and failed to get to work.
Currently the installed libs are signalflowgraph, luajit, stdutils, and fluidOpcodes. Regards, Mike Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2013-06-05 15:00 |
From | Steven Yi |
Subject | Re: [Cs-dev] Csound 6 on Android |
Hi Michael, I'm finding the build instructions confusing. The way it was before was: 1. There is a CsoundAndroid project contained the prebuilt libcsoundandroid.so. This was setup as a library project, so that if you started new Csound for Android based projects, all you had to do was add CsoundAndroid as a library project to your new project, then you'd have everything needed. 2. The libraries were set to build using dependencies found in a folder called "android" that was placed in the same folder as the csound6 src root. 3. The projects were set to build with platform 10 as a default. This is to get the widest coverage of Android devices. Some things I'm seeing from the instructions and this email (note, I've been busy apartment hunting and dealing with the mac osx installer, so if I've misread something, please correct me!): 1. Your instructions mention building for ICS and up. I think the defaults and instructions should mention and build for platform 11 and up, to get Android 2.3.4+. This is to support older android devices, as Gingerbread still makes up 36.4% of the active device market (according to http://developer.android.com/about/dashboards/index.html). 2. I question the use use of install_libs.sh automatically from build.sh. I'd rather just have the developer call it. Really, I'd rather there be an install_lib.sh in each opcode plugin project, so you could do ./build.sh;./install_lib.sh. The reason for this is that to have install_lib.sh called during the normal build means there's a dependency relationship between the core csound library and the plugins, but that's not the relationship that makes sense. Why not put the install_libs.sh script a location higher, put it into the CSDPlayer project? Also, I question the design here of installing these opcodes into the lib folder. AFAIK, the lib folder is really used for native libs that are used as JNI libs. The opcode libraries really are only loaded by native code by Csound. They should, IMO, be installed elsewhere (as mentioned in the email thread: http://sourceforge.net/mailarchive/message.php?msg_id=30922820). Also, we know loading of libraries works from any folder from the exploratory work: http://sourceforge.net/mailarchive/message.php?msg_id=29957081 with loading stdutil (I think the fluidopcodes stuff was worked out on the user list). The code from that link should probably be changed to: csound.SetGlobalEnv("OPCODE6DIR", SOME_LOCATION_IN_PROJECT); I think the critical thing we need to really figure out is: what is the default mechanism we should use for loading opcode libraries? If we figure this out, we can design the rest around it. Thanks! steven On Wed, Jun 5, 2013 at 7:24 AM, Michael Gogins |
Date | 2013-06-05 16:02 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Csound 6 on Android |
Attachments | None None |
What in particular is confusing about the directions? Tell me and I will clarify them. The differences between the old way and the new way are: ALL native lib trees go into pluginlibs, no exceptions. ALL native lib builds are run manually from their tree/jni directory as $NDK/ndk-build. Except for the csoundandroid build, which uses ./build.sh
Now about what to do about your comments: I will move the platform back the original 10. The reason I moved the targeting forward is simply that I like the look and feel I'm getting with newer Android.
I will make install_libs.sh a manual or optional step. But these libs do belong in the csoundandroid project, as they called by native Csound, not by an app. Putting them where they are guarantees they get installed in the archive. If there is another easy way to get them installed, I will change from libs to an opcode6dir somewhere. Could it be as simple as libs/archxx/opcode6dir?
I'm glad to hear that plugins do get loaded. What are the alternative mechanisms for loading opcode libraries on Android? Finally, what do you think needs to be in CsoundApp to be considered a final release? Best, Mike On Wed, Jun 5, 2013 at 10:00 AM, Steven Yi <stevenyi@gmail.com> wrote: Hi Michael, Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2013-06-05 20:05 |
From | Steven Yi |
Subject | Re: [Cs-dev] Csound 6 on Android |
Hi Michael, (Replies inline below) On Wed, Jun 5, 2013 at 11:02 AM, Michael Gogins |
Date | 2013-06-05 20:30 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Csound 6 on Android |
Attachments | None None |
Thanks for your comments. About CSOUND_SRC_ROOT, you are correct. I have already changed the Android.mk files to use relative paths, because I realized this myself. If there are any more to change I will take care of it.
I will rewrite the build instructions to take your suggestions, which are good, into account.
I will move back to platform 11. There is not a built-in text editor, but text editing works by Intent with the freebie Jota text editor and perhaps with other text editors as well. I won't use --opcode-lib=/path/to/.so as I think this is too technical for most users, but I will research the best practice for dynamically loading libraries on Android and where to put them, then set OPCODE6DIR for that in code. This could be an overrideable app setting.
Best, Mike Michael Gogins Irreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Wed, Jun 5, 2013 at 3:05 PM, Steven Yi <stevenyi@gmail.com> wrote: Hi Michael, |
Date | 2013-06-05 20:36 |
From | Steven Yi |
Subject | Re: [Cs-dev] Csound 6 on Android |
Thanks Mike! BTW: If I haven't said it before, I think these are all really good things you're doing and that these changes are leading us all in the right direction. The confusions I have are just that, and I think at the end of this we'll all be better off. So thanks very much! On Wed, Jun 5, 2013 at 3:30 PM, Michael Gogins |
Date | 2013-06-05 21:10 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Csound 6 on Android |
Attachments | None None |
Thanks! I'm very, very excited by this work. I probably said something like this before, but having Csound and LuaJIT on my belt, with the ability to program, and faster than a lot of cheap laptops, and with all the many cool sensors on the phone like the accelerometer and the camera, is just MIND-BLOWING!
It's even starting to get me interested in live performance... If I could edit with ease, I'd be happy to routinely compose on the phone. Of course I would still need to use the computer for development, but that too will change, I can see that more and more developer tools are appearing for Android.
Does Csound support USB MIDI on Android? Some devices will receive MIDI from a host USB cable if the device supports "host mode" USB. I'm trying to figure out if my phone will do that... I have a USB MIDI interface I can try.
Again, thanks to you, and John and his students, and Victor, and the other Csound developers, Csound 6 is at the head of the class here. Best, Mike Michael Gogins Irreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Wed, Jun 5, 2013 at 3:36 PM, Steven Yi <stevenyi@gmail.com> wrote: Thanks Mike! BTW: If I haven't said it before, I think these are all |
Date | 2013-06-05 22:36 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Csound 6 on Android |
Attachments | None None |
I am not sure how to get MIDI on Android. Last time I looked, there was no API for it. Maybe it might be possible to use some sort of raw serial input, but I am not certain. Victor On 5 Jun 2013, at 21:10, Michael Gogins wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |