Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builds with 16 KB page size #2041

Closed
NLLAPPS opened this issue Jun 19, 2024 · 9 comments · Fixed by #2126
Closed

Builds with 16 KB page size #2041

NLLAPPS opened this issue Jun 19, 2024 · 9 comments · Fixed by #2126
Assignees
Labels
bug P1 high priority

Comments

@NLLAPPS
Copy link

NLLAPPS commented Jun 19, 2024

Hi, as per https://developer.android.com/guide/practices/page-sizes, are there any plans to provide builds with 16 KB page size? If so, are you able to provide timeline?
Thank you

@philburk
Copy link
Collaborator

We will investigate this.

You could build Oboe from source by cloning the GitHub repo.
Then you could set the build options as you with.

@philburk
Copy link
Collaborator

Thanks for the question. We have reviewed the docs that you linked to.
It seems that if we build Oboe using 16 KB alignment then it will also work for 4 KB.

We are considering adding this line to our Oboe prebuilt script:

target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-Wl,-z,max-page-size=16384")

@NLLAPPS - Would that help you?

What is the impact if we do not do that? Does it mean that you would not be able to use Oboe on a 16KB aligned device?!

@NLLAPPS
Copy link
Author

NLLAPPS commented Jun 20, 2024

Hi, I was able to build by adding -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON to build_all_android.sh instead of target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-Wl,-z,max-page-size=16384")

-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON seems to be only available on ndk-r27-beta2+ and tell ndk to only use 16KB page size on x64 abis

Impact of not building 16KB seems to be that next year Google Play will start to refuse updates if your app has native binaries without 16KB page sizes. Article linked says "...We plan to make 16 KB page compatibility required for app uploads to the Google Play store next year..."

@philburk
Copy link
Collaborator

Thanks for the info. I appreciate you sharing your knowledge.

I think -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON is the way to go. But we should not make our prebuilt using a Beta NDK.

Maybe we can declare -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON for now and it will just be ignored by older NDK versions. Then when NDK-r27 is released it will take effect and we can spin a new Oboe release.

We can tell any developer that wants 16KB support to make sure they are using an NDK-r27 or later release.

@philburk philburk added the P1 high priority label Jul 8, 2024
philburk added a commit that referenced this issue Aug 8, 2024
WIP try to build with 16 KB pages to debug audio issues.

For #2041
See also b/358130477
@robertwu1
Copy link
Collaborator

See #2084

You should add target_link_options(oboetester PRIVATE "-Wl,-z,max-page-size=16384") and upgrade gradle.

@MikuAuahDark
Copy link

Hello, sorry for bumping.

Are there plans on new Oboe releases with 16KB pages? We're relying on Oboe AAR for the binaries. All of our dependencies has been compiled with 16KB page size in mind except Oboe. This result in crash in Android 15 AVD with 16KB pages when trying to load Oboe due to it being compiled with 4KB page size.

@robertwu1
Copy link
Collaborator

robertwu1 commented Dec 17, 2024

@MikuAuahDark can you help me test #2126? I uploaded a test prefab: oboe-1.9.2.zip

@MikuAuahDark
Copy link

Quick test with AVD with 16KB page size and the prefab seems to work.

@robertwu1
Copy link
Collaborator

Great! Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P1 high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants