mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

Support of 16KB page sizes

Open mimai-hen opened this issue 1 year ago • 11 comments

Android 15 will now offer support for 16KB page size. Then, all shared libraries shipped within Android apps must be recompiled to support 16KB page size. See documentation :

https://developer.android.com/guide/practices/page-sizes https://source.android.com/docs/core/architecture/16kb-page-size/16kb

I've checked ELF alignment of shared libraries in my project, and result shows that libmediapipe_tasks_vision_jni.so is not aligned : lib/arm64-v8a/libmediapipe_tasks_vision_jni.so: \e[31mUNALIGNED\e[0m (2**12)

This issue is to ask support for Android 16KB page size in mediapipe lib. Thanks

mimai-hen avatar Nov 14 '24 09:11 mimai-hen

Hi @mimai-hen,

Could you please provide more details about your query regarding support for 16KB pages? We are having difficulties to understand it clearly.

Thank you!!

kuaashish avatar Nov 15 '24 06:11 kuaashish

Hi,

I’ll try to explain. In my Android project I use mediapipe task vision com.google.mediapipe:tasks-vision:0.10.18 for face detection.

When I launch my application on an Android 15 (with 16KB page size) emulator, it crashes when I try using face detection feature :

13:05:37.591 A Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x767d224a47f0 in tid 3371 (xxx.pro.debug), pid 3371 (frica.pro.debug) 13:05:38.007 A pid: 3371, tid: 3371, name: frica.pro.debug >>> xxx.pro.debug <<< 13:05:38.007 A #00 pc 0000000000bc47f0 /data/app/~~L48Lg1SFS4Btj8M5vE4IXw==/xxx.pro.debug-yimG5q0h5w9HtxLEz7xbSw==/lib/arm64/libmediapipe_tasks_vision_jni.so (BuildId: bca8e7908753794146dd5fbd3c1ea403) 13:05:38.007 A #01 pc 0000000000bbee84 /data/app/~~L48Lg1SFS4Btj8M5vE4IXw==/com.orange.money.africa.pro.debug-yimG5q0h5w9HtxLEz7xbSw==/lib/arm64/libmediapipe_tasks_vision_jni.so (BuildId: bca8e7908753794146dd5fbd3c1ea403)

When I launch my application on an Android 15 (with standard 4KB page size) face detection works fine, as well as previous android versions.

In order to make it work on Android 15 (with 16KB page size), some adaptations must be made to native shared libs (here libmediapipe_tasks_vision_jni.so)

Please read carefully android developers guidelines about 16KB memory page size support : https://developer.android.com/guide/practices/page-sizes?hl=en

I apologize if it’s not the right place to ask for this issue to be fixed (in that case, may be you can let me know where I should post this issue)

I hope it’s more clear. Kind regards,

mimai-hen avatar Nov 15 '24 13:11 mimai-hen

This issue was fixed in tensorflow lite for arm64: https://github.com/tensorflow/tensorflow/issues/69459 Maybe something similar can be done here.

It would also be nice to fix it for other processor architectures: https://github.com/google-ai-edge/LiteRT/issues/43

v-hogood avatar Dec 14 '24 19:12 v-hogood

@schmidt-sebastian @kuaashish Do we have any updates on this issue? It's blocking our app from targeting Android 15.

mohammadddgh avatar Feb 26 '25 16:02 mohammadddgh

As an extra point Google Play will require all apps to be compatible on November 1, 2025. So currently any app that uses Mediapipe won't be able to publish updates anymore from November on. http://android-developers.googleblog.com/2025/05/prepare-play-apps-for-devices-with-16kb-page-size.html

gabrielittner avatar May 09 '25 07:05 gabrielittner

Confirming this is also a problem for task-text lib/arm64-v8a/libmediapipe_tasks_text_jni.so: \e[31mUNALIGNED\e[0m (2**12)

jared-loseit avatar May 12 '25 20:05 jared-loseit

@schmidt-sebastian can you give a status on this issue ? thanks

mimai-hen avatar May 15 '25 13:05 mimai-hen

This issue is also preventing me from updating my app to Android 15. Checked with litert 1.3.0, it still doesn't support 16kb page size.

barantes avatar May 22 '25 01:05 barantes

I'm facing the same issue. Any update?

adielwes avatar May 23 '25 16:05 adielwes

I believe this library is a wrapper around LiteRT? It looks like LiteRT got a new alpha update (2.0.0-alpha) which introduces 16kb page size.

https://github.com/google-ai-edge/mediapipe/issues/5728

Could we please get an updated version of MediaPipe using the new LiteRT? It should solve this issue, thanks!

SeanBlahovici avatar Jun 10 '25 14:06 SeanBlahovici

upvote

DanyloOliinykSSG avatar Jun 10 '25 16:06 DanyloOliinykSSG

@whhone any update ? we'll soon have to remove face detection from our app because our publication department receives too much warnings from google playstore :-/

mimai-hen avatar Jul 04 '25 13:07 mimai-hen

We are looking into it. We are hoping to release this in 1 or 2 weeks, as soon as we can.

whhone avatar Jul 07 '25 16:07 whhone

Please upgrade to the latest version 0.10.26 to get the 16kb page size support.

whhone avatar Jul 10 '25 16:07 whhone

@whhone Thank you very much, I confirm it is fixed in my application using version 0.10.26

mimai-hen avatar Jul 21 '25 08:07 mimai-hen

@mimai-hen for stability on x32 devices better use 0.10.26.1

Here's my thread about it: https://github.com/google-ai-edge/mediapipe/issues/6035#issuecomment-3075347838

DanyloOliinykSSG avatar Jul 21 '25 12:07 DanyloOliinykSSG

@whhone i tried to update to latest version but i am still getting the 16kb error

npmnishantsharma avatar Sep 25 '25 11:09 npmnishantsharma

We have updated all of our samples in https://github.com/google-ai-edge/mediapipe-samples to use the new libraries (now 0.10.29) and all of our apps compile with 16 kB alignment. Can you take a look at these?

Image

schmidt-sebastian avatar Sep 25 '25 17:09 schmidt-sebastian

For anyone stumbling here, the latest major version is indeed 0.10.x and not 0.2023x as some IDE likes to point that out.

More info: https://github.com/google-ai-edge/mediapipe/issues/5588 https://mvnrepository.com/artifact/com.google.mediapipe/tasks-vision

bijaykumarpun avatar Nov 01 '25 07:11 bijaykumarpun