Author Topic: BASS for Android  (Read 392153 times)

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS for Android
« Reply #1000 on: 4 Nov '15 - 17:11 »
10% isn't really high enough CPU usage to cause stuttering. It might be that the device buffer size needs to be increased. You can do that with the BASS_CONFIG_DEV_BUFFER option, like this:

Code: [Select]
BASS_SetConfig(BASS_CONFIG_DEV_BUFFER, 40); // set the device buffer to 40ms

You can try increasing the setting in 10ms increments until it (hopefully) stops stuttering. Note that changes must be made before calling BASS_Init; they won't affect already initialized devices.

rdkartono

  • Posts: 11
Re: BASS for Android
« Reply #1001 on: 27 Nov '15 - 08:12 »
Bass for Android, is it possible to detect and use USB microphone ?

I have PIPO X8, android device, that have USB ports, and bad internal 3.5mm audio jack quality. So i am thinking to use USB mic type instead.

gicci

  • Posts: 34
Re: BASS for Android
« Reply #1002 on: 28 Nov '15 - 00:03 »
Hi Ian,

I am trying to control the volume of the recording, but I have some problems.

First if I execute (right after BASS_RecordStart()):

Code: [Select]
Float volume = new Float(0);
int x = BASS.BASS_RecordGetInput(BASS.BASS_RecordGetDevice(), volume);
Log.e("XXX", "d=" + BASS.BASS_RecordGetDevice() + ", x=" + x + ", v=" + volume);

the output I receive is

Code: [Select]
E/XXX: d=0, x=-1, v=0.0
Then I am not able to find the definition of the BASS_INPUT_OFF and BASS_INPUT_ON constants for the BASS_RecordSetInput() call.

Finally it seems that there is a ramp-in when starting recording, there is a way to control that?

Thank you!

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS for Android
« Reply #1003 on: 30 Nov '15 - 15:51 »
Bass for Android, is it possible to detect and use USB microphone ?

I have PIPO X8, android device, that have USB ports, and bad internal 3.5mm audio jack quality. So i am thinking to use USB mic type instead.

I don't think it's currently possible to specifically choose to record from a USB mic with OpenSL ES (which BASS uses on Android). It may be that some devices will automatically switch to using the USB mic when it's plugged in, so you could give it a try.

I am trying to control the volume of the recording, but I have some problems.

First if I execute (right after BASS_RecordStart()):

Code: [Select]
Float volume = new Float(0);
int x = BASS.BASS_RecordGetInput(BASS.BASS_RecordGetDevice(), volume);
Log.e("XXX", "d=" + BASS.BASS_RecordGetDevice() + ", x=" + x + ", v=" + volume);

the output I receive is

Code: [Select]
E/XXX: d=0, x=-1, v=0.0
Then I am not able to find the definition of the BASS_INPUT_OFF and BASS_INPUT_ON constants for the BASS_RecordSetInput() call.

Similar to the previous question, as far as I know there aren't any recording input controls on Android, so BASS_RecordGetInput is currently unimplemented there (it will fail with a BASS_ERROR_NOTAVAIL error). I suppose BASS could implement volume control itself (by modifying the recorded data); I'll look into that. In the meantime, if you would rather not implement it yourself, you could use the BASS_FX add-on's BASS_FX_BFX_VOLUME effect to do it.

Finally it seems that there is a ramp-in when starting recording, there is a way to control that?

BASS won't ramp-in recording, but it will ramp-in playback by default, so perhaps that's where it's coming from. Playback ramping can be disabled via the BASS_ATTRIB_NORAMP option:

Code: [Select]
BASS.BASS_ChannelSetAttribute(handle, BASS.BASS_ATTRIB_NORAMP, 1); // disable ramping

If you still hear the ramp-in after doing that, please have a look at the recording in a sample editor to confirm whether a ramp-in is present in it.

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS for Android
« Reply #1004 on: 30 Nov '15 - 15:55 »
An updated BASSMIDI add-on, which fixes a packed soundfont loading issue, is now up in the 1st post.

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #1005 on: 27 Dec '15 - 19:19 »
Hey Ian,

I wish you merry chtistmas. :)

I just updated my libs and added bass_fx. for that i get BASS_ERROR_FILEFORM error code on my Nexus 5 (Android 6.0.1) and my Galaxy S5 (LTE+; Android 5.0.2) when i try to load the plugin.


Chris

  • Posts: 1810
Re: BASS for Android
« Reply #1006 on: 28 Dec '15 - 08:59 »
bass_fx is a plugin and have many fx effects and is  not a addon like(bassmidi,bassopus)
so what do you want to do with bass_fx ?
by the way to load Bass_fx you have to do it with a simple BASS_FX_GetVersion(); Call

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #1007 on: 28 Dec '15 - 10:32 »
bass_fx is a plugin and have many fx effects and is  not a addon like(bassmidi,bassopus)
so what do you want to do with bass_fx ?
by the way to load Bass_fx you have to do it with a simple BASS_FX_GetVersion(); Call

thank you for your answer. good to know. i want to use the equalizer "effect".

I'll try if it works that way for me. :)

gicci

  • Posts: 34
Re: BASS for Android
« Reply #1008 on: 31 Dec '15 - 18:56 »
Hi Ian,

I have a packed SoundFont file which works nicely if I use it by simply calling (after loading the plugins):

Code: [Select]
BASS_MIDI_FontInit(String file, int flags)
If load the same file contents in memory with a ByteBuffer and pass it to the call:

Code: [Select]
BASS_MIDI_FontInit(ByteBuffer file, int flags)
it fails with error 20 (BASS_ERROR_ILLPARAM). I do not have tested it with an unpacked SoundFont, but I am suspecting that the error is related to this, or? If this is true how can I unpack it in memory?

Thank you and happy 2016!

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS for Android
« Reply #1009 on: 1 Jan '16 - 15:15 »
Are you including the BASS_MIDI_FONT_MEM flag in the BASS_MIDI_FontInit call? If not, please try that. That requirement originates from the C/etc APIs, where it's needed to tell that the file is in memory, but it shouldn't really be necessary in Java (it's implied by the ByteBuffer); I'll remove the requirement in the next Android BASSMIDI update. The BASS_MIDI_FontInit+BASS_MIDI_FONT_MEM option has actually been deprecated by the BASS_MIDI_FontInitUser function, but it is still supported.

gicci

  • Posts: 34
Re: BASS for Android
« Reply #1010 on: 1 Jan '16 - 22:52 »
Thank you, adding the BASS_MIDI_FONT_MEM option it works nicely.
So in this case the allocated memory is used to read the instruments but they are anyway uncompressed in other memory (differently from BASS_MIDI_FONT_MMAP), right?

gicci

  • Posts: 34
Re: BASS for Android
« Reply #1011 on: 2 Jan '16 - 00:16 »
Hi Ian,

when using SoundFont from memory restarting the app I get a crash in BASS library:

Code: [Select]
I/MidiPlayer: Opening default SoundFont
E/art: 0xb4e5a180 SpaceTypeMallocSpace begin=0x32c00000,end=0x33201000,limit=0x52c00000,size=6MB,capacity=128MB,non_growth_limit_capacity=512MB,name="main rosalloc space 1"]
E/art: 0xb4e50d20 allocspace main rosalloc space 1 live-bitmap 2[begin=0x32c00000,end=0x52c00000]
E/art: 0xb4e50d40 allocspace main rosalloc space 1 mark-bitmap 2[begin=0x32c00000,end=0x52c00000]
E/art: 0xb4e59158 SpaceTypeImageSpace begin=0x707ff000,end=0x72d1e650,size=37MB,name="/data/dalvik-cache/arm/system@framework@boot.art"]
E/art: 0xb4e50140 imagespace /data/dalvik-cache/arm/system@framework@boot.art live-bitmap 0[begin=0x707ff000,end=0x72d1e700]
E/art: 0xb4e50140 imagespace /data/dalvik-cache/arm/system@framework@boot.art live-bitmap 0[begin=0x707ff000,end=0x72d1e700]
E/art: 0xaf0c4d28 SpaceTypeZygoteSpace begin=0x8792d000,end=0x88a34000,size=17MB,name="Zygote space"]
E/art: 0xb4e509a0 allocspace zygote / non moving space live-bitmap 0[begin=0x8792d000,end=0x88a34000]
E/art: 0xb4e50980 allocspace zygote / non moving space mark-bitmap 0[begin=0x8792d000,end=0x88a34000]
E/art: 0xaf0fc180 SpaceTypeMallocSpace begin=0x88a34000,end=0x88b9d000,limit=0x8b92d000,size=1444KB,capacity=46MB,non_growth_limit_capacity=46MB,name="alloc space"]
E/art: 0xb4e50e80 allocspace alloc space live-bitmap 4[begin=0x88a34000,end=0x8b92d000]
E/art: 0xb4e50ea0 allocspace alloc space mark-bitmap 4[begin=0x88a34000,end=0x8b92d000]
E/art: 0xb4e4d340 large object space:GcRetentionPolicyAlwaysCollect
D/MidiStorage: Data load avg=77.423096
A/art: sart/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: field operation on invalid stack indirect reference table or invalid reference: 0x0
A/art: sart/runtime/check_jni.cc:65]     in call to GetLongField
A/art: sart/runtime/check_jni.cc:65]     from int com.un4seen.bass.BASSMIDI.BASS_MIDI_FontInit(java.nio.ByteBuffer, int)
A/art: sart/runtime/check_jni.cc:65] "main" prio=5 tid=1 Runnable
A/art: sart/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x8840fd00 self=0xb4e07800
A/art: sart/runtime/check_jni.cc:65]   | sysTid=22340 nice=-11 cgrp=apps sched=0/0 handle=0xb6fe6ec8
A/art: sart/runtime/check_jni.cc:65]   | state=R schedstat=( 0 0 0 ) utm=150 stm=37 core=0 HZ=100
A/art: sart/runtime/check_jni.cc:65]   | stack=0xbe014000-0xbe016000 stackSize=8MB
A/art: sart/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held)
A/art: sart/runtime/check_jni.cc:65]   native: #00 pc 00004640  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
A/art: sart/runtime/check_jni.cc:65]   native: #01 pc 00002e8d  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
A/art: sart/runtime/check_jni.cc:65]   native: #02 pc 00247979  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
A/art: sart/runtime/check_jni.cc:65]   native: #03 pc 0022c5db  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+146)
A/art: sart/runtime/check_jni.cc:65]   native: #04 pc 000b17b3  /system/lib/libart.so (art::JniAbort(char const*, char const*)+582)
A/art: sart/runtime/check_jni.cc:65]   native: #05 pc 000b1eed  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+60)
A/art: sart/runtime/check_jni.cc:65]   native: #06 pc 000b3dfd  /system/lib/libart.so (art::ScopedCheck::CheckInstanceFieldID(_jobject*, _jfieldID*)+260)
A/art: sart/runtime/check_jni.cc:65]   native: #07 pc 000b8c93  /system/lib/libart.so (art::CheckJNI::GetLongField(_JNIEnv*, _jobject*, _jfieldID*)+50)
A/art: sart/runtime/check_jni.cc:65]   native: #08 pc 001949af  /system/lib/libart.so (art::JNI::GetDirectBufferAddress(_JNIEnv*, _jobject*)+18)
A/art: sart/runtime/check_jni.cc:65]   native: #09 pc 000bf3b3  /system/lib/libart.so (art::CheckJNI::GetDirectBufferAddress(_JNIEnv*, _jobject*)+50)
A/art: sart/runtime/check_jni.cc:65]   native: #10 pc 0000cd2b  /data/app/it.giccisw.midi-1/lib/arm/libbass.so (???)
A/art: sart/runtime/check_jni.cc:65]   native: #11 pc 00011291  /data/app/it.giccisw.midi-1/lib/arm/libbassmidi.so (Java_com_un4seen_bass_BASSMIDI_BASS_1MIDI_1FontInit+76)
A/art: sart/runtime/check_jni.cc:65]   native: #12 pc 0029d7f1  /data/dalvik-cache/arm/data@app@it.giccisw.midi-1@base.apk@classes.dex (Java_com_un4seen_bass_BASSMIDI_BASS_1MIDI_1FontInit__Ljava_nio_ByteBuffer_2I+104)
A/art: sart/runtime/check_jni.cc:65]   at com.un4seen.bass.BASSMIDI.BASS_MIDI_FontInit(Native method)

I am not sure if I am doing something wrong in my code or not, any hint?

Then I am also getting another crash but only with signed exported application, not with debug one in the following code:

Code: [Select]
// get the title (track name of first track)
BASSMIDI.BASS_MIDI_MARK mark = new BASSMIDI.BASS_MIDI_MARK();
if (BASSMIDI.BASS_MIDI_StreamGetMark(chanId, BASSMIDI.BASS_MIDI_MARK_TRACK, 0, mark) && mark.track == 0)
trackName = mark.text;
else trackName = "";

with this trace (truncated, if you need more info I can provide by mail):

Code: [Select]
A/art: art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: fid == null
A/art: art/runtime/check_jni.cc:65]     in call to SetIntField
A/art: art/runtime/check_jni.cc:65]     from boolean com.un4seen.bass.BASSMIDI.BASS_MIDI_StreamGetMark(int, int, int, com.un4seen.bass.f)
A/art: art/runtime/check_jni.cc:65] "AsyncTask #1" prio=5 tid=21 Runnable
A/art: art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x32c076e0 self=0xb4e0c800
A/art: art/runtime/check_jni.cc:65]   | sysTid=29319 nice=10 cgrp=apps/bg_non_interactive sched=0/0 handle=0xaefc7380
A/art: art/runtime/check_jni.cc:65]   | state=R schedstat=( 41566767 25537867 124 ) utm=2 stm=2 core=2 HZ=100
A/art: art/runtime/check_jni.cc:65]   | stack=0xa00f0000-0xa00f2000 stackSize=1036KB
A/art: art/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held)
A/art: art/runtime/check_jni.cc:65]   native: #00 pc 00004640  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
A/art: art/runtime/check_jni.cc:65]   native: #01 pc 00002e8d  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
A/art: art/runtime/check_jni.cc:65]   native: #02 pc 00247ff1  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
A/art: art/runtime/check_jni.cc:65]   native: #03 pc 0022c97b  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+146)
A/art: art/runtime/check_jni.cc:65]   native: #04 pc 000b186b  /system/lib/libart.so (art::JniAbort(char const*, char const*)+582)
A/art: art/runtime/check_jni.cc:65]   native: #05 pc 000b1fa5  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+60)
A/art: art/runtime/check_jni.cc:65]   native: #06 pc 001b0b49  /system/lib/libart.so (art::JNI::SetIntField(_JNIEnv*, _jobject*, _jfieldID*, int)+640)
A/art: art/runtime/check_jni.cc:65]   native: #07 pc 00007e87  /data/app/it.giccisw.midi-1/lib/arm/libbassmidi.so (???)
A/art: art/runtime/check_jni.cc:65]   native: #08 pc 0001083b  /data/app/it.giccisw.midi-1/lib/arm/libbassmidi.so (Java_com_un4seen_bass_BASSMIDI_BASS_1MIDI_1StreamGetMark+70)
A/art: art/runtime/check_jni.cc:65]   native: #09 pc 0039e341  /data/dalvik-cache/arm/data@app@it.giccisw.midi-1@base.apk@classes.dex (Java_com_un4seen_bass_BASSMIDI_BASS_1MIDI_1StreamGetMark__IIILcom_un4seen_bass_f_2+128)
A/art: art/runtime/check_jni.cc:65]   at com.un4seen.bass.BASSMIDI.BASS_MIDI_StreamGetMark(Native method)

EDIT:

Regarding previous error, enabling checkjni on the target the following additional information is produced:

Code: [Select]
A/art: art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI SetIntField called with pending exception 'java.lang.NoSuchFieldError' thrown in boolean com.un4seen.bass.BASSMIDI.BASS_MIDI_StreamGetMark(int, int, int, com.un4seen.bass.BASSMIDI$BASS_MIDI_MARK):-2
A/art: art/runtime/check_jni.cc:65]     in call to SetIntField
A/art: art/runtime/check_jni.cc:65]     from boolean com.un4seen.bass.BASSMIDI.BASS_MIDI_StreamGetMark(int, int, int, com.un4seen.bass.BASSMIDI$BASS_MIDI_MARK)

EDIT-2:

After some additional digging I recognized that to let JNI code refer Java fields in released app I need to avoid that Proguard changes their names. The following statement in the Proguard configuration file fixes the problem:

Code: [Select]
# Do not touch BASS library
-keep class com.un4seen.bass.** {*;}

It would be good to put this into the documentation if not already there  :)

Thank you for your support.
« Last Edit: 3 Jan '16 - 23:54 by gicci »

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS for Android
« Reply #1012 on: 4 Jan '16 - 17:39 »
Thank you, adding the BASS_MIDI_FONT_MEM option it works nicely.
So in this case the allocated memory is used to read the instruments but they are anyway uncompressed in other memory (differently from BASS_MIDI_FONT_MMAP), right?

When loading a normal SF2 file (not packed) from memory, BASSMIDI will use the sample data directly. With a packed soundfont, BASSMIDI decodes the sample data to memory as it's needed, so memory usage may be higher even though the file is smaller, ie. you have both packed and unpacked sample data in memory. If you're reading the soundfont to memory from a local file, it may be better to just pass the filename to BASS_MIDI_FontInit instead.

when using SoundFont from memory restarting the app I get a crash in BASS library:

Are you using ByteBuffer.allocate rather than ByteBuffer.allocateDirect to allocate the memory that you're passing to BASS_MIDI_FontInit? It should be OK when ByteBuffer.allocateDirect is used, but there is indeed a bug (when releasing the soundfont) when ByteBuffer.allocate is used. An update to fix that is now up in the 1st post. I would actually recommend using ByteBuffer.allocateDirect rather than ByteBuffer.allocate whenever possible, as the memory is more efficient to access from native code (eg. BASSMIDI).

After some additional digging I recognized that to let JNI code refer Java fields in released app I need to avoid that Proguard changes their names. The following statement in the Proguard configuration file fixes the problem:

Code: [Select]
# Do not touch BASS library
-keep class com.un4seen.bass.** {*;}

It would be good to put this into the documentation if not already there  :)

Yep, the BASS Java classes need to be left alone. I'll add a note of that to the 1st post. This issue has come up a few times before in this thread, like here:

   www.un4seen.com/forum/?topic=13225.msg96664#msg96664

I notice their solution is slightly different. I'm not sure which is better? If both work, I guess doesn't really matter which you use :)

UserAlexandr

  • Posts: 37
Re: BASS for Android
« Reply #1013 on: 10 Jan '16 - 14:31 »
Hello, when i use BASS_FX_BFX_COMPRESSOR2
and BASS_FX_BFX_PEAKEQ, i get very big cpu load...

Test song: FLAC, 48 kHz, 1842 kbps, 24Bit, 74.0 MB on sdcard
CPU: Snapdragon 801 MSM8974AC

COMPRESSOR2 & PEAKEQ CPU Load: 8-16% (some songs have >25% load....)


BASS CPU Load: 1-2%



Code: (PEAKEQ 10 Bands) [Select]
eqParam.handle = BASS.BASS_ChannelSetFX(channelHandle, BASS_FX.BASS_FX_BFX_PEAKEQ, 1);
BASS_FX.BASS_BFX_PEAKEQ paramEQ = new BASS_FX.BASS_BFX_PEAKEQ();
   
paramEQ.lBand = 0; // 1,2,3,4,5,6,7,8,9
paramEQ.fBandwidth = 1f;
paramEQ.fCenter = 32f; // 63,125,250,500,1,2,4,8,16
paramEQ.lChannel = BASS_FX.BASS_BFX_CHANALL;
   
BASS.BASS_FXSetParameters(eqParam.handle, paramEQ);

Code: (COMPRESSOR2) [Select]
coParam.handle = BASS.BASS_ChannelSetFX(channelHandle, BASS_FX.BASS_FX_BFX_COMPRESSOR2, 0);

BASS_FX.BASS_BFX_COMPRESSOR2 compressor = new BASS_FX.BASS_BFX_COMPRESSOR2();

BASS.BASS_FXGetParameters(coParam.handle, compressor);

compressor.fAttack = coParam.fAttack; // 10
compressor.fGain = coParam.fGain; // 0
compressor.fRatio = coParam.fRatio; // 3
compressor.fRelease = coParam.fRelease; // 200
compressor.fThreshold= coParam.fThreshold; // -20

BASS.BASS_FXSetParameters(coParam.handle, compressor);

How to fix? Thx.
« Last Edit: 11 Jan '16 - 11:38 by UserAlexandr »

doomplay

  • Posts: 33
Re: BASS for Android
« Reply #1014 on: 10 Jan '16 - 17:52 »
Hello,
I tried to play 24bit flac. But it doesn't work. There's no any error, just endless loading.

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS for Android
« Reply #1015 on: 11 Jan '16 - 17:01 »
Hello, when i use BASS_FX_BFX_COMPRESSOR2
and BASS_FX_BFX_PEAKEQ, i get very big cpu load...

...

How to fix? Thx.

Are you using the BASS_SAMPLE_FLOAT flag on the channel/stream? If not, you could try that, as it will avoid the need for floating-point<->integer conversion in the BASS_FX effect processing (the processing is floating-point). Another option is to enable the BASS_CONFIG_FLOATDSP option (via BASS_SetConfig), which will mean the floating-point<->integer conversion is only done once for all effects (instead of once for each effect).

I tried to play 24bit flac. But it doesn't work. There's no any error, just endless loading.

24-bit FLAC files seem to be working OK here, so perhaps it's a file-specific issue. Please upload the file that you're having the problem with to have a look at here:

   ftp.un4seen.com/incoming

UserAlexandr

  • Posts: 37
Re: BASS for Android
« Reply #1016 on: 11 Jan '16 - 17:43 »
Hello, when i use BASS_FX_BFX_COMPRESSOR2
and BASS_FX_BFX_PEAKEQ, i get very big cpu load...

...

How to fix? Thx.

Are you using the BASS_SAMPLE_FLOAT flag on the channel/stream? If not, you could try that, as it will avoid the need for floating-point<->integer conversion in the BASS_FX effect processing (the processing is floating-point). Another option is to enable the BASS_CONFIG_FLOATDSP option (via BASS_SetConfig), which will mean the floating-point<->integer conversion is only done once for all effects (instead of once for each effect).

I tried to play 24bit flac. But it doesn't work. There's no any error, just endless loading.

24-bit FLAC files seem to be working OK here, so perhaps it's a file-specific issue. Please upload the file that you're having the problem with to have a look at here:

   ftp.un4seen.com/incoming

Code: [Select]
if((channelHandle = BASS.BASS_StreamCreateFile(path, 0, 0, BASS.BASS_MUSIC_STOPBACK)) == 0 && (channelHandle = BASS.BASS_MusicLoad(path, 0, 0, BASS.BASS_SAMPLE_LOOP|BASS.BASS_MUSIC_RAMP, 1)) == 0) {
DEBUG.Log("BASS", "Can't Play the File!");
DEBUG.Log("BASS", path);
return -1;
}

I use this after BASS_Init:
BASS.BASS_SetConfig(BASS.BASS_CONFIG_FLOATDSP, 1);

Need change:
BASS_SAMPLE_LOOP to BASS_SAMPLE_FLOAT? or add this flag?
« Last Edit: 11 Jan '16 - 18:29 by UserAlexandr »

Chris

  • Posts: 1810
Re: BASS for Android
« Reply #1017 on: 11 Jan '16 - 18:23 »
BASS_MUSIC_STOPBACK is a Music Flag and not a Streamflag
so your call should be
Code: [Select]
BASS.BASS_StreamCreateFile(path, 0, 0, BASS.BASS_SAMPLE_FLOAT

UserAlexandr

  • Posts: 37
Re: BASS for Android
« Reply #1018 on: 12 Jan '16 - 08:22 »
BASS_MUSIC_STOPBACK is a Music Flag and not a Streamflag
so your call should be
Code: [Select]
BASS.BASS_StreamCreateFile(path, 0, 0, BASS.BASS_SAMPLE_FLOAT

Like this?
Code: [Select]
if((channelHandle = BASS.BASS_StreamCreateFile(path, 0, 0, BASS.BASS_SAMPLE_FLOAT)) == 0 && (channelHandle = BASS.BASS_MusicLoad(path, 0, 0, BASS.BASS_MUSIC_LOOP|BASS.BASS_MUSIC_RAMP|BASS.BASS_MUSIC_STOPBACK, 1)) == 0) {
DEBUG.Log("BASS", "Can't Play the File!");
DEBUG.Log("BASS", path);
return -1;
}

doomplay

  • Posts: 33
Re: BASS for Android
« Reply #1019 on: 12 Jan '16 - 12:02 »
Also, another one issue.
Sometimes when i try to play files by https app crashes with this message:

Code: [Select]
01-12 14:31:57.855 29709-29761/com.test.player A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x158 in tid 29761 (pool-1-thread-1)
01-12 14:31:57.961 3858-3858/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-12 14:31:57.961 3858-3858/? A/DEBUG: Build fingerprint: 'google/angler/angler:6.0.1/MMB29M/2431559:user/release-keys'
01-12 14:31:57.962 3858-3858/? A/DEBUG: Revision: '0'
01-12 14:31:57.962 3858-3858/? A/DEBUG: ABI: 'arm'
01-12 14:31:57.962 3858-3858/? A/DEBUG: pid: 29709, tid: 29761, name: pool-1-thread-1  >>> com.test.player <<<
01-12 14:31:57.963 3858-3858/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x158
01-12 14:31:58.004 3858-3858/? A/DEBUG:     r0 00000001  r1 80000000  r2 00000000  r3 f6811791
01-12 14:31:58.004 3858-3858/? A/DEBUG:     r4 de889880  r5 00000000  r6 00000000  r7 d9e14dd8
01-12 14:31:58.005 3858-3858/? A/DEBUG:     r8 00000028  r9 00000000  sl 000003e8  fp de889820
01-12 14:31:58.005 3858-3858/? A/DEBUG:     ip f6826968  sp d9e14be8  lr f681a42f  pc f681a468  cpsr 800e0030
01-12 14:31:58.012 3858-3858/? A/DEBUG:     #00 pc 00018468  /system/lib/libssl.so (SSL_shutdown+91)
01-12 14:31:58.012 3858-3858/? A/DEBUG:     #01 pc 00012187  /data/app/com.test.player-2/lib/arm/libbass.so
01-12 14:31:58.012 3858-3858/? A/DEBUG:     #02 pc 00012a6f  /data/app/com.test.player-2/lib/arm/libbass.so
01-12 14:31:58.012 3858-3858/? A/DEBUG:     #03 pc 0001adb7  /data/app/com.test.player-2/lib/arm/libbass.so
01-12 14:31:58.012 3858-3858/? A/DEBUG:     #04 pc 000272ff  /data/app/com.test.player-2/lib/arm/libbass.so (BASS_StreamCreateURL+62)
01-12 14:31:58.012 3858-3858/? A/DEBUG:     #05 pc 00027453  /data/app/com.test.player-2/lib/arm/libbass.so (Java_com_un4seen_bass_BASS_BASS_1StreamCreateURL+58)
01-12 14:31:58.013 3858-3858/? A/DEBUG:     #06 pc 009351eb  /data/app/com.test.player-2/oat/arm/base.odex (offset 0x4ff000) (int com.un4seen.bass.BASS.BASS_StreamCreateURL(java.lang.String, int, int, com.un4seen.bass.BASS$DOWNLOADPROC, java.lang.Object)+166)
01-12 14:31:58.013 3858-3858/? A/DEBUG:     #10 pc 72d558af  /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1ec9000)

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS for Android
« Reply #1020 on: 12 Jan '16 - 15:18 »
I use this after BASS_Init:
BASS.BASS_SetConfig(BASS.BASS_CONFIG_FLOATDSP, 1);

Oh, so you were already applying that in the CPU measurements that you posted above? If so, you could try using the BASS_SAMPLE_FLOAT flag and see how that compares.

Like this?
Code: [Select]
if((channelHandle = BASS.BASS_StreamCreateFile(path, 0, 0, BASS.BASS_SAMPLE_FLOAT)) == 0 && (channelHandle = BASS.BASS_MusicLoad(path, 0, 0, BASS.BASS_MUSIC_LOOP|BASS.BASS_MUSIC_RAMP|BASS.BASS_MUSIC_STOPBACK, 1)) == 0) {
DEBUG.Log("BASS", "Can't Play the File!");
DEBUG.Log("BASS", path);
return -1;
}

You would generally want to use the same flags in both cases, with just MOD-specific flags added to the BASS_MusicLoad call. For example:

Code: [Select]
if((channelHandle = BASS.BASS_StreamCreateFile(path, 0, 0, BASS.BASS_SAMPLE_FLOAT)) == 0 && (channelHandle = BASS.BASS_MusicLoad(path, 0, 0, BASS.BASS_SAMPLE_FLOAT|BASS.BASS_MUSIC_RAMP, 1)) == 0) {

Sometimes when i try to play files by https app crashes with this message:
...

Please confirm what BASS version you are using, ie. what does BASS_GetVersion report?

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS for Android
« Reply #1021 on: 22 Jan '16 - 14:29 »
The Android version of the BASSOPUS 2.4.1.7 release is now up in the 1st post.

norbert

  • Posts: 122
Re: BASS for Android
« Reply #1022 on: 31 Jan '16 - 12:57 »
Still no plans for supporting .dls soundfonts ?

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS for Android
« Reply #1023 on: 1 Feb '16 - 13:58 »
I wouldn't totally rule it out in future, but there are no plans for DLS support currently.

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS for Android
« Reply #1024 on: 3 Feb '16 - 13:20 »
The Android version of the new BASSALAC add-on (replacing BASS_ALAC) is now up in the 1st post.