Android NDK native-audio example crashes

488 views
Skip to first unread message

BT

unread,
Aug 1, 2011, 1:15:36 PM8/1/11
to android-ndk
Hi.

I've built the native-audio example and downloaded it to my Galaxy Tab
10.1, but it doesn't work. It looks like it's going to start (i.e. the
window name appears across the top), but then crashes hard. I'm hoping
someone might have an idea as to why? Is it perhaps a problem with
audio support on the Tab, or...?

I also tried creating my own very simple native activity using
"android_native_app_glue" and it crashes too -- even though I make no
OpenSL calls. In fact, all I have to do is add -lOpenSLES to my
LOCAL_LDLIBS to cause a startup crash. When I remove that linker flag,
no crash. Very odd and makes me think there's just something missing
from the Tab with regards to native audio support?

Related LogCat Warnings & Errors below.

Cheers,
BT



08-01 10:13:54.040: ERROR/AndroidRuntime(6309): Set to default
setting_6 : region=-Duser.region=US propRegn=US
08-01 10:13:54.220: ERROR/Environment(29479): getExternalStorageState/
mnt/sdcard
08-01 10:13:54.220: WARN/ActivityManager(288): No content provider
found for:
08-01 10:13:54.250: WARN/ActivityManager(288): No content provider
found for:
08-01 10:13:54.740: ERROR/wpa_supplicant(583): Ongoing Scan action...
08-01 10:13:54.960: ERROR/AndroidRuntime(6338): Set to default
setting_6 : region=-Duser.region=US propRegn=US
08-01 10:13:55.570: WARN/dalvikvm(6348): threadid=1: thread exiting
with uncaught exception (group=0x4016d760)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): FATAL EXCEPTION: main
08-01 10:13:55.580: ERROR/AndroidRuntime(6348):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.native_activity/android.app.NativeActivity}:
java.lang.IllegalArgumentException: Unable to load native library: /
data/data/com.example.native_activity/lib/libnative-activity.so
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1751)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1767)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
android.app.ActivityThread.access$1500(ActivityThread.java:122)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1005)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
android.os.Handler.dispatchMessage(Handler.java:99)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
android.os.Looper.loop(Looper.java:132)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
android.app.ActivityThread.main(ActivityThread.java:4028)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
java.lang.reflect.Method.invokeNative(Native Method)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
java.lang.reflect.Method.invoke(Method.java:491)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:844)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
dalvik.system.NativeStart.main(Native Method)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): Caused by:
java.lang.IllegalArgumentException: Unable to load native library: /
data/data/com.example.native_activity/lib/libnative-activity.so
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
android.app.NativeActivity.onCreate(NativeActivity.java:199)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1048)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1715)
08-01 10:13:55.580: ERROR/AndroidRuntime(6348): ... 11 more
08-01 10:13:55.580: WARN/ActivityManager(288): Force finishing
activity com.example.native_activity/android.app.NativeActivity
08-01 10:13:55.600: ERROR/android.os.Debug(288): Dumpstate > /data/log/
dumpstate_app_error
08-01 10:13:56.100: WARN/ActivityManager(288): Activity pause timeout
for ActivityRecord{409f95b0 com.example.native_activity/
android.app.NativeActivity}
08-01 10:14:01.790: WARN/ActivityManager(288): Scheduling restart of
crashed service com.sec.android.app.factorytest/
com.sec.android.app.dftrilsupport.dftcommandaction.DftRilActionService
in 5000ms
08-01 10:14:01.790: WARN/ActivityManager(288): Scheduling restart of
crashed service com.sec.android.app.factorytest/
com.sec.android.app.dftrilsupport.dftrilcommunicator.DftRilCommandSender
in 15000ms
08-01 10:14:01.800: WARN/ActivityManager(288): Scheduling restart of
crashed service com.sec.phone/.SecPhoneService in 24990ms
08-01 10:14:04.470: WARN/InputManagerService(288): Window already
focused, ignoring focus gain of:
com.android.internal.view.IInputMethodClient$Stub$Proxy@418efc00

Philippe Simons

unread,
Aug 2, 2011, 4:04:11 AM8/2/11
to andro...@googlegroups.com
just an other broken Samsung device...

try to find on your device libOpenSLES.so, on my HTC Desire, it's located in /system/lib folder


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


mic _

unread,
Aug 2, 2011, 4:06:39 AM8/2/11
to andro...@googlegroups.com
Maybe the lib has a different name on your device. Or maybe it's missing. As Philippe suggested, try looking for it with  adb shell ls /system/lib/

/Michael

On Mon, Aug 1, 2011 at 7:15 PM, BT <bungles...@gmail.com> wrote:

BT

unread,
Aug 2, 2011, 11:59:43 AM8/2/11
to android-ndk
Thanks!

The only files I see that look relevant are: liba2dp.so, libaudio.so,
libaudioflinger.so, libaudiopolicy.so, libeffects.so, libm.so,
libmedia.so, libmediaplayerservices.so, libvmm_audio.so, and
libsoundpool.so. No libOpenSLES.so in that directory.

Could it be a version issue? My assumption was that API/SDK levels
are forward-compatible, meaning if OpenSL was introduced in 9 then it
exists in 12. That would mean phone v2.3 and tablet v3.1 both have
it, but since those are divergent branches I'm thinking my assumption
may be incorrect?

Cheers,
BT


On Aug 2, 1:06 am, mic _ <micol...@gmail.com> wrote:
> Maybe the lib has a different name on your device. Or maybe it's missing. As
> Philippe suggested, try looking for it with  adb shell ls /system/lib/
>
> /Michael
>

mic _

unread,
Aug 2, 2011, 12:42:18 PM8/2/11
to andro...@googlegroups.com
Was this a device that you got directly from Samsung at some event? Because I've seen another thread in the past where someone had received a "pre-market" device from Samsung that was missing libOpenSLES. 
Perhaps you could contact Samsung about getting an update or some other solution.

/Michael

BT

unread,
Aug 2, 2011, 1:13:01 PM8/2/11
to android-ndk
It came in a retail box, not from an event. Not sure where they were
sourced, but probably directly from Samsung as we got them pretty
early on from a wholesale distributor our parent company works with
(don't know the name).

Hopefully it arrives with the new Tab Honeycomb update...
Reply all
Reply to author
Forward
0 new messages