c - Realizing an outputMixObject in the Android NDK with OpenSL ES causes crash of application -


i trying implement opensl es project of mine, while doing so, crash of application. error occurs when try realize outputmixobject calling it's realize method:

// create outputmixer. result = (*engineinstance)->createoutputmix(engineinstance, &outputmixobject, 1, null, null); assert(result == sl_result_success); // realize outputmixer. result = (*outputmixobject)->realize(outputmixobject, sl_boolean_false); assert(result == sl_result_success); 

when run application test, following log entries:

05-11 13:20:19.736: info/debug(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 05-11 13:20:19.736: info/debug(31): build fingerprint: 'generic/sdk/generic:2.3.1/gsi11/93351:eng/test-keys' 05-11 13:20:19.736: info/debug(31): pid: 631, tid: 631  >>> org.test.opensl <<< 05-11 13:20:19.746: info/debug(31): signal 11 (sigsegv), code 1 (segv_maperr), fault addr 00000000 05-11 13:20:19.746: info/debug(31):  r0 00000000  r1 00000000  r2 00000000  r3 00000000 05-11 13:20:19.746: info/debug(31):  r4 82f01bdc  r5 8380af69  r6 00000000  r7 418fccc4 05-11 13:20:19.746: info/debug(31):  r8 bee5f428  r9 418fccbc  10 418fcca4  fp 42596f38 05-11 13:20:19.746: info/debug(31):  ip 00000000  sp bee5f410  lr 8380af95  pc 82f009ae  cpsr 40000030 05-11 13:20:19.986: info/debug(31):          #00  pc 000009ae  /data/data/org.test.opensl/lib/libslaudio.so 05-11 13:20:19.986: info/debug(31):          #01  pc 00017d34  /system/lib/libdvm.so 05-11 13:20:19.996: info/debug(31):          #02  pc 00048ec0  /system/lib/libdvm.so 05-11 13:20:20.007: info/debug(31):          #03  pc 00041a6a  /system/lib/libdvm.so 05-11 13:20:20.007: info/debug(31):          #04  pc 0004e5dc  /system/lib/libdvm.so 05-11 13:20:20.016: info/debug(31):          #05  pc 0001cf94  /system/lib/libdvm.so 05-11 13:20:20.016: info/debug(31):          #06  pc 0002209c  /system/lib/libdvm.so 05-11 13:20:20.016: info/debug(31):          #07  pc 00020f90  /system/lib/libdvm.so 05-11 13:20:20.016: info/debug(31):          #08  pc 0005f50e  /system/lib/libdvm.so 05-11 13:20:20.026: info/debug(31):          #09  pc 00066ed6  /system/lib/libdvm.so 05-11 13:20:20.026: info/debug(31):          #10  pc 0001cf94  /system/lib/libdvm.so 05-11 13:20:20.057: info/debug(31):          #11  pc 0002209c  /system/lib/libdvm.so 05-11 13:20:20.057: info/debug(31):          #12  pc 00020f90  /system/lib/libdvm.so 05-11 13:20:20.057: info/debug(31):          #13  pc 0005f360  /system/lib/libdvm.so 05-11 13:20:20.066: info/debug(31):          #14  pc 0004b960  /system/lib/libdvm.so 05-11 13:20:20.066: info/debug(31):          #15  pc 0003eb64  /system/lib/libdvm.so 05-11 13:20:20.066: info/debug(31):          #16  pc 0003c15c  /system/lib/libandroid_runtime.so 05-11 13:20:20.086: info/debug(31):          #17  pc 0003cf76  /system/lib/libandroid_runtime.so 05-11 13:20:20.086: info/debug(31):          #18  pc 00008ca2  /system/bin/app_process 05-11 13:20:20.086: info/debug(31):          #19  pc 00014db8  /system/lib/libc.so 05-11 13:20:20.097: info/debug(31): code around pc: 05-11 13:20:20.106: info/debug(31): 82f0098c 68116803 32201c22 479868db 1c216a20  05-11 13:20:20.106: info/debug(31): 82f0099c 68032201 31189600 230069dd 69a047a8  05-11 13:20:20.106: info/debug(31): 82f009ac 68032100 4798681b bd70b002 00001274  05-11 13:20:20.116: info/debug(31): 82f009bc 00001228 0000002c 00000002 00000001  05-11 13:20:20.126: info/debug(31): 82f009cc 007a1200 00000010 00000010 00000004  05-11 13:20:20.126: info/debug(31): code around lr: 05-11 13:20:20.136: info/debug(31): 8380af74 29002602 2000d01e 48106008 fcf8f7fd  05-11 13:20:20.136: info/debug(31): 8380af84 9300ab05 9a031c39 1c049b0c fa9af7fe  05-11 13:20:20.136: info/debug(31): 8380af94 d10f1e06 99051c20 f7fd9a02 1e04fec3  05-11 13:20:20.136: info/debug(31): 8380afa4 2603d101 1c20e006 fa30f7fb f0011c20  05-11 13:20:20.136: info/debug(31): 8380afb4 602cf8a3 1c30b007 46c0bdf0 00001009  05-11 13:20:20.136: info/debug(31): stack: 05-11 13:20:20.136: info/debug(31):     bee5f3d0  82f01bf4  /data/data/org.test.opensl/lib/libslaudio.so 05-11 13:20:20.136: info/debug(31):     bee5f3d4  00000002   05-11 13:20:20.146: info/debug(31):     bee5f3d8  00000001   05-11 13:20:20.146: info/debug(31):     bee5f3dc  8380af95  /system/lib/libopensles.so 05-11 13:20:20.156: info/debug(31):     bee5f3e0  bee5f3f4   05-11 13:20:20.156: info/debug(31):     bee5f3e4  838089b9  /system/lib/libopensles.so 05-11 13:20:20.156: info/debug(31):     bee5f3e8  0029cea4  [heap] 05-11 13:20:20.156: info/debug(31):     bee5f3ec  00000000   05-11 13:20:20.156: info/debug(31):     bee5f3f0  00000000   05-11 13:20:20.156: info/debug(31):     bee5f3f4  82f01bfc  /data/data/org.test.opensl/lib/libslaudio.so 05-11 13:20:20.156: info/debug(31):     bee5f3f8  000001b4   05-11 13:20:20.156: info/debug(31):     bee5f3fc  82f01bdc  /data/data/org.test.opensl/lib/libslaudio.so 05-11 13:20:20.167: info/debug(31):     bee5f400  8380af69  /system/lib/libopensles.so 05-11 13:20:20.167: info/debug(31):     bee5f404  00000000   05-11 13:20:20.167: info/debug(31):     bee5f408  df002777   05-11 13:20:20.176: info/debug(31):     bee5f40c  e3a070ad   05-11 13:20:20.176: info/debug(31): #00 bee5f410  00000000   05-11 13:20:20.176: info/debug(31):     bee5f414  00000000   05-11 13:20:20.176: info/debug(31):     bee5f418  bee5f448   05-11 13:20:20.186: info/debug(31):     bee5f41c  00000000   05-11 13:20:20.186: info/debug(31):     bee5f420  43d6e7c3  /data/dalvik-cache/data@app@org.test.opensl-2.apk@classes.dex 05-11 13:20:20.186: info/debug(31):     bee5f424  81d17d38  /system/lib/libdvm.so 05-11 13:20:20.186: info/debug(31): #01 bee5f428  41adab28  /dev/ashmem/dalvik-linearalloc (deleted) 05-11 13:20:20.186: info/debug(31):     bee5f42c  0000ce48  [heap] 05-11 13:20:20.186: info/debug(31):     bee5f430  43d6e7c3  /data/dalvik-cache/data@app@org.test.opensl-2.apk@classes.dex 05-11 13:20:20.186: info/debug(31):     bee5f434  bee5f508   05-11 13:20:20.186: info/debug(31):     bee5f438  81d17f00  /system/lib/libdvm.so 05-11 13:20:20.186: info/debug(31):     bee5f43c  0000ce48  [heap] 05-11 13:20:20.186: info/debug(31):     bee5f440  bee5f448   05-11 13:20:20.186: info/debug(31):     bee5f444  81d48ec3  /system/lib/libdvm.so 

checking program counter @ #00, shows method @ address 000009ae caused crash. converting address line @ occurred in source file, gives me line of code realize(outputmixobject, sl_boolean_false method is.

note, converted address via solution posted @ question: how use addr2line in android

however, can't seem make sense of it, might due inexperience ndk or c/opensl es in general...

i test on android 2.3.1 emulator. code specified earlier in initialization method initializes engine application:

jniexport void jnicall java_org_test_opensl_audioprocessor_createengine(jnienv *env, jobject thiz){     slresult result;     // create engine.     result = slcreateengine(&engineobject, 0, null, 0, null, null);     assert(result == sl_result_success);     // realize engine.     result = (*engineobject)->realize(engineobject, sl_boolean_false);     assert(result == sl_result_success);     // engine interface, required creation of other objects.     result = (*engineobject)->getinterface(engineobject, sl_iid_engine, &engineinstance);     assert(result == sl_result_success);     // create outputmixer.     result = (*engineinstance)->createoutputmix(engineinstance, &outputmixobject, 1, null, null);     assert(result == sl_result_success);     // realize outputmixer.     result = (*outputmixobject)->realize(outputmixobject, sl_boolean_false);     assert(result == sl_result_success); } 

if shed light on this, appreciated...

result = (*engineinstance)->createoutputmix(engineinstance, &outputmixobject, 1, null, null); 

you're supplying 1 numinterfaces parameter, , sending null pointer pinterfaceids param, result in segfault @ 0x00000000 somewhere inside opensl.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -