You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cloned your repository and run from Win11 editor. It works awesome.
But when i built it for Android (Google Pixel 3a) it works very slow. Simple phrace 3 seconds length processed over 30 seconds.
Speedup feature throws an error (-1) even in editor.
Turning on more than 1 thread change processing time to 16 seconds. Better, but still not for production app.
Run Cmake with this args:
cmake -DCMAKE_TOOLCHAIN_FILE="E:\Programs\Unity\2022.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake\android.toolchain.cmake"
-DANDROID_ABI=arm64-v8a
-DBUILD_SHARED_LIBS=OFF
-DWHISPER_BUILD_TESTS=OFF
-DWHISPER_BUILD_EXAMPLES=OFF
-DANDROID_PLATFORM=29
-DANDROID_NATIVE_API_LEVEL=29
-DCMAKE_BUILD_TYPE=Release
-G "MinGW Makefiles"
-DCMAKE_MAKE_PROGRAM="E:\whisper\CMakeLists.txt"
Run Makefile with Mingw32.
As result i got a "libwhisper.a" file. But it weight 1,43 MB, when your precompiled version weight 13,9 MB.
When i tried to build .apk file with mine library i got an error
"android error: undefined symbol: stdout" (and stderr).
The easiest way to recompile whisper.cpp from source is to use Github Action. It uses ready-to-use instances, so you won't have any problems with build tools. You can create your own fork and run "Build C++" action there. Check readme for more info.
If you still struggle to recompile whisper.cpp on your local machine, maybe it worth trying to ask guys in original whisper.cpp repo. I never tried to build Android libs of whisper.cpp on Windows, so I won't be able to help what might be a problem.
As for making Android work faster, check #47. It is known problem with whisper.cpp, which wasn't addressed by original dev team yet.
I cloned your repository and run from Win11 editor. It works awesome.
But when i built it for Android (Google Pixel 3a) it works very slow. Simple phrace 3 seconds length processed over 30 seconds.
Speedup feature throws an error (-1) even in editor.
Turning on more than 1 thread change processing time to 16 seconds. Better, but still not for production app.
But i saw how Whisper for android works in another repos:
https://www.youtube.com/watch?v=w9pohi9NQrg
This video is part of demo in this repo:
https://github.com/vilassn/whisper_android
Method that runs so slow in on Whisper side. As solution i selected to try to recompile a library with few arguments that can tweak perfomance.
What i tried to do:
Cloned the original whisper.cpp repository, but 1.5.4 checkout
In "CMakeLists.txt" i added few lines on top because it doesn't processes without it:
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
Run Cmake with this args:
cmake -DCMAKE_TOOLCHAIN_FILE="E:\Programs\Unity\2022.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake\android.toolchain.cmake"
-DANDROID_ABI=arm64-v8a
-DBUILD_SHARED_LIBS=OFF
-DWHISPER_BUILD_TESTS=OFF
-DWHISPER_BUILD_EXAMPLES=OFF
-DANDROID_PLATFORM=29
-DANDROID_NATIVE_API_LEVEL=29
-DCMAKE_BUILD_TYPE=Release
-G "MinGW Makefiles"
-DCMAKE_MAKE_PROGRAM="E:\whisper\CMakeLists.txt"
Run Makefile with Mingw32.
As result i got a "libwhisper.a" file. But it weight 1,43 MB, when your precompiled version weight 13,9 MB.
When i tried to build .apk file with mine library i got an error
"android error: undefined symbol: stdout" (and stderr).
What i does wrong?
Win 11, Unity 2022.3.10f1, CMake 3.29, MinGW 3.80.3.
The text was updated successfully, but these errors were encountered: