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

Multiple hotwords for Android #283

Closed
TyMarc opened this issue Sep 26, 2017 · 5 comments
Closed

Multiple hotwords for Android #283

TyMarc opened this issue Sep 26, 2017 · 5 comments

Comments

@TyMarc
Copy link

TyMarc commented Sep 26, 2017

Looking at the documentation, we have an example to use multiple models for detection in python. I'm currently working on an Android application that uses your library and it's working great with one model. If I initialise the SnowboyDetect with two models using "file/path/1.pmdl,file/path/2.pmdl", it crashes directly.

http://docs.kitt.ai/snowboy/#multiple-models-and-callbacks

Is it not supported on Android even if it's only a wrapper?

@TyMarc
Copy link
Author

TyMarc commented Sep 28, 2017

I've looked into the .cc files of the Python and Android implementations and they look exactly the same as per what they are doing before sending the model string to the .so file.

For reference, my model string look like this:

modelStr=/data/user/0/com.example.test/files/recognition/start_recording.pmdl,/data/user/0/com.example.test/files/recognition/hold_the_call.pmdl

As soon as I pass this model string in the JNI, I have a fatal crash:

09-28 11:08:29.128 25271 25435 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 25435 (Thread-25)
09-28 11:08:29.195 25445 25445 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-28 11:08:29.195 25445 25445 F DEBUG : Build fingerprint: 'lge/elsa_nao_us/elsa:7.0/NRD90M/163401856563e:user/release-keys'
09-28 11:08:29.195 25445 25445 F DEBUG : Revision: '12'
09-28 11:08:29.195 25445 25445 F DEBUG : ABI: 'arm'
09-28 11:08:29.196 25445 25445 F DEBUG : pid: 25271, tid: 25435, name: Thread-25 >>> com.example.test:service <<<
09-28 11:08:29.196 25445 25445 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
09-28 11:08:29.196 25445 25445 F DEBUG : r0 00000000 r1 0000635b r2 00000006 r3 00000008
09-28 11:08:29.196 25445 25445 F DEBUG : r4 cfbfe978 r5 00000006 r6 cfbfe920 r7 0000010c
09-28 11:08:29.196 25445 25445 F DEBUG : r8 d0524160 r9 d0df2ed8 sl 00000000 fp d0dfb154
09-28 11:08:29.196 25445 25445 F DEBUG : ip 00000000 sp cfbfda60 lr f2b3c927 pc f2b3f1a8 cpsr 200f0010
09-28 11:08:29.199 25445 25445 F DEBUG :
09-28 11:08:29.199 25445 25445 F DEBUG : backtrace:
09-28 11:08:29.199 25445 25445 F DEBUG : #00 pc 0004a1a8 /system/lib/libc.so (tgkill+12)
09-28 11:08:29.199 25445 25445 F DEBUG : #1 pc 00047923 /system/lib/libc.so (pthread_kill+34)
09-28 11:08:29.199 25445 25445 F DEBUG : #2 pc 0001d85d /system/lib/libc.so (raise+10)
09-28 11:08:29.199 25445 25445 F DEBUG : #3 pc 00019355 /system/lib/libc.so (__libc_android_abort+34)
09-28 11:08:29.199 25445 25445 F DEBUG : #4 pc 000173c8 /system/lib/libc.so (abort+4)
09-28 11:08:29.199 25445 25445 F DEBUG : #5 pc 000bebfb /data/app/com.example.test-2/lib/arm/libsnowboy-detect-android.so (_ZN9__gnu_cxx27__verbose_terminate_handlerEv+226)
09-28 11:08:29.199 25445 25445 F DEBUG : #6 pc 00088375 /data/app/com.example.test-2/lib/arm/libsnowboy-detect-android.so (_ZN10__cxxabiv111__terminateEPFvvE+4)
09-28 11:08:29.199 25445 25445 F DEBUG : #7 pc 000879ef /data/app/com.example.test-2/lib/arm/libsnowboy-detect-android.so
09-28 11:08:29.199 25445 25445 F DEBUG : #8 pc 00088189 /data/app/com.example.test-2/lib/arm/libsnowboy-detect-android.so
09-28 11:08:29.199 25445 25445 F DEBUG : #9 pc 000c9b00 /data/app/com.example.test-2/lib/arm/libsnowboy-detect-android.so
09-28 11:08:29.199 25445 25445 F DEBUG : #10 pc 000c9cec /data/app/com.example.test-2/lib/arm/libsnowboy-detect-android.so (__gnu_Unwind_RaiseException+148)
09-28 11:08:29.199 25445 25445 F DEBUG : #11 pc 000ca808 /data/app/com.example.test-2/lib/arm/libsnowboy-detect-android.so (_Unwind_RaiseException+20)`

@TyMarc
Copy link
Author

TyMarc commented Oct 2, 2017

Any help available?

@chenguoguo
Copy link
Collaborator

You have to change the sensitivity. If you have two models, provide the sensitivity as something like "0.5,0.6", where the sensitivity of the first model is 0.5, and that of the second is 0.6

@TyMarc
Copy link
Author

TyMarc commented Oct 2, 2017

Thanks a bunch, it's working!

@TyMarc TyMarc closed this as completed Oct 2, 2017
@naveensingh
Copy link

naveensingh commented Dec 31, 2018

"0.6,0.5" doesn't seem to work in SnowboyAlexaDemo app for two models,
At first, I used

detector.SetSensitivity("0.6,0.5")

in RecordingThread.java.

It crashed, so I used this in SnowboyDetect.java wrapper :

snowboyJNI.SnowboyDetect_SetSensitivity(swigCPtr, this, "0.8, 0.5");

this too crashed. :(

(I'm new to java, so forgive me for stupidity ;)
Please help

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

No branches or pull requests

3 participants