Skip to content

Add 16 kb page support to decoder_flac to support Android 15 #1685

Closed
@maxoertel

Description

@maxoertel

Version

Media3 main branch

More version details

Android 15 adds support for devices with 16 kb page size memory. Any native parts of the app need to be rebuild, otherwise apps will crash at these new devices. Currently, the Flac extension of Exoplayer does not support this. Hence, validating the APK shows UNALIGNED:

Screenshot 2024-09-02 at 11 37 50

TODO:

  • Follow steps here to add 16 kb page size support

Devices that reproduce the issue

Any

Devices that do not reproduce the issue

Reproducible in the demo app?

Yes

Reproduction steps

  1. Build and run the debug app.
  2. Locate the debug APK and unzip it
  3. Use the alignment.sh script provided in the official migration guide linked above and run this command:
    sh alignment.sh my_apk_out | grep "arm64-v8a"

(where my_apk_out is the unzipped apk)

Expected result

libflacJNI.so (the Flac lib) should say ALIGNED

Actual result

It says UNALIGNED

Media

Bug Report

  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Activity

rohitjoins

rohitjoins commented on Oct 9, 2024

@rohitjoins
Contributor

Hi @maxoertel,

Thank you for raising this issue. We will add support for 16KB page to all the extension modules and keep you updated.

rohitjoins

rohitjoins commented on Oct 10, 2024

@rohitjoins
Contributor

Hi @maxoertel,

Support for 16 KB page size has been added. Thank you once again for raising this issue.

maxoertel

maxoertel commented on Oct 11, 2024

@maxoertel
Author

Thx @rohitjoins for adding 16 KB page size support 💪🏼

Tolriq

Tolriq commented on Oct 11, 2024

@Tolriq
Contributor

@rohitjoins AFAIK 16k pages requires NDK 27 and all the docs still references NDK 21 as tested solution. Might worth a doc update?

maxoertel

maxoertel commented on Oct 11, 2024

@maxoertel
Author

@Tolriq I'm very confident that NDK 27 is not required for 16kb pare support. We updated our own libs already and still use NDK 21 and it works fine.

Google even has a dedicated section for below NDK 27: https://developer.android.com/guide/practices/page-sizes#compile-r26-lower

Tolriq

Tolriq commented on Oct 11, 2024

@Tolriq
Contributor

Yes but from that part:

In order to test on those lower versions of the NDK on 16 KB devices, canary releases of LTS NDK versions [r21](https://ci.android.com/builds/branches/aosp-ndk-release-r21/grid) (for Windows and Linux only), [r23](https://ci.android.com/builds/branches/aosp-ndk-release-r23/grid), and [r25](https://ci.android.com/builds/branches/aosp-ndk-r25-release/grid) are available on Android CI with 16 KB aligned libc++_shared.so libraries. Regardless, it is recommended to move to Android NDK r27 or higher to update to the 16 KB ELF aligned version of the C++ standard library. Otherwise, your app will fail to install on 16 KB devices today.

Says it requires canary versions of those NDK

rohitjoins

rohitjoins commented on Oct 11, 2024

@rohitjoins
Contributor

Hi @Tolriq,

We recently streamlined the build process for most decoder extensions by switching from ndk-build to CMake. Users no longer need to manually check out the NDK or rely on it directly. Once we upgrade to AGP versions that support NDK version 27, we might need to update the flags for 16 KB page sizes.

Eg: Simplified Flac extension build process

12 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Tolriq@rohitjoins@maxoertel

      Issue actions

        Add 16 kb page support to `decoder_flac` to support Android 15 · Issue #1685 · androidx/media