Author Topic: BASS for Android  (Read 714595 times)

rrhh_fx

  • Posts: 21
Re: BASS for Android
« Reply #1850 on: 29 Mar '21 - 11:50 »
BASS_CONFIG_DEV_NONSTOP is disabled by default, so if you aren't changing that setting (via BASS_SetConfig) then that won't be what's causing the problem. But do check whether you're leaving the MIDI stream playing even when it's not playing any events, ie. call BASS_ChannelStop (or BASS_StreamFree) when it isn't in use.

The issue continue happening. BASS_CONFIG_DEV_NONSTOP have not changed, so as you said before, that shoult not be the cause. I have tried to stop all the streams when OnPause, also BASS_Pause (and resuming when onResume), also Bass_Stop() and Bass_Free() and when resuming having to initialize BASS (I know that it is not the best option, since it adds a lot of delay when initializing and loading resources). No much difference in Wake_Locks in all these tests. Around 0,3% of WakeLocks and the maximum value that Google considers acceptable is 0,1%. It is hard to obtain that WakeLock in tests, because it is a very low percenteage. Sometimes, I have noticed that when quitting the app and restarting, some ANR have been issued (and probably this WakeLock), if it is not stopped BASS before, and trying to Init again.  I appreciate any kind of help.

Ian @ un4seen

  • Administrator
  • Posts: 23869
Re: BASS for Android
« Reply #1851 on: 29 Mar '21 - 17:43 »
What BASS version are you currently using? If it's the release version, you could give the latest build/beta a try:

   www.un4seen.com/stuff/bass-android.zip

There have been some little tweaks to the inactive AAudio output stopping (when BASS_CONFIG_DEV_NONSTOP is disabled), which perhaps will help in your case.

rrhh_fx

  • Posts: 21
Re: BASS for Android
« Reply #1852 on: 29 Mar '21 - 18:07 »
What BASS version are you currently using? If it's the release version, you could give the latest build/beta a try:

   www.un4seen.com/stuff/bass-android.zip

There have been some little tweaks to the inactive AAudio output stopping (when BASS_CONFIG_DEV_NONSTOP is disabled), which perhaps will help in your case.

As you mention AAudio, I have just realised that the wakelocks only are affecting starting Android 8.0 and above (highest WakeLock rate in Android 8.0), and no wake locks in earlier Android versions.

Libbass version is dated 2019/12/17 and Libbasmidi is dated 2021/01/25 (both are release I think) . I will try the new version and will report here the results in a few days. Thanks
« Last Edit: 29 Mar '21 - 18:35 by rrhh_fx »

rrhh_fx

  • Posts: 21
Re: BASS for Android
« Reply #1853 on: 8 Apr '21 - 12:01 »
The first results from Wake Lock rate for the BASS beta version show that this value has decreased to a 0,02% of sessions, so it is a fine value :) Thanks!

Regarding previous post, I have to make a correction: when using BASS_Stop()  and BASS_Free() in OnPause in BASS release version, Wake Lock rate also is stablished in acceptable values, although I guess it is not the optimal solution, since it is very resources demanding if you change activities across the app frequently.

[EDIT] 2021/04/20: It's hard to analyze data from Google Play console, and even more hard to get data from different release versions, since it has a lot of delay in showing both values, but the beta finally seems to raise ANR rate and keep Wake Lock rate, so back to BASS release version again.
« Last Edit: 20 Apr '21 - 12:30 by rrhh_fx »

liuhen1001

  • Posts: 4
Re: BASS for Android
« Reply #1854 on: 30 Apr '21 - 07:37 »
Hi, I play a song on the SD card, and then I unplug the SD card, the program crashes. How can I fix this problem?

Ian @ un4seen

  • Administrator
  • Posts: 23869
Re: BASS for Android
« Reply #1855 on: 3 May '21 - 15:44 »
It appears that Android will automatically kill any app that's accessing the SD card when it's removed, ie. the app is killed rather than crashing. Do you not see the same thing happen with other apps?

Ian @ un4seen

  • Administrator
  • Posts: 23869
Re: BASS for Android
« Reply #1856 on: 24 Jun '21 - 17:25 »
The Android version of the BASS 2.4.16 release is up in the 1st post. Note that support for the old "armeabi" (armv5) architecture has now been dropped (it was dropped by Android/Google a while ago).

artistXenon

  • Guest
Re: BASS for Android
« Reply #1857 on: 13 Jul '21 - 14:52 »
may I request a compilation of BASS_FX in "x86_64" any time near ? it seems only x86 is supported at the point 😢

Ian @ un4seen

  • Administrator
  • Posts: 23869
Re: BASS for Android
« Reply #1858 on: 15 Jul '21 - 13:10 »
The Android version of the BASSOPUS 2.4.2 release is up in the 1st post.

gicci

  • Posts: 79
Re: BASS for Android
« Reply #1859 on: 15 Jul '21 - 21:06 »
Hi Ian,
I have upgraded BASS libraries and it seems that my sync proc on BASS_SYNC_END is no longer called at the end of MIDI files. Could you please check?
Thank you.

Ian @ un4seen

  • Administrator
  • Posts: 23869
Re: BASS for Android
« Reply #1860 on: 16 Jul '21 - 12:53 »
I don't seem to be able to reproduce that here (the BASS_SYNC_END sync is getting called). Is the problem happening every time there, and with every MIDI file? In case it makes a difference, please show how you're creating the MIDI stream and setting the sync. Does the problem happen with other file formats too, eg. WAV/MP3?

gicci

  • Posts: 79
Re: BASS for Android
« Reply #1861 on: 16 Jul '21 - 13:50 »
Additional information:
  • I have tested with a MOD file and I have the same issue.
  • The problem occurs on a real device (S21) and not on the device emulator. If I am correct some times it worked also on the S21 so it could be some timing problem.
  • I am setting the syncproc on a mixer.
  • The "End" syncproc seems to be quite delayed when it works on the emulator.

I am attaching the log of the playback of the same file on a device (where end is not received) and on the emulator (where it works).
« Last Edit: 16 Jul '21 - 14:40 by gicci »

Ian @ un4seen

  • Administrator
  • Posts: 23869
Re: BASS for Android
« Reply #1862 on: 16 Jul '21 - 14:48 »
OK, so you're using BASS_Mixer_ChannelSetSync (rather than BASS_ChannelSetSync) to set the BASS_SYNC_END sync? In that case, did you also update the BASSmix library just before the problem began? If so, to check what changed, please confirm the old and new version numbers with BASS_Mixer_GetVersion.

gicci

  • Posts: 79
Re: BASS for Android
« Reply #1863 on: 16 Jul '21 - 16:58 »
I reverted to the last version of the libraries that were working, and I can confirm that with those the issue is not present.

The BASSmix libraries are unchanged (the same currently available on the download link in the first post), I see changes only in the BASS libraries.
OLD: BASS_GetVersion() returned: 33820416
NEW: BASS_GetVersion() returned: 33820673

The syncproc on the end event is set using BASS_Mixer_ChannelSetSync() as the playback channel is plugged in a mixer.

Ian @ un4seen

  • Administrator
  • Posts: 23869
Re: BASS for Android
« Reply #1864 on: 16 Jul '21 - 17:24 »
I was unable to reproduce the problem when using a mixer either here, so I'll send you a debug version to get more info from there.

Ian @ un4seen

  • Administrator
  • Posts: 23869
Re: BASS for Android
« Reply #1865 on: 21 Jul '21 - 17:54 »
For anyone else that's encountered the same issue as gicci with BASS_SYNC_END syncs on mixer sources, a BASS update (2.4.16.3) is up now in the 1st post. The problem was that when the mixer stalled at the end of the source (nothing else playing), it was possible that sometimes the source's BASS_SYNC_END sync wouldn't be called until the mixer resumed. That could happen on the other platforms too, so they've all been updated.

Ian @ un4seen

  • Administrator
  • Posts: 23869
Re: BASS for Android
« Reply #1866 on: 30 Jul '21 - 17:38 »
The Android version of the BASSHLS 2.4.3 release is up in the 1st post.

crossinu

  • Posts: 6
Re: BASS for Android
« Reply #1867 on: 1 Aug '21 - 16:32 »
is there no x86 64-bit variant of BASSFX?

jnyang

  • Guest
Re: BASS for Android
« Reply #1868 on: 2 Aug '21 - 07:41 »
is there no x86 64-bit variant of BASSFX?

You can find it here:

An update including an x86_64 build is available here:

   www.un4seen.com/files/z/0/bass_fx24-android-beta.zip

jnyang

  • Guest
Re: BASS for Android
« Reply #1869 on: 2 Aug '21 - 07:45 »
Hi Ian, it seems that the latest BASSOPUS plugin does not work well on 32-bit ARM devices (armeabi-v7a). When I try to open an OPUS file via BASS_StreamCreateFile, the app crashes with the following logs:

Code: [Select]
2021-08-02 15:39:53.134 26753-26753/? A/libc: Fatal signal 7 (SIGBUS), code 1, fault addr 0xb9015531 in tid 26753
2021-08-02 15:39:53.244 273-273/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-08-02 15:39:53.244 273-273/? I/DEBUG: Build fingerprint: 'samsung/j5ltekx/j5ltekx:5.1.1/LMY48B/J500N0KOU1ARK1:user/release-keys'
2021-08-02 15:39:53.244 273-273/? I/DEBUG: Revision: '5'
2021-08-02 15:39:53.244 273-273/? I/DEBUG: ABI: 'arm'
2021-08-02 15:39:53.244 273-273/? I/DEBUG: signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xb9015531
2021-08-02 15:39:53.264 273-273/? I/DEBUG:     r0 00000008  r1 b8fdc068  r2 00000001  r3 00000008
2021-08-02 15:39:53.264 273-273/? I/DEBUG:     r4 b8de9d90  r5 00000011  r6 b9015531  r7 b8dea338
2021-08-02 15:39:53.264 273-273/? I/DEBUG:     r8 b8fdbf60  r9 00000000  sl 00000108  fp 00000000
2021-08-02 15:39:53.264 273-273/? I/DEBUG:     ip 9cc67000  sp bebd9d90  lr b6e1b35b  pc b3f066b6  cpsr 80070030
2021-08-02 15:39:53.264 273-273/? I/DEBUG: backtrace:
2021-08-02 15:39:53.264 273-273/? I/DEBUG:     #00 pc 000026b6  /data/app/app.identifier/lib/arm/libbassopus.so
2021-08-02 15:39:53.264 273-273/? I/DEBUG:     #01 pc 00002d41  /data/app/app.identifier/lib/arm/libbassopus.so
2021-08-02 15:39:53.264 273-273/? I/DEBUG:     #02 pc 0001aed3  /data/app/app.identifier/lib/arm/libbass.so
2021-08-02 15:39:53.264 273-273/? I/DEBUG:     #03 pc 0000e7c9  /data/app/app.identifier/lib/arm/libbass.so (BASS_StreamCreateFile+60)
2021-08-02 15:39:53.264 273-273/? I/DEBUG:     #04 pc 0000e77f  /data/app/app.identifier/lib/arm/libbass.so (Java_com_un4seen_bass_BASS_BASS_1StreamCreateFile+26)

Any OPUS files (e.g., a sample file in the official OPUS codec website: https://opus-codec.org/static/examples/ehren-paper_lights-96.opus ) do not work. This issue does not occur in 64-bit ARM devices (arm64-v8a). Note that the code is tested on an Android 5.1 device (Galaxy J5), where the BASSOPUS plugin is loaded via BASS_PluginLoad(). Can you check this issue? Thanks.

crossinu

  • Posts: 6
Re: BASS for Android
« Reply #1870 on: 2 Aug '21 - 15:35 »
is there no x86 64-bit variant of BASSFX?

You can find it here:

An update including an x86_64 build is available here:

   www.un4seen.com/files/z/0/bass_fx24-android-beta.zip
Thank you!

crossinu

  • Posts: 6
Re: BASS for Android
« Reply #1871 on: 2 Aug '21 - 15:39 »
Oh right one more thing, how do I use FloatValue?

Ian @ un4seen

  • Administrator
  • Posts: 23869
Re: BASS for Android
« Reply #1872 on: 2 Aug '21 - 17:13 »
it seems that the latest BASSOPUS plugin does not work well on 32-bit ARM devices (armeabi-v7a). When I try to open an OPUS file via BASS_StreamCreateFile, the app crashes with the following logs:
...

Oh yes, I'm able to reproduce that here too. It's an alignment issue in the tag/comment reading, which seems to have been caused by a compiler change from GCC (NDK 10e) to Clang (NDK 14b) in the latest BASSOPUS build. Here's an update built with NDK 16b, which seems to fix the problem, for you to try:

   www.un4seen.com/stuff/bassopus-android.zip

Let me know if you still see the problem happen with that.

Oh right one more thing, how do I use FloatValue?

Here's an example:

Code: [Select]
BASS.FloatValue fv = new BASS.FloatValue();
BASS.BASS_ChannelGetAttribute(handle, BASS.BASS_ATTRIB_FREQ, fv);
float f = fv.value;

crossinu

  • Posts: 6
Re: BASS for Android
« Reply #1873 on: 2 Aug '21 - 18:30 »
Big thanks!

crossinu

  • Posts: 6
Re: BASS for Android
« Reply #1874 on: 4 Aug '21 - 09:51 »
One last thing, how do I use BASS for LibGDX android?
« Last Edit: 4 Aug '21 - 10:46 by crossinu »