Compatibility with 16KB devices
When compiling whisper_native in Android Studio Narwhal Patch 1 I get the following error:
Do I need to do something to make it compatible with 16KB page sizes, or does that need to happen at the repo end?
Cheers,
Can you try whisper_java?
Thanks Vilas. Same thing:
My limited understanding is that libtensorflowlite_jni.so and the other .so files need recompiling with clang flags to support 16kB page sizes
If you compile whisper_java, it will fetch prebuilt library libtensorflowlite_jni.so from gradle repo. You can try changing library version in dependency list.
Thanks. The problem seems to be that that pre-built library doesn't support 16kB page sizes. So the new Android restriction will stop it being used in apps.
The issue remains after updating to org.tensorflow:tensorflow-lite:2.17.0 and org.tensorflow:tensorflow-lite-support:0.5.0
I don't understand tensorflow at all, or .so files. Is there a way of getting an .so file that's compiled for 16kB pages?
The libtensorflowlite.so file is being picked up from your repo here: whisper_native/app/src/main/cpp/tf-lite-api/generated-libs/arm64-v8a
Is it possible to replace it with a new version that supports 16kB page sizes?
Hi @KiwiWilkinson , I see in latest update #38 @yong1020 has shared the libs.
Thanks Vilas.
I also needed to change a couple of things in the project to get other .so files to be 16BK aligned:
-
libaudioEngine.so: I added set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=16384") to whispernative\src\main\cpp\makelists.txt
-
libtensorflowlite_jni.so I changed the dependencies in build.gradle to: implementation 'org.tensorflow:tensorflow-lite:2.17.0' implementation 'org.tensorflow:tensorflow-lite-support:0.5.0'
If you're going to release a new version of Whisper to include the new libtensorflowlite.so, then you probably want to make these changes as well.