[Cs-dev] Compiling utilities for Android
Date | 2012-10-05 14:33 |
From | "c.m.bryan" |
Subject | [Cs-dev] Compiling utilities for Android |
Attachments | None None |
Hi everyone, I'm new to the list! I'm really excited about the possibilities for csound on android. What I am trying to do at the moment is process files with pvanal and save the output to disk for later manipulation and re-synthesis. I can do this at realtime speed with the pvsanal opcode, no problem. However, I would like to run the standalone utility so that I can process the file at greater-than 1x. On android this fails with "Error: utility 'pvanal' not found", and I think that this is because the plugin opcodes, etc. are not present. Could anyone give me advice on how to proceed? Would it be possible to build the utilities as a separate library and include them? I've been able to compile them as a separate shared library, but I haven't been able to make csound "see" it. Perhaps I'm missing something simple? In the Android.mk I've added at the top: ==== LOCAL_MODULE := stdutil LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../H $(LOCAL_PATH)/../../../ $(LIBSNDFILE_SRC_DIR) $(LOCAL_PATH)/../../../Engine $(LOCAL_PATH)/../../../interfaces LOCAL_CFLAGS := -O3 -D__BUILDING_LIBCSOUND -DENABLE_NEW_PARSER -DLINUX -DHAVE_DIRENT_H -DHAVE_FCNTL_H -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H -DHAVE_TERMIOS_H LOCAL_CPPFLAGS :=$(LOCAL_CFLAGS) ### LOCAL_SRC_FILES := $(CSOUND_SRC_ROOT)/util/pvanal.c \ $(CSOUND_SRC_ROOT)/util/pv_export.c \ $(CSOUND_SRC_ROOT)/util/pv_import.c \ $(CSOUND_SRC_ROOT)/util/pvlook.c \ $(CSOUND_SRC_ROOT)/util/std_util.c include $(BUILD_SHARED_LIBRARY) ==== and later on when building csoundandroid: ==== LOCAL_SHARED_LIBRARIES := stdutil ==== Thanks! -cm.bryan |
Date | 2012-10-05 15:14 |
From | Steven Yi |
Subject | Re: [Cs-dev] Compiling utilities for Android |
Hi Chris, One option is if you have the libstdutil.so built, you could try a test by putting it on your SD card, then try adding --opcode-lib=/sdcard/libstdutil.so when running Csound. (Have not tried any opcode loading myself) Thanks, steven On Fri, Oct 5, 2012 at 2:33 PM, c.m.bryan |
Date | 2012-10-06 21:46 |
From | "c.m.bryan" |
Subject | Re: [Cs-dev] Compiling utilities for Android |
Attachments | Android.mk None None |
Hi Steven, thanks for your response and also for your presentation at LAC, which got me started :) I wasn't aware of the '--opcode-lib' flag, thanks... but unfortunately, it hasn't delivered a result yet. It doesn't give any errors, but I still get the "utility 'pvanal' not found" result. The library is copied to the sdcard, as you suggest. I don't know if you or anyone else can perhaps see something I've done wrong, or else suggest an alternate approach. Attached is the Android.mk file from the CsoundAndroid project, to which I've prepended the bit to build the pvanal utility. I also included it as a dependency in the csoundandroid library for good measure ;) but that doesn't seem to have an effect either (but it also doesn't break anything). Have I missed a necessary source file perhaps, or make some other mistake? Thanks again! -cm.bryan On 5 October 2012 15:14, Steven Yi <stevenyi@gmail.com> wrote: Hi Chris, |
Date | 2012-10-06 22:23 |
From | "c.m.bryan" |
Subject | Re: [Cs-dev] Compiling utilities for Android |
Attachments | None None |
Just thinking out loud now... how about cross-compiling the standalone utility? Am looking at the following tutorials, and will report back! http://bit.ly/RlTU72 http://bit.ly/PJ6N9F -cm.bryan On 6 October 2012 21:46, c.m.bryan <chrismbryan@gmail.com> wrote: Hi Steven, thanks for your response and also for your presentation at LAC, which got me started :) |
Date | 2012-10-07 09:58 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Compiling utilities for Android |
Attachments | None None |
Hi Chris, utilities in Csound are plugins. They are built separately as modules which are loaded when Csound runs. Currently, we have not been using plugins, because of simplicity. But I think they might work on Android, we just have to work out two things 1) how to build them (they are .so files so that should be OK) 2) where to place them in the bundle 3) how to load them (basically how to tell Csound where they are, as the dlopen mechanism should work as usual). This is a bit of work that myself and Steven are planning to do together, we just have to schedule it in our diaries. You're welcome to try solutions for them, but maybe it will be easier for you to wait until we sort the mechanism. Regards Victor On 6 Oct 2012, at 22:23, c.m.bryan wrote: Just thinking out loud now... how about cross-compiling the standalone utility? Am looking at the following tutorials, and will report back! Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2012-10-07 19:54 |
From | "c.m.bryan" |
Subject | Re: [Cs-dev] Compiling utilities for Android |
Attachments | None None |
Thanks for the explanation, Victor. I appreciate that this is all very new! I'm sure you can see that it would be valuable to pre-process audio with the utilities on a mobile platform where realtime resources are limited. Looking forward to seeing how you and Steven get on :) -cm.bryan On 7 October 2012 09:58, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
|
Date | 2012-10-12 12:30 |
From | Steven Yi |
Subject | Re: [Cs-dev] Compiling utilities for Android |
Hi Chris, So Victor and I just completed a test and we successfully were able to load a plugin library on Android! In Csound5 GIT, you can find a libstdutil project that has been added. To load, we copied the libs folder to the sdcard, then we used this code: AndroidCsound csound = new AndroidCsound(); csound.SetGlobalEnv("OPCODEDIR", "/sdcard/libs/armeabi-v7a"); csound.PreCompile(); csound.Compile("-Upvanal"); The key to this is calling SetGlobalEnv before PreCompile is set. That way, Csound will use that directory to load opcode libraries. We'll have to evaluate how to handle this in CsoundObj; perhaps we'll hardcode it to the folder where res/raw is, so that if you want to add libraries to your project, all you'd have to do is copy them into res/raw. (Though, there may be issues with that due to armv5 vs. armv7, we'll sort that out sometime). Otherwise, hopefully this should let you continue on with your tests. Cheers! steven On Sun, Oct 7, 2012 at 7:54 PM, c.m.bryan |
Date | 2012-10-12 14:09 |
From | "c.m.bryan" |
Subject | Re: [Cs-dev] Compiling utilities for Android |
Attachments | None None |
That's wonderful! Looking forward to taking it for a test drive ;) -cm.bryan On 12 October 2012 12:30, Steven Yi <stevenyi@gmail.com> wrote: Hi Chris, |
Date | 2012-10-16 13:49 |
From | "c.m.bryan" |
Subject | Re: [Cs-dev] Compiling utilities for Android |
Attachments | None None |
Hi Steven, Victor et al, Finally got to sit down and try out the new library loading mechanism. Everything seems to be loading OK, but I can't find any documentation on using the CsoundAndroid class, rather than CsoundObj. Am I missing something obvious? -Chris
|
Date | 2012-10-16 14:43 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Compiling utilities for Android |
Attachments | None None |
CsoundAndroid is derived from Csound. So you can look at the documentation for the Csound API (the Csound.h and Csound.hpp header files in the Csound sources will have a good deal of information). Victor On 16 Oct 2012, at 13:49, c.m.bryan wrote: Hi Steven, Victor et al, Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |