[Cs-dev] LuaJIT for Android
Date | 2013-05-23 02:11 |
From | Michael Gogins |
Subject | [Cs-dev] LuaJIT for Android |
Attachments | None None |
Looking at the Android project in Csound 6, I see that you are building native plugins.
This provides a choice for me as to how best to support LuaJIT and the Lua opcodes for Csound 6 on Android:
(1) I can add the Lua opcodes and LuaJIT to your Android project's plugins directory. I think this is all, or nearly all, that needs to be done to get Lua working with Csound on Android. Any Lua code one likes can then be embedded in and run in the Csound orchestra header.
(2) I can produce a separate app that is basically a Lua editor/launcher with a built in Csound 6 library (and this would include the plugins also: fluidsynth, stdutil, and the Lua opcodes). What do you think is the best approach? By the way, there is a project called LuaJava that enables Lua code to call Java libraries. Apparently this can be gotten to work on Android with AndroLua. I'm not sure how well it works in practice, but it might possibly afford a means of implementing user-programmable widgets on Android.
Regards, Mike Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2013-05-23 13:10 |
From | Steven Yi |
Subject | Re: [Cs-dev] LuaJIT for Android |
I think either way is fine. Whether 1 or 2, the Lua stuff will need to be in an opcode plugin. If the plugin lib is going to be setup like fluidsynth where it's just a build recipe then that should be fine to add to pluginlibs. The CSDPlayer would be nice to have updates (i.e. built-in code editor). The plugin situation for Android still needs some resolution. Currently we know that libraries can be loaded as I had tested that. However, we have not determined what to do about packaging opcode libs with an application and telling CsoundObj to load from there. Just needs some research and experimentation. On Thu, May 23, 2013 at 2:11 AM, Michael Gogins |
Date | 2013-05-23 13:50 |
From | Michael Gogins |
Subject | Re: [Cs-dev] LuaJIT for Android |
Attachments | None None |
Perhaps I haven't made myself clear. Option 2 means that the code editor/launcher would be for LuaJIT, not for Csound. Then, using LuaJIT FFI, LuaJIT would be able to bind and execute Csound from the NDK native library only, no Java involved in the least. This would certainly be the fastest way to get things happening, and might be the best way for some weird people like me who just like to type. However, if you and the other developers are OK with it, I'll pursue option 1. I have done some research on loading native libraries from Java, it seems that you need to do it explicitly from Java and without error to have your app work, but in this case I think that will be fine. So that would be mean creating 2 additional pre-built libraries, LuaJIT itself and the Lua opcode plugin. The LuaJIT project has explicit instructions for building LuaJIT for Android using the NDK, so I don't see a problem there.
I'm also fine with updating the CSDPlayer with a proper code editor/log window. It may also be possible to integrate LuaJava to enable users to code Android widgets to order, but first things first.
Thanks, Mike On Thu, May 23, 2013 at 8:10 AM, Steven Yi <stevenyi@gmail.com> wrote: I think either way is fine. Whether 1 or 2, the Lua stuff will need Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2013-05-23 14:05 |
From | Steven Yi |
Subject | Re: [Cs-dev] LuaJIT for Android |
That makes it clearer about #2. If you're going for #2, then that makes sense to make it a separate project outside of csound that can depend on csound as a library. For #1, as long as these things are optional to build, and the CSD editor is going to work with the premise to just load libraries and not specifically anything with LuaJIT, that seems fine. Compiling with the NDK for Android is slow, so I want to make sure that building pluginOpcodes is completely separate as they are now. I think ideally, the CSDPlayer would have a folder that should be there for binary pluginOpcodes. When it builds, it would include whatever is there. The plugin opcodes then could be built separately and added to that folder for testing/deploying. That folder should also be in .gitignore. I'm (hopefully) pretty close to getting the Android CS6 build done. I got the NDK stuff building this morning and just got through updating the Java code. Audio is not running at the moment, likely due to the change in when audio callbacks is done. I've got a fix in mind and it should hopefully all be running soon. I'll email here when it's al running. On Thu, May 23, 2013 at 1:50 PM, Michael Gogins |
Date | 2013-05-23 14:46 |
From | Michael Gogins |
Subject | Re: [Cs-dev] LuaJIT for Android |
Attachments | None None |
Thanks for the update. I'm not sure what you mean by "For #1, as long as these things are optional to build, and the CSD editor is going to work with thepremise to just load libraries and not specifically anything with LuaJIT, that seems fine." LuaJIT is a library. Can you explain? Regards, Mike
On Thu, May 23, 2013 at 9:05 AM, Steven Yi <stevenyi@gmail.com> wrote: That makes it clearer about #2. If you're going for #2, then that Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2013-05-23 20:28 |
From | Steven Yi |
Subject | Re: [Cs-dev] LuaJIT for Android |
Sorry, that wasn't very clear. :) For the luaOpcodes, I think it'd be nice if they were implemented like the fluidOpcodes plugin library have been. That plugin lib has an Android.mk that includes the fluidOpcodes source files, as well as does an import-module to link it with the fluidsynth library that's contained in another folder outside of the csound6 source tree. For CSDPlayer, I think it should not have any build-time dependencies on any of the plugin libraries. This is so that testing and building of CSDPlayer won't trigger builds of the plugins, as building with the NDK is somewhat slow. So if you want to create LuaOpcodes, that's great. The CSDPlayer build can package with it any pre-built binary opcode libraries, but there should be no project or library links to trigger builds. Hopefully that's a bit clearer, if not, just let me know. Thanks, steven On Thu, May 23, 2013 at 2:46 PM, Michael Gogins |
Date | 2013-05-23 20:44 |
From | Michael Gogins |
Subject | Re: [Cs-dev] LuaJIT for Android |
Attachments | None None |
OK, that's clear, and that's great. In that case I'll proceed with the first option - integrating LuaJIT and the Lua opcodes with CSDPlayer, and adding a code editor and better logger. Do you know of any Android code editors with LGPL compatible licenses that can be used to edit CSDs and Lua? I've found one, Jota. By the way, I'm keeping a sort of log of what I do on my new blog at tumblr, michaelgogins.tumbler.com. You can find a post on http://michaelgogins.tumblr.com/post/50579775384/csound-on-my-telephone where I'm logging what I'm up to with this.
I moved my whole Web site to Tumblr because hosting it myself kept getting spammed. I was so pissed when Yahoo bought Tumblr. I hope they don't ruin it but they probably will, so I'll probably have to move it all again...
Best, Mike On Thu, May 23, 2013 at 3:28 PM, Steven Yi <stevenyi@gmail.com> wrote: Sorry, that wasn't very clear. :) For the luaOpcodes, I think it'd be Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2013-05-23 20:56 |
From | Steven Yi |
Subject | Re: [Cs-dev] LuaJIT for Android |
I haven't really looked for syntax highlighting code editors for Android, so can't help much there. It'd be nice to have some editing available on device. Just FYI: CS6 is running now on Android (tested the Examples and CSDPlayer today). I didn't test too much, but it was enough I think to merit a release for RC2. I've pushed that just now to Sourceforge's file release system. On Thu, May 23, 2013 at 8:44 PM, Michael Gogins |
Date | 2013-05-23 21:15 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] LuaJIT for Android |
Fantastic, well done. On 23 May 2013, at 20:56, Steven Yi wrote: > I haven't really looked for syntax highlighting code editors for > Android, so can't help much there. It'd be nice to have some editing > available on device. > > Just FYI: CS6 is running now on Android (tested the Examples and > CSDPlayer today). I didn't test too much, but it was enough I think to > merit a release for RC2. I've pushed that just now to Sourceforge's > file release system. > > On Thu, May 23, 2013 at 8:44 PM, Michael Gogins > |
Date | 2013-05-23 21:21 |
From | Michael Gogins |
Subject | Re: [Cs-dev] LuaJIT for Android |
Attachments | None None |
That's great. I really appreciate this work, and I'll try it as soon as I can. If I can't find a better editor, Jota is infinitely better than what we now have, so I'll start with that. It also has a native library...
We're going to have a hell of a thing here... Regards, Mike On Thu, May 23, 2013 at 3:56 PM, Steven Yi <stevenyi@gmail.com> wrote: I haven't really looked for syntax highlighting code editors for Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |