Author Topic: BASS for Android  (Read 390447 times)

N/A

  • Guest
Re: BASS for Android
« Reply #675 on: 7 Sep '14 - 21:59 »
Hi Ian,

i have some problems compiling my app for Android x86. On armeabi it works fine. On every try to compile i get ONE of the following errors:

Code: [Select]
TARGET_ARCH     = x86
TARGET_ARCH_ABI = x86
TARGET_ABI      = android-14-x86
APP_ABI         = x86
[x86] Install        : libbass.so => libs/x86/libbass.so
[x86] Install        : libbass_aac.so => libs/x86/libbass_aac.so
D:/System/android-ndk-r10/toolchains/x86-4.6/prebuilt/windows/bin/i686-linux-android-strip: unable to rename './libs/x86/libbass_aac.so'; reason: File exists
make.exe: *** [libs/x86/libbass_aac.so] Error 1
make.exe: *** Deleting file `libs/x86/libbass_aac.so'

Code: [Select]
TARGET_ARCH     = x86
TARGET_ARCH_ABI = x86
TARGET_ABI      = android-14-x86
APP_ABI         = x86
[x86] Install        : libbass.so => libs/x86/libbass.so
The process cannot access the file because it is being used by another process
make.exe: *** [libs/x86/libbass.so] Error 1
make.exe: *** Deleting file `libs/x86/libbass.so'

Code: [Select]
TARGET_ARCH     = x86
TARGET_ARCH_ABI = x86
TARGET_ABI      = android-14-x86
APP_ABI         = x86
[x86] Install        : libbass.so => libs/x86/libbass.so
D:/System/android-ndk-r10/toolchains/x86-4.6/prebuilt/windows/bin/i686-linux-android-strip: './libs/x86/libbass.so': No such file
make.exe: *** [libs/x86/libbass.so] Error 1

Code: [Select]
TARGET_ARCH     = x86
TARGET_ARCH_ABI = x86
TARGET_ABI      = android-14-x86
APP_ABI         = x86
[x86] Install        : libbass.so => libs/x86/libbass.so
D:/System/android-ndk-r10/toolchains/x86-4.6/prebuilt/windows/bin/i686-linux-android-strip: unable to rename './libs/x86/libbass.so'; reason: File exists
make.exe: *** [libs/x86/libbass.so] Error 1
make.exe: *** Deleting file `libs/x86/libbass.so'

Do you (or someone else) may have an idea how to fix that?

Thanx :)

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for Android
« Reply #676 on: 8 Sep '14 - 15:05 »
That's strange. I haven't seen those error messages before, so I'm not really sure what could be causing them. It looks like you are building a native app? Please show what the build script looks like. Also, if you remove the "libs/x86" directory, which of those error messages do you get in the next build attempt?

DevNemo

  • Guest
Re: BASS for Android
« Reply #677 on: 8 Sep '14 - 15:21 »
is it possible to load an sfpack compressed soundfile? i used the SFPACK.EXE tool, but on my android system i get the err-nr 41 if i try to load a such sfpack file.

the plugins
      BASS.BASS_PluginLoad(libpath+"/libbassflac.so", 0);
      BASS.BASS_PluginLoad(libpath+"/libbasswv.so", 0);

where loaded without any problems.

any idea?

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for Android
« Reply #678 on: 8 Sep '14 - 16:21 »
If you open your project's APK file (in its "bin" folder), do you see the libbassflac/wv.so files in it alongside libbass.so? If not, check that they are in the project's "libs" folder and then "Refresh" that folder (right-click on it) in Eclipse. If the libraries are present in the APK and it's still not working, to confirm that the SF2PACK file is valid, are you able to use it on other platforms, eg. with the pre-compiled MIDITEST.EXE example on Windows?

DevNemo

  • Guest
Re: BASS for Android
« Reply #679 on: 8 Sep '14 - 16:55 »
no, it dont work. so i also tried the sf2pack.exe which comes along with the windows version, but it's nearly the same. the only difference is when i'm using the sfpack file i dont show up in the miditest tool. if i use the sf2pack created file, it is shown in the miditest tool, but no sounds "0/0"  :-[

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for Android
« Reply #680 on: 8 Sep '14 - 17:40 »
Just to be sure, when running the MIDITEST.EXE example, did you put the BASSWV.DLL file in the same directory?

If you like, you can upload your SF2PACK file here, and I'll check it out...

   ftp.un4seen.com/incoming/

DevNemo

  • Guest
Re: BASS for Android
« Reply #681 on: 9 Sep '14 - 15:22 »
i downloaded the addOn's (flac, wv, enc) and placed them all in the folder for the sf2pack and miditest and tryed to load the compressed soundfonts. the same result "0/0". so i generated the compressed soundfonts again. now it works.

N/A

  • Guest
Re: BASS for Android
« Reply #682 on: 10 Sep '14 - 01:36 »
Yes, it's a native app:
Application.mk
Code: [Select]
# App platform
APP_PLATFORM := android-14

# App abi
APP_ABI := armeabi armeabi-v7a x86

Android.mk
Code: [Select]
LOCAL_PATH := $(call my-dir)

$(info TARGET_ARCH     = $(TARGET_ARCH))
$(info TARGET_ARCH_ABI = $(TARGET_ARCH_ABI))
$(info TARGET_ABI      = $(TARGET_ABI))
$(info APP_ABI         = $(APP_ABI))

include $(CLEAR_VARS)
LOCAL_MODULE := bassaac
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbass_aac.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bass/header
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := bassalac
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbass_alac.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bass/header
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := bassape
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbass_ape.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bass/header
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := bassfx
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbass_fx.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bass/header
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := bassmpc
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbass_mpc.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bass/header
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := bassflac
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbassflac.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bass/header
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := bassmidi
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbassmidi.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bass/header
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := bassopus
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbassopus.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bass/header
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := basswv
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbasswv.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bass/header
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := bass
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbass.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bass/header
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := libmylib
LOCAL_SRC_FILES := native.c code.c
LOCAL_CFLAGS := -lm -ldl -std=c99 -lbass -lbassenc -lbassfx
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
LOCAL_SHARED_LIBRARIES := libandroid bass bassenc bassfx
include $(BUILD_SHARED_LIBRARY)

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for Android
« Reply #683 on: 10 Sep '14 - 15:48 »
That looks like it should be fine. What path do you have the BASS SO files in? It should be "jni/x86".

N/A

  • Guest
Re: BASS for Android
« Reply #684 on: 10 Sep '14 - 17:10 »
Yep, it's jni/x86.

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for Android
« Reply #685 on: 10 Sep '14 - 18:02 »
That's puzzling then. I tried something similar just now, and I didn't get any error messages. That was using the Android NDK on Linux though, while it appears that you're using it on Windows, but I don't think that should make a difference.

Do the "armeabi" and "armeabi-v7a" versions build fine? If so, are you sure all of the x86 SO files are present in the "jni/x86" directory? If that's not it, what happens if you remove all of the BASS library entries from your build script except for the LIBBASS.SO one?

N/A

  • Guest
Re: BASS for Android
« Reply #686 on: 14 Sep '14 - 03:42 »
Armeabi worked fine, but it stopped a few days ago with the same errors as x86. I don't know if armeabi-v7a works, but it compiles without any errors. Today i have reinstalled linux (elementary os) on my machine and the the compiler runs fine for all platforms without any errors. But i still can't run my app on my x86 device.

Output:
Code: [Select]
TARGET_ARCH     = arm
TARGET_ARCH_ABI = armeabi
TARGET_ABI      = android-14-armeabi
APP_ABI         = armeabi armeabi-v7a x86
TARGET_ARCH     = arm
TARGET_ARCH_ABI = armeabi-v7a
TARGET_ABI      = android-14-armeabi-v7a
APP_ABI         = armeabi armeabi-v7a x86
TARGET_ARCH     = x86
TARGET_ARCH_ABI = x86
TARGET_ABI      = android-14-x86
APP_ABI         = armeabi armeabi-v7a x86
[armeabi] Install        : libbass.so => libs/armeabi/libbass.so
[armeabi] Install        : libbass_aac.so => libs/armeabi/libbass_aac.so
[armeabi] Install        : libbass_alac.so => libs/armeabi/libbass_alac.so
[armeabi] Install        : libbass_ape.so => libs/armeabi/libbass_ape.so
[armeabi] Install        : libbassflac.so => libs/armeabi/libbassflac.so
[armeabi] Install        : libbass_fx.so => libs/armeabi/libbass_fx.so
[armeabi] Install        : libbassmidi.so => libs/armeabi/libbassmidi.so
[armeabi] Install        : libbass_mpc.so => libs/armeabi/libbass_mpc.so
[armeabi] Install        : libbassopus.so => libs/armeabi/libbassopus.so
[armeabi] Install        : libbasswv.so => libs/armeabi/libbasswv.so
[armeabi] Compile thumb  : mylib <= native.c
[armeabi] SharedLibrary  : libmylib.so
[armeabi] Install        : libmylib.so => libs/armeabi/libmylib.so
[armeabi-v7a] Install        : libbass.so => libs/armeabi-v7a/libbass.so
[armeabi-v7a] Install        : libbass_aac.so => libs/armeabi-v7a/libbass_aac.so
[armeabi-v7a] Install        : libbass_alac.so => libs/armeabi-v7a/libbass_alac.so
[armeabi-v7a] Install        : libbass_ape.so => libs/armeabi-v7a/libbass_ape.so
[armeabi-v7a] Install        : libbassflac.so => libs/armeabi-v7a/libbassflac.so
[armeabi-v7a] Install        : libbass_fx.so => libs/armeabi-v7a/libbass_fx.so
[armeabi-v7a] Install        : libbassmidi.so => libs/armeabi-v7a/libbassmidi.so
[armeabi-v7a] Install        : libbass_mpc.so => libs/armeabi-v7a/libbass_mpc.so
[armeabi-v7a] Install        : libbassopus.so => libs/armeabi-v7a/libbassopus.so
[armeabi-v7a] Install        : libbasswv.so => libs/armeabi-v7a/libbasswv.so
[armeabi-v7a] Compile thumb  : mylib <= native.c
[armeabi-v7a] SharedLibrary  : libmylib.so
[armeabi-v7a] Install        : libmylib.so => libs/armeabi-v7a/libmylib.so
[x86] Install        : libbass.so => libs/x86/libbass.so
[x86] Install        : libbass_aac.so => libs/x86/libbass_aac.so
[x86] Install        : libbass_alac.so => libs/x86/libbass_alac.so
[x86] Install        : libbass_ape.so => libs/x86/libbass_ape.so
[x86] Install        : libbassflac.so => libs/x86/libbassflac.so
[x86] Install        : libbass_fx.so => libs/x86/libbass_fx.so
[x86] Install        : libbassmidi.so => libs/x86/libbassmidi.so
[x86] Install        : libbass_mpc.so => libs/x86/libbass_mpc.so
[x86] Install        : libbassopus.so => libs/x86/libbassopus.so
[x86] Install        : libbasswv.so => libs/x86/libbasswv.so
[x86] Compile        : mylib <= native.c
[x86] SharedLibrary  : libmylib.so
[x86] Install        : libmylib.so => libs/x86/libmylib.so

Error:
Code: [Select]
09-14 04:34:46.399: E/AndroidRuntime(6850): FATAL EXCEPTION: main
09-14 04:34:46.399: E/AndroidRuntime(6850): java.lang.ExceptionInInitializerError
09-14 04:34:46.399: E/AndroidRuntime(6850): at com.mylib.services.MYLIBService.onCreate(MYLIBService.java:194)
09-14 04:34:46.399: E/AndroidRuntime(6850): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2594)
09-14 04:34:46.399: E/AndroidRuntime(6850): at android.app.ActivityThread.access$1700(ActivityThread.java:150)
09-14 04:34:46.399: E/AndroidRuntime(6850): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
09-14 04:34:46.399: E/AndroidRuntime(6850): at android.os.Handler.dispatchMessage(Handler.java:99)
09-14 04:34:46.399: E/AndroidRuntime(6850): at android.os.Looper.loop(Looper.java:176)
09-14 04:34:46.399: E/AndroidRuntime(6850): at android.app.ActivityThread.main(ActivityThread.java:5279)
09-14 04:34:46.399: E/AndroidRuntime(6850): at java.lang.reflect.Method.invokeNative(Native Method)
09-14 04:34:46.399: E/AndroidRuntime(6850): at java.lang.reflect.Method.invoke(Method.java:511)
09-14 04:34:46.399: E/AndroidRuntime(6850): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
09-14 04:34:46.399: E/AndroidRuntime(6850): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
09-14 04:34:46.399: E/AndroidRuntime(6850): at dalvik.system.NativeStart.main(Native Method)
09-14 04:34:46.399: E/AndroidRuntime(6850): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libbass.so" needed by "libmylib.so"; caused by load_library(linker.cpp:745): library "libbass.so" not found
09-14 04:34:46.399: E/AndroidRuntime(6850): at java.lang.Runtime.loadLibrary(Runtime.java:371)
09-14 04:34:46.399: E/AndroidRuntime(6850): at java.lang.System.loadLibrary(System.java:535)
09-14 04:34:46.399: E/AndroidRuntime(6850): at com.mylib.jni.JNI.<clinit>(JNI.java:16)
09-14 04:34:46.399: E/AndroidRuntime(6850): ... 12 more

N/A

  • Guest
Re: BASS for Android
« Reply #687 on: 14 Sep '14 - 03:54 »
If i remove all bass entries except libbass.so it still throws the UnsatisfiedLinkError.

N/A

  • Guest
Re: BASS for Android
« Reply #688 on: 14 Sep '14 - 04:00 »
Aaaaaaaaaaah, solved the problem. Had to include bass, bassenc and bass_fx before mylib:
Code: [Select]
[b]System.loadLibrary("bass");
System.loadLibrary("bassenc");
System.loadLibrary("bass_fx");[/b]
System.loadLibrary("mylib");
Don't know why i didn't need this for the armeabi platform. ???

DevNemo

  • Guest
Re: BASS for Android
« Reply #689 on: 14 Sep '14 - 10:58 »
how to use soundfonts within an apk? should i export them to the sdcard? i saw i could  do also a BASS_MIDI_FontInit using a bytebuffer. could this be done with an "file" located in the apk asset? would it be a good idea to read a asset file into an byte array, convert it to a bytebuffer and using the BASS_MIDI_FontInit?

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for Android
« Reply #690 on: 15 Sep '14 - 14:51 »
Aaaaaaaaaaah, solved the problem. Had to include bass, bassenc and bass_fx before mylib:
Code: [Select]
[b]System.loadLibrary("bass");
System.loadLibrary("bassenc");
System.loadLibrary("bass_fx");[/b]
System.loadLibrary("mylib");
Don't know why i didn't need this for the armeabi platform. ???

Yeah, I don't think Android includes the app's "lib" folder in its library search path, so each library's dependencies should be loaded before it is, ie. BASS before BASSenc/FX, and all 3 before your library. It's a bit strange that you didn't have the same issue with the armeabi architecture; perhaps it depends on the Android config, and your armeabi device did include the app's "lib" folder in the library search path?

how to use soundfonts within an apk? should i export them to the sdcard? i saw i could  do also a BASS_MIDI_FontInit using a bytebuffer. could this be done with an "file" located in the apk asset? would it be a good idea to read a asset file into an byte array, convert it to a bytebuffer and using the BASS_MIDI_FontInit?

Yep, you could read the asset into a ByteBuffer and then pass that to BASS_MIDI_FontInit. It might look something like this...

Code: [Select]
try {
InputStream is=getAssets().open("soundfont.sf2");
byte[] buffer=new byte[is.available()];
is.read(buffer);
is.close();
font=BASSMIDI.BASS_MIDI_FontInit(ByteBuffer.wrap(buffer), BASSMIDI.BASS_MIDI_FONT_MEM);
} catch (IOException e) {
// asset fail
}

DevNemo

  • Guest
Re: BASS for Android
« Reply #691 on: 15 Sep '14 - 16:34 »
thank you for all your help!
 :)



chuckd

  • Posts: 67
Re: BASS for Android
« Reply #692 on: 15 Sep '14 - 16:51 »
Ian,

I had posted a prior problem with Android (below), where I was getting lots of skipping on Samsung S3 devices because the audio buffer would empty.  You suggested that I try setting the BASS_CONFIG_DEV_BUFFER to a larger value.

Well I've been playing around with this for a while now, and I've noticed that using larger values makes the problem significantly worse!  If I do a BASS.BASS_SetConfig(BASS.BASS_CONFIG_DEV_BUFFER,90), the audio buffer empties quite frequently. With a buffer size of 20, it is significantly better (actually, it almost never goes empty).

Any idea why this might be the case?  It seems counter-intuitive to me.

Chuck

Thought I'd post a weird Android issue here.  I noticed that on various Samsung devices, my device/audio pauses and stutters quite a bit.  This doesn't happen on my HTC devices.  All devices are Android 4.x (various versions).  I noticed in the LogCat output I'm getting tons of the following messages on the Samsung devices only.  This sequence repeats over and over, and I really have no idea why it's happening, but it's definitely affecting performance.  Any ideas?  I'm not starting/stopping streams or anything like that, just getting data and sending to a single push stream over and over again.

08-25 15:08:22.868: V/AudioPolicyManagerBase(151): stopOutput() output 2, stream 3, session 214
08-25 15:08:22.868: V/AudioPolicyManagerBase(151): changeRefCount() stream 3, count 0
08-25 15:08:22.868: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.878: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.878: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.878: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.878: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.878: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.878: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.878: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.878: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.888: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.888: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.888: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.888: V/AudioPolicyManagerBase(151): getNewDevice() selected device 0
08-25 15:08:22.898: V/AudioPolicyManagerBase(151): setOutputDevice() output 2 device 0000 force 0 delayMs 192
08-25 15:08:22.898: V/AudioPolicyManagerBase(151): setOutputDevice() prevDevice 0002
08-25 15:08:22.898: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.898: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.898: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.898: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.898: V/AudioPolicyManagerBase(151): setOutputDevice() setting same device 0000 or null device for output 2
08-25 15:08:22.898: V/AudioPolicyManagerBase(151): checkOutputForStrategy(0002,0002,3)
08-25 15:08:22.898: V/AudioPolicyManagerBase(151): getOutputsForDevice device 0002 -> 0002
08-25 15:08:22.898: V/AudioPolicyManagerBase(151): getOutputsForDevice device 0002 -> 0002
08-25 15:08:22.918: V/AudioPolicyManagerBase(151): startOutput() output 2, stream 3, session 214
08-25 15:08:22.918: V/AudioPolicyManagerBase(151): changeRefCount() stream 3, count 1
08-25 15:08:22.918: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.918: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.918: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.928: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.928: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.928: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.928: W/AudioPolicyManagerBase(151): stream type [13], return media strategy
08-25 15:08:22.928: W/AudioPolicyManagerBase(151): stream type [14], return media strategy
08-25 15:08:22.928: V/AudioPolicyManagerBase(151): getNewDevice() selected device 2
08-25 15:08:22.928: V/AudioPolicyManagerBase(151): setOutputDevice() output 2 device 0002 force 0 delayMs 0
08-25 15:08:22.928: V/AudioPolicyManagerBase(151): setOutputDevice() prevDevice 0002
08-25 15:08:22.938: V/AudioPolicyManagerBase(151): setOutputDevice() setting same device 0002 or null device for output 2
08-25 15:08:22.938: V/AudioPolicyManagerBase(151): checkOutputForStrategy(0002,0002,3)
08-25 15:08:22.938: V/AudioPolicyManagerBase(151): getOutputsForDevice device 0002 -> 0002
08-25 15:08:22.938: V/AudioPolicyManagerBase(151): getOutputsForDevice device 0002 -> 0002


Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for Android
« Reply #693 on: 16 Sep '14 - 12:40 »
That's strange. I will send you a debug version to get some info on the device buffer updates.

zhengshengh

  • Posts: 3
Re: BASS for Android
« Reply #694 on: 19 Sep '14 - 05:44 »
09-19 12:40:13.645: E/AndroidRuntime(13009): java.lang.UnsatisfiedLinkError: Native method not found: com.example.fxtest.BASS.BASS_Init:(III)Z
09-19 12:40:13.645: E/AndroidRuntime(13009):    at com.example.fxtest.BASS.BASS_Init(Native Method)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at com.example.fxtest.FXTest.onCreate(FXTest.java:127)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at android.app.Activity.performCreate(Activity.java:5191)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at com.lbe.security.service.core.client.b.x.callActivityOnCreate(Unknown Source)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at android.app.ActivityThread.access$600(ActivityThread.java:140)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at android.os.Looper.loop(Looper.java:137)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at android.app.ActivityThread.main(ActivityThread.java:4898)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at java.lang.reflect.Method.invokeNative(Native Method)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at java.lang.reflect.Method.invoke(Method.java:511)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
09-19 12:40:13.645: E/AndroidRuntime(13009):    at dalvik.system.NativeStart.main(Native Method)
 :'(     When I run the demo in bass24-android.zip as Android Application.The crash happened.Could somebody help me?
« Last Edit: 19 Sep '14 - 05:48 by zhengshengh »

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for Android
« Reply #695 on: 19 Sep '14 - 14:56 »
That looks like the BASS library (libbass.so) wasn't included in the app. Does your Eclipse project include a "libs" folder, and does that folder contain the BASS libraries? If not, you should copy the "libs" folder from the BASS package into the project's folder (you may need to "Refresh" the project afterwards).

zhengshengh

  • Posts: 3
Re: BASS for Android
« Reply #696 on: 20 Sep '14 - 01:53 »
That looks like the BASS library (libbass.so) wasn't included in the app. Does your Eclipse project include a "libs" folder, and does that folder contain the BASS libraries? If not, you should copy the "libs" folder from the BASS package into the project's folder (you may need to "Refresh" the project afterwards).
Yes,my Eclipse project include a "libs" folder.if not,the crash is
     java.lang.UnsatisfiedLinkError: Couldn't load bass from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.fxtest-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.fxtest-2, /vendor/lib, /system/lib]]]: findLibrary returned null.
But,my crash is java.lang.UnsatisfiedLinkError: Native method not found: com.example.fxtest.BASS.BASS_Init:(III)Z.
It seem that method not found instand of library not found.  What happen? ???

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #697 on: 21 Sep '14 - 17:34 »
That looks like the BASS library (libbass.so) wasn't included in the app. Does your Eclipse project include a "libs" folder, and does that folder contain the BASS libraries? If not, you should copy the "libs" folder from the BASS package into the project's folder (you may need to "Refresh" the project afterwards).
Yes,my Eclipse project include a "libs" folder.if not,the crash is
     java.lang.UnsatisfiedLinkError: Couldn't load bass from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.fxtest-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.fxtest-2, /vendor/lib, /system/lib]]]: findLibrary returned null.
But,my crash is java.lang.UnsatisfiedLinkError: Native method not found: com.example.fxtest.BASS.BASS_Init:(III)Z.
It seem that method not found instand of library not found.  What happen? ???


have you copied the BASS.java into the "com.example.fxtest" package? it has to be in the "com.un4seen.bass" package to work. the fully qualified name must be correct to find the corresponding native method. so move your BASS.java into the correct package and test again.

zhengshengh

  • Posts: 3
Re: BASS for Android
« Reply #698 on: 22 Sep '14 - 01:49 »
That looks like the BASS library (libbass.so) wasn't included in the app. Does your Eclipse project include a "libs" folder, and does that folder contain the BASS libraries? If not, you should copy the "libs" folder from the BASS package into the project's folder (you may need to "Refresh" the project afterwards).
Yes,my Eclipse project include a "libs" folder.if not,the crash is
     java.lang.UnsatisfiedLinkError: Couldn't load bass from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.fxtest-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.fxtest-2, /vendor/lib, /system/lib]]]: findLibrary returned null.
But,my crash is java.lang.UnsatisfiedLinkError: Native method not found: com.example.fxtest.BASS.BASS_Init:(III)Z.
It seem that method not found instand of library not found.  What happen? ???


have you copied the BASS.java into the "com.example.fxtest" package? it has to be in the "com.un4seen.bass" package to work. the fully qualified name must be correct to find the corresponding native method. so move your BASS.java into the correct package and test again.
oh,thank you very much!It works!You should get award for this!

LikeAndroid

  • Guest
Re: BASS for Android
« Reply #699 on: 23 Sep '14 - 17:17 »
hi, i'm testing your library for midi playback. the debug version works greate! but the release build dont. i'm using obfuscation and excluded the class/field/method name of the bass.java and bassmidi.java files. but when i try to playback a midi file the app crashes. do you have any tip for me what to do? the debug version works well on the device...