dllDirStr - Where to find plugin DLLs?

23 views
Skip to first unread message

Trevor Adams

unread,
Mar 23, 2012, 8:49:27 PM3/23/12
to supercollider-android-developers
Hello there.

I've been trying to to make a simple application using SC following
this tutorial:

https://github.com/glastonbridge/SuperCollider-Android/wiki/Use-SuperCollider-in-your-Android-Activity

...but my program crashes on the line "superCollider = new
SCAudio(dllDirStr);" It's not clear to me from the tutorial whether
the definition of dllDirStr needs to be changed (from "/data/data/
net.sf.supercollider.android/lib"), and if so, to what.

I can still try running SC as a service, but it would be good to have
this as an option. I'm running a Ubuntu 10.04 VM on a 64 bit Windows
7 machine (long story). Let me know if you have any suggestions,
thanks!

Trevor


Error:
03-24 00:20:43.557: W/dalvikvm(539): Exception Ljava/lang/
UnsatisfiedLinkError; thrown while initializing Lnet/sf/supercollider/
android/SCAudio;
03-24 00:20:43.566: D/AndroidRuntime(539): Shutting down VM
03-24 00:20:43.566: W/dalvikvm(539): threadid=1: thread exiting with
uncaught exception (group=0x409c01f8)
03-24 00:20:43.597: E/AndroidRuntime(539): FATAL EXCEPTION: main
03-24 00:20:43.597: E/AndroidRuntime(539):
java.lang.ExceptionInInitializerError
03-24 00:20:43.597: E/AndroidRuntime(539): at
tadams.scTest.HelloSuperColliderActivity.onCreate(HelloSuperColliderActivity.java:
27)
03-24 00:20:43.597: E/AndroidRuntime(539): at
android.app.Activity.performCreate(Activity.java:4465)
03-24 00:20:43.597: E/AndroidRuntime(539): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1049)
03-24 00:20:43.597: E/AndroidRuntime(539): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1920)
03-24 00:20:43.597: E/AndroidRuntime(539): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1981)
03-24 00:20:43.597: E/AndroidRuntime(539): at
android.app.ActivityThread.access$600(ActivityThread.java:123)
03-24 00:20:43.597: E/AndroidRuntime(539): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)

Dan Stowell

unread,
Mar 25, 2012, 3:22:21 PM3/25/12
to supercollider-an...@googlegroups.com
Hi -

"/data/data/net.sf.supercollider.android/lib" may be wrong depending
on your android device. Do you know where application data is normally
stored? If so change the first bit "/data/data". There is in fact an
android SDK call to ask where the data folder is, and maybe you can
use that and it'll work fine - on our development device (a while ago
now, many android versions ago) that call didn't work properly.

Best
Dan


2012/3/24 Trevor Adams <trevor...@gmail.com>:

--
http://www.mcld.co.uk

Trevor Adams

unread,
Mar 27, 2012, 5:02:09 PM3/27/12
to supercollider-android-developers
Thank you very much for your help. I haven't been able to determine
the application data directory on my physical phone (Nexus S), but the
emulator's path is "data/data", and the program fails there as well.
I'm wondering if the files are failing to upload to the lib folder at
all. The guide doesn't mention anything, but does anything need to be
done to load those files (besides including SuperColliderActivity as a
library)? The Android Developer page linked to in the guide mentions
a <use-library> tag in the manifest, but after looking at that, I
wasn't sure it was relevant. Adding it results in an
"INSTALL_FAILED_MISSING_SHARED_LIBRARY" error.

Thank you again for your help.

Source:
package tadams.scTest;

import android.app.Activity;
import android.media.AudioManager;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import net.sf.supercollider.android.SCAudio;
import net.sf.supercollider.android.ScService;
import net.sf.supercollider.android.OscMessage;

public class HelloSuperColliderActivity extends Activity implements
OnTouchListener {

public static final String dllDirStr = "/data/data/tadams.scTest/
lib";// Where to find the plugin DLLs
//public static final String dllDirStr = "/Android/data/
net.sf.supercollider.android/lib";// Where to find the plugin DLLs
private SCAudio superCollider;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

// Starting SuperCollider:
superCollider = new SCAudio(dllDirStr);
superCollider.start();

superCollider.sendMessage(OscMessage.createSynthMessage("default",
999, 0, 1));//create synth
}

...
}

Complete Error (chopped off bottom last time):
03-24 00:20:43.057: D/dalvikvm(539): Not late-enabling CheckJNI
(already on)
android.os.Handler.dispatchMessage(Handler.java:99)
03-24 00:20:43.597: E/AndroidRuntime(539): at
android.os.Looper.loop(Looper.java:137)
03-24 00:20:43.597: E/AndroidRuntime(539): at
android.app.ActivityThread.main(ActivityThread.java:4424)
03-24 00:20:43.597: E/AndroidRuntime(539): at
java.lang.reflect.Method.invokeNative(Native Method)
03-24 00:20:43.597: E/AndroidRuntime(539): at
java.lang.reflect.Method.invoke(Method.java:511)
03-24 00:20:43.597: E/AndroidRuntime(539): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-24 00:20:43.597: E/AndroidRuntime(539): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-24 00:20:43.597: E/AndroidRuntime(539): at
dalvik.system.NativeStart.main(Native Method)
03-24 00:20:43.597: E/AndroidRuntime(539): Caused by:
java.lang.UnsatisfiedLinkError: Couldn't load sndfile: findLibrary
returned null
03-24 00:20:43.597: E/AndroidRuntime(539): at
java.lang.Runtime.loadLibrary(Runtime.java:365)
03-24 00:20:43.597: E/AndroidRuntime(539): at
java.lang.System.loadLibrary(System.java:535)
03-24 00:20:43.597: E/AndroidRuntime(539): at
net.sf.supercollider.android.SCAudio.<clinit>(SCAudio.java:56)
03-24 00:20:43.597: E/AndroidRuntime(539): ... 15 more

Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tadams.scTest"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="15" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<!-- <uses-library
android:name="net.sf.supercollider.android" />-->
<activity
android:name=".HelloSuperColliderActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
On Mar 25, 12:22 pm, Dan Stowell <danstow...@gmail.com> wrote:
> Hi -
>
> "/data/data/net.sf.supercollider.android/lib" may be wrong depending
> on your android device. Do you know where application data is normally
> stored? If so change the first bit "/data/data". There is in fact an
> android SDK call to ask where the data folder is, and maybe you can
> use that and it'll work fine - on our development device (a while ago
> now, many android versions ago) that call didn't work properly.
>
> Best
> Dan
>
> 2012/3/24 Trevor Adams <trevorbad...@gmail.com>:
>
>
>
>
>
>
>
>
>
> > Hello there.
>
> > I've been trying to to make a simple application using SC following
> > this tutorial:
>
> >https://github.com/glastonbridge/SuperCollider-Android/wiki/Use-Super...

Dan Stowell

unread,
Mar 28, 2012, 5:27:46 AM3/28/12
to supercollider-an...@googlegroups.com
Aha,

Well this is the telltale line:

03-24 00:20:43.597: E/AndroidRuntime(539): Caused by:
java.lang.UnsatisfiedLinkError: Couldn't load sndfile: findLibrary
returned null

Have you run the NDK compilation? You need to do the native NDK build
as well as the java-based SDK build, because supercollider (and
libsndfile, which is used by supercollider) are both native (C/C++)
code.

Step 5 here:
https://github.com/glastonbridge/SuperCollider-Android/wiki/Get-a-development-branch

If you do this right then you *should* get sndfile and supercollider
DLLs and they should be pushed when you push your activity. That work?
(It's a while since I've done it myself)

Dan


2012/3/27 Trevor Adams <trevor...@gmail.com>:

--
http://www.mcld.co.uk

Trevor Adams

unread,
Mar 28, 2012, 4:15:43 PM3/28/12
to supercollider-android-developers
Thank you! I had in fact missed that step. My app now installs and
plays!

Incidentally, when trying to run the compiled SuperColliderAndroid
project itself, I have the same problem described in the "Compiling
problems" thread (link below). The app loads on the emulator but
encounters numerous errors. Running the app on a phone results in a
"ClassCastException" crash. However, using the project as a library
(and not a service) appears to work just fine, which is what Ii had
been planning.

Thanks again for your help! Sorry I didn't include the full error
before.

Trevor


"Compiling Problems":
http://groups.google.com/group/supercollider-android-developers/browse_thread/thread/8aecd8a0efb539ff?hl=en

On Mar 28, 2:27 am, Dan Stowell <danstow...@gmail.com> wrote:
> Aha,
>
> Well this is the telltale line:
>
> 03-24 00:20:43.597: E/AndroidRuntime(539): Caused by:
> java.lang.UnsatisfiedLinkError: Couldn't load sndfile: findLibrary
> returned null
>
> Have you run the NDK compilation? You need to do the native NDK build
> as well as the java-based SDK build, because supercollider (and
> libsndfile, which is used by supercollider) are both native (C/C++)
> code.
>
> Step 5 here:https://github.com/glastonbridge/SuperCollider-Android/wiki/Get-a-dev...
>
> If you do this right then you *should* get sndfile and supercollider
> DLLs and they should be pushed when you push your activity. That work?
> (It's a while since I've done it myself)
>
> Dan
>
> 2012/3/27 Trevor Adams <trevorbad...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages