vosk-api icon indicating copy to clipboard operation
vosk-api copied to clipboard

Support for android 4.4.4 (kitkat)

Open josefeliuf opened this issue 2 years ago • 21 comments

Hey guys! i was wondering if this library would still work on sdk levels below 21 (like 19).

EDIT: also if you know other libraries that have support for android kitkat and are open source let me know!

Thanks :)

josefeliuf avatar Jan 26 '22 19:01 josefeliuf

There should be no problem to lower the requirements, I don't remember what was the issue. Probably a gradle plugin version or something minor. Or maybe ndk didn't support some function.

You can try to lower the requirement and build the plugin, hopefully it will work, otherwise we can fix it.

nshmyrev avatar Jan 26 '22 22:01 nshmyrev

Hello! I tried this on my kitkat device and I got the following error:

dlopen("/data/app-lib/org.vosk.demo-2/libvosk.so") failed: dlopen failed: cannot locate symbol "rand" referenced by "libvosk.so"...

can you help me?

EDIT: i found this, it might help: https://github.com/android/ndk/issues/844

josefeliuf avatar Jan 27 '22 20:01 josefeliuf

Hm, yeah, following https://stackoverflow.com/questions/27091001/how-to-use-mkfifo-using-androids-ndk/27093163#27093163 seems like there are troubles. One has to compile a separate version. I might look on this some time later, not sure about deadline though.

nshmyrev avatar Jan 28 '22 00:01 nshmyrev

Okay, let me know if there is anything i could help!

josefeliuf avatar Jan 28 '22 13:01 josefeliuf

Any updates on this? @nshmyrev

josefeliuf avatar Feb 01 '22 15:02 josefeliuf

It is not going to be fast, maybe couple months ;)

nshmyrev avatar Feb 01 '22 17:02 nshmyrev

Hello, I am also interested in this. Hopefully it can be built also on at least MinSDK 18

leonilocarandang avatar Jul 22 '22 01:07 leonilocarandang

@leonilocarandang I hope that too!

nshmyrev avatar Aug 02 '22 21:08 nshmyrev

Did anyone get it working? Seems like even when compiling with API Target 19, it still fails for me, even when fixing/removing rand_r, its still not finding the symbol "signal" when running on android 4.4. I guess its just not working for such an old android version.

Adammantium avatar Mar 13 '23 16:03 Adammantium

You can remove that signal stuff from sources probably.

We can compile for older android, it just takes effort on our side.

nshmyrev avatar Mar 13 '23 18:03 nshmyrev

Well, i will give that a try, I just did't want to start ripping stuff out until it "works". I don't know how much I will have to remove for that.

Adammantium avatar Mar 14 '23 06:03 Adammantium

@leonilocarandang I hope that too!

@nshmyrev , Is the way to build for older android the one described in this section "Compilation from source" in this link https://alphacephei.com/vosk/install ? I would like to try it although I am new to building libraries such as SO

leonilocarandang avatar Mar 16 '23 11:03 leonilocarandang

@leonilocarandang I suggest you to go ahead and try! If you have any questions just ask.

nshmyrev avatar Mar 16 '23 12:03 nshmyrev

Visual Studio terminal, Windows Powershell

You need Linux, it is not going to work on Windows.

nshmyrev avatar Mar 16 '23 13:03 nshmyrev

Visual Studio terminal, Windows Powershell

You need Linux, it is not going to work on Windows.

@nshmyrev , yes I realized that. I installed Git Bash and was able to run the bash file inside lib folder. But it did not create .so files. I do not know how to attach file here but here are some of the errors **build-vosk.sh: line 119: make: command not found

  • cd /c/vosk-api/android/lib/build/kaldi_x86/kaldi/src**
  • cp /c/vosk-api/android/lib/build/kaldi_x86/vosk/libvosk.so /c/vosk-api/android/lib/build/kaldi_x86/../../src/main/jniLibs/x86/libvosk.so cp: cannot stat '/c/vosk-api/android/lib/build/kaldi_x86/vosk/libvosk.so': No such file or directory

Does these errors mean, I need to run this in Linux env? Or I just need to install something in Windows env?

leonilocarandang avatar Mar 16 '23 14:03 leonilocarandang

You need Linux

nshmyrev avatar Mar 16 '23 18:03 nshmyrev

So, i tried using different NDKs to try to compile it for API Level 19 and lower. It still is showing me the "symbol 'signal' not found" error. So i guess, it's somehow still not really the correct API-Level. At this point, i dont know what else to try and where to properly set the Target API Level. I dont really know how the whole compile process is working, never really used the NDK before. So any tips would be appreciated. :)

EDIT: I was using the build-vosk.sh file to generate the .so

Adammantium avatar Mar 16 '23 22:03 Adammantium

You need to edit source code to bypass that part that uses signal method

nshmyrev avatar Mar 16 '23 22:03 nshmyrev

I was able to install the demo on JellyBean 4.0 & 4.3. VoskActivity shows up without error but once it finished transferring the language Model files to Android/data, it throws the attached errors: Vosk-android-.txt

leonilocarandang avatar Mar 17 '23 12:03 leonilocarandang

Did anyone get it working? Seems like even when compiling with API Target 19, it still fails for me, even when fixing/removing rand_r, its still not finding the symbol "signal" when running on android 4.4. I guess its just not working for such an old android version.

I also encountered this problem. But I don't know how to solve it. I can't find where I used it.

hqweb avatar Feb 27 '24 10:02 hqweb