Android - Support 16 KB page sizes

Started by gicci,

Ian @ un4seen

Yes, the builds in the 16kb package above are still currently the latest. All newer Android library builds include 16kb support, so they're being removed from the separate 16kb package as they get updated.

gicci

I would like to start using the 16KB aligned versions of the libraries in the beta track of my app to gather feedback for possible issues. I am currently using the following libs (currently only the released ones, not any of the libs in the zip package):

BASS version: 2.4.17.16
BASS MIDI version: 2.4.15.3
BASS MIX version: 2.4.12.0
BASS FX version: 2.4.12.6
Plugin libbassflac.so version: 2.4.5.5
Plugin libbasswv.so version: 2.4.7.4

with the ABIs: "armeabi-v7a", "arm64-v8a", "x86", "x86_64"

Google Play Console reports the following noncompliance:

Libraries that do not support 16 KB:
base/lib/arm64-v8a/libbass.so
base/lib/arm64-v8a/libbassflac.so
base/lib/arm64-v8a/libbasswv.so
base/lib/x86_64/libbass.so
base/lib/x86_64/libbass_fx.so
base/lib/x86_64/libbassflac.so
base/lib/x86_64/libbassmix.so
base/lib/x86_64/libbasswv.so

Starting from this I have the following observations/questions:

  • libbass.so is not present in the zip file of the previous post but seems to be not 16KB ready.
  • libbass_fx.so and libbassmix.so for x86_64 seem to have some issue.
  • Libraries that I need in the zip file of the previous post (libbassflac.so and libbasswv.so) are provided for arm64-v8a and x86_64 only. 16KB alignment for those architectures is not needed, but it would be nice to have all of them so to be sure that we are using the same version for all the architectures.
  • It is not clear to me the role of the libraries in the c++_shared folder. Shall they be included in the APK, and if yes why they are not needed for the other libraries already 16KB compliant?

For completeness, the following is the output of the check_elf_alignment.sh script (https://developer.android.com/guide/practices/page-sizes), that seems to be equal to the report from Google Play console:

/x86/libbasswv.so: UNALIGNED (2**12)
/x86/libbass.so: UNALIGNED (2**12)
/x86/libbass_fx.so: UNALIGNED (2**12)
/x86/libbassflac.so: UNALIGNED (2**12)
/x86/libbassmix.so: UNALIGNED (2**12)
/x86/libbassmidi.so: ALIGNED (2**14)
/armeabi-v7a/libbasswv.so: UNALIGNED (2**12)
/armeabi-v7a/libbass.so: UNALIGNED (2**12)
/armeabi-v7a/libbass_fx.so: UNALIGNED (2**12)
/armeabi-v7a/libbassflac.so: UNALIGNED (2**12)
/armeabi-v7a/libbassmix.so: UNALIGNED (2**12)
/armeabi-v7a/libbassmidi.so: ALIGNED (2**14)
/arm64-v8a/libbasswv.so: UNALIGNED (2**12)
/arm64-v8a/libbass.so: UNALIGNED (2**12)
/arm64-v8a/libbass_fx.so: ALIGNED (2**16)
/arm64-v8a/libbassflac.so: UNALIGNED (2**12)
/arm64-v8a/libbassmix.so: ALIGNED (2**16)
/arm64-v8a/libbassmidi.so: ALIGNED (2**14)
/x86_64/libbasswv.so: UNALIGNED (2**12)
/x86_64/libbass.so: UNALIGNED (2**12)
/x86_64/libbass_fx.so: UNALIGNED (2**12)
/x86_64/libbassflac.so: UNALIGNED (2**12)
/x86_64/libbassmix.so: UNALIGNED (2**12)
/x86_64/libbassmidi.so: ALIGNED (2**14)
Found 18 unaligned libs (only arm64-v8a/x86_64 libs need to be aligned)

Thank you very much!

Ian @ un4seen

Quote from: gicciI would like to start using the 16KB aligned versions of the libraries in the beta track of my app to gather feedback for possible issues. I am currently using the following libs (currently only the released ones, not any of the libs in the zip package):

BASS version: 2.4.17.16
BASS MIDI version: 2.4.15.3
BASS MIX version: 2.4.12.0
BASS FX version: 2.4.12.6
Plugin libbassflac.so version: 2.4.5.5
Plugin libbasswv.so version: 2.4.7.4

with the ABIs: "armeabi-v7a", "arm64-v8a", "x86", "x86_64"

Google Play Console reports the following noncompliance:

Libraries that do not support 16 KB:
base/lib/arm64-v8a/libbass.so
base/lib/arm64-v8a/libbassflac.so
base/lib/arm64-v8a/libbasswv.so
base/lib/x86_64/libbass.so
base/lib/x86_64/libbass_fx.so
base/lib/x86_64/libbassflac.so
base/lib/x86_64/libbassmix.so
base/lib/x86_64/libbasswv.so

Starting from this I have the following observations/questions:

  • libbass.so is not present in the zip file of the previous post but seems to be not 16KB ready.
  • libbass_fx.so and libbassmix.so for x86_64 seem to have some issue.
  • Libraries that I need in the zip file of the previous post (libbassflac.so and libbasswv.so) are provided for arm64-v8a and x86_64 only. 16KB alignment for those architectures is not needed, but it would be nice to have all of them so to be sure that we are using the same version for all the architectures.

The builds in the 16kb package above have the same version numbers as the releases currently on the BASS webpage, so it should be fine to just replace the arm64-v8a and x86_64 files from the release packages with the files in the 16kb package.

In the case of BASS/BASSmix/BASS_FX, the latest builds including 16kb support are available separately here:

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

Note these don't match the versions on the BASS webpage, so shouldn't be mixed with them.

Quote from: gicci
  • It is not clear to me the role of the libraries in the c++_shared folder. Shall they be included in the APK, and if yes why they are not needed for the other libraries already 16KB compliant?

The BASSAPE and TAGS add-ons use the C++ standard library. The builds in the "c++_shared" folder share a copy of the C++ standard library (libc++_shared.so), while the builds outside there include their own built-in copies (which is why they're bigger). If you have more than one library using the C++ standard library then you would generally use the shared libc++_shared.so library with them. There's some more information on this here:

    https://developer.android.com/ndk/guides/cpp-support

gicci

Thank you, following your instructions I managed to have a fully 16KB aligned version.
I will let you know if any issue arises.

Ian @ un4seen

16kb builds are now included in the add-on packages on the BASS webpage, so the separate 16kb package (posted above) has been removed. The main BASS package hasn't been updated yet, so the BASS 16kb update is still a separate download for now, but a new release is coming soon.

hexise

#25
Quote from: Ian @ un4seen16kb builds are now included in the add-on packages on the BASS webpage, so the separate 16kb package (posted above) has been removed. The main BASS package hasn't been updated yet, so the BASS 16kb update is still a separate download for now, but a new release is coming soon.

I did not find 16kb update download from add-on packages on the BASS webpage, what I am searching is: https://www.un4seen.com/bass.html#addons

Update:

Nevermind, I downloaded the current libraries from BASS webpage and it seems they are 16kb aligned already. Thanks.

Francois33800

Hello,

I'm working on a video game project for Android using Unity, and I've integrated BASS and several of its add-ons. I've placed the native libraries (libbass.so, libbass_fx.so, libbassmidi.so, and libbassmix.so) in the correct arm64-v8a folder.

All the libraries except for libbass.so seem to work correctly, and I'm only seeing a 16KB alignment warning in the Unity inspector for the main libbass.so file. I'm using BASS version 2.4.17 for Android.

The other libraries from the same package don't have this issue. Do you have any idea why this might be happening, or if there's something I might be missing?

Thank you

Ian @ un4seen

The add-ons (on the BASS webpage) do all include 16kb page support now, but the BASS 2.4.17 release doesn't. Support is coming soon in the BASS 2.4.18 release. In the meantime, an update is available here:

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

rrhh_fx

Quote from: Ian @ un4seenThe add-ons (on the BASS webpage) do all include 16kb page support now, but the BASS 2.4.17 release doesn't. Support is coming soon in the BASS 2.4.18 release. In the meantime, an update is available here:

   www.un4seen.com/stuff/bass-android.zip
Hi Ian,

Does this build only add that change or are there other modifications compared to 2.4.17? And is it safe to use in production, or should be treated more like a pre-release until 2.4.18 is officially out?

Thanks!

Ian @ un4seen

That build is basically a pre-release of BASS 2.4.18, so it does also have other changes, but it should be fine to simply replace the BASS 2.4.17 libraries with it. If you would like to check what's new, updated documentation is available here:

    www.un4seen.com/stuff/bass.chm

Tadeu

Hello Ian,

Do you have an idea when BASS 2.4.18 will be officially released?

Thanks!

Ian @ un4seen

There isn't a set date for it, but it should be very soon. Perhaps even next week.