snipsco-samples / quickstart-android

Sample code for the Android Quick Start guide on the Snips Dev Center
https://docs.snips.ai/getting-started/quick-start-android
MIT License
5 stars 3 forks source link

Error: Snips processing service disconnected #1

Open Coruna opened 5 years ago

Coruna commented 5 years ago

Hello, I recently tried to get snips working on my Android phone (Samsung Galaxy S5 neo) but just got stuck in the beginning. I tried the quickstart code and only got error messages in logcat (see below). Snips tries to connect twice and then dies. Any ideas?

06-23 19:40:57.181 18977-18977/? E/Zygote: v2
06-23 19:40:57.191 18977-18977/? E/Zygote: accessInfo : 0
06-23 19:40:59.991 18977-18977/ai.snips.hellosnips E/SnipsPlatform: Snips processing service disconnected, attempting a reconnect
06-23 19:41:02.521 18977-18977/ai.snips.hellosnips E/SnipsPlatform: Snips processing service disconnected, attempting a reconnect
erksch commented 5 years ago

My problem exactly! Did you find a solution?

I/TextToSpeech: Connected to ComponentInfo{com.google.android.tts/com.google.android.tts.service.GoogleTTSService}
I/TextToSpeech: Set up connection to ComponentInfo{com.google.android.tts/com.google.android.tts.service.GoogleTTSService}
I/SnipsPlatform: Snips processing service connected, starting the platform
E/SnipsPlatform: Snips processing service disconnected, attempting a reconnect
D/MainActivity: Error: Remote service 
I/SnipsPlatform: Snips processing service connected, starting the platform
E/SnipsPlatform: Snips processing service disconnected, attempting a reconnect
D/MainActivity: Error: Remote service died
Deluvi commented 5 years ago

Hello everyone!

The log of the Snips processing service is missing, this is the log that I need to further debug this issue. You can find the logs in Logcat by selecting snipsProcessingService. Anyway, there is a common issue with the Android tutorial, so I will talk about this one first.

Unfortunately, there is an issue with our audio capture in the current Android SDK. Its fix is scoped for the next feature release. This demo has not been updated since the bug rose.

In the meantime, you can use the streaming functionality of the SDK (feeding yourself manually the audio samples). You can see an example on how to use the audio streaming on this other Snips demo. Don't forget to add .enableStreaming(true) on your SnipsPlatformClient builder.

erksch commented 5 years ago

Hey @Deluvi, thanks for answering!

Here are the snipsProcessingService related errors.

2019-07-17 17:38:11.495 26791-26834/com.test.erik.medixflow:snipsProcessingService E/snips-platform: snips_watch_hermes: snips watch hermes thread encountered an error: RecvError
2019-07-17 17:38:11.495 26791-26834/com.test.erik.medixflow:snipsProcessingService I/snips-platform: snips_watch_hermes: snips watch hermes thread finished
2019-07-17 17:38:11.500 26791-26822/com.test.erik.medixflow:snipsProcessingService E/snips-platform: snips_asr_hermes: The asr event receiver stopped: The event receiver broke
2019-07-17 17:38:11.500 26791-26822/com.test.erik.medixflow:snipsProcessingService E/snips-platform: snips_asr_hermes: The asr event channel stopped
2019-07-17 17:38:11.500 26791-26823/com.test.erik.medixflow:snipsProcessingService D/snips-platform: snips_nlu_hermes: nlu thread ended
2019-07-17 17:38:11.500 26791-26823/com.test.erik.medixflow:snipsProcessingService E/snips-platform: snips_nlu_hermes: nlu thread ended with error: failure to recv event
     -> caused by: receiving on a closed channel
2019-07-17 17:38:11.506 26791-26829/com.test.erik.medixflow:snipsProcessingService D/snips-platform: snips_audio_opensles: Record callback done
2019-07-17 17:38:11.506 26791-26809/com.test.erik.medixflow:snipsProcessingService E/AndroidRuntime: FATAL EXCEPTION: Thread-2
    Process: com.test.erik.medixflow:snipsProcessingService, PID: 26791
    java.lang.RuntimeException: receiving on a closed channel

        at ai.snips.platform.Megazord$Companion.parseError(Megazord.kt:47)
        at ai.snips.platform.Megazord$Companion.access$parseError(Megazord.kt:42)
        at ai.snips.platform.Megazord.start(Megazord.kt:83)
        at ai.snips.platform.SnipsProcessingService$registerClient$1.invoke(SnipsProcessingService.kt:114)
        at ai.snips.platform.SnipsProcessingService$registerClient$1.invoke(SnipsProcessingService.kt:25)
        at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)
2019-07-17 17:38:11.507 26791-26833/com.test.erik.medixflow:snipsProcessingService E/snips-platform: snips_broadcast_mqtt_server: audio loop for default crashed: bus was killed

I'll check out streaming in the mean time ;)

Deluvi commented 5 years ago

This looks like indeed the OpenSLES error. The streaming should fix this issue. Please tell me when you have tried if it worked or not. 🙂

Coruna commented 5 years ago

@Deluvi thanks for answering. When I select snipsProcessingService from logcat I get no output at all :(

I tried your suggested way with the streaming but even that example didn't work. That's what I get.

07-17 21:53:23.141 23261-23261/ai.snips.hellosnips I/TextToSpeech: Sucessfully bound to com.samsung.SMT
07-17 21:53:23.671 23261-23261/ai.snips.hellosnips I/TextToSpeech: Connected to ComponentInfo{com.samsung.SMT/com.samsung.SMT.SamsungTTSService}
07-17 21:53:23.691 23261-23638/ai.snips.hellosnips I/TextToSpeech: Set up connection to ComponentInfo{com.samsung.SMT/com.samsung.SMT.SamsungTTSService}
07-17 21:53:24.031 23261-23261/ai.snips.hellosnips I/SnipsPlatform: Snips processing service connected, starting the platform
07-17 21:53:24.601 23261-23597/ai.snips.hellosnips E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 1568)
07-17 21:53:24.601 23261-23597/ai.snips.hellosnips E/SnipsPlatform: Could not send message to Snips platform: Transaction failed on small parcel; remote process probably died
    android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(Binder.java:503)
        at android.os.IMessenger$Stub$Proxy.send(IMessenger.java:89)
        at android.os.Messenger.send(Messenger.java:57)
        at ai.snips.platform.SnipsPlatformClient$RemoteServiceImpl.send(SnipsPlatformClient.kt:257)
        at ai.snips.platform.SnipsPlatformClient.sendAudioBuffer(SnipsPlatformClient.kt:556)
        at ai.snips.hellosnips.MainActivity.runStreaming(MainActivity.java:300)
        at ai.snips.hellosnips.MainActivity.access$300(MainActivity.java:46)
        at ai.snips.hellosnips.MainActivity$11.run(MainActivity.java:283)
erksch commented 5 years ago

@Coruna make sure to select No Filters first in the dropdown on the right of the logcat toolbar before searching for snipsProcessingService entries.

@Deluvi I cloned the android demo repo and after getting all the assistant files to the correct location it works! Thank you for your time and support!

Coruna commented 5 years ago

@erksch thx for the tipp :) @Deluvi and here are my snipsProcessingService errors

07-20 15:47:10.821 2758-3587/? I/ActivityManager: Start proc 31314:ai.snips.hellosnips:snipsProcessingService/u0a217 for service ai.snips.hellosnips/ai.snips.platform.SnipsProcessingService
07-20 15:47:10.821 31314-31314/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=ai.snips.hellosnips:snipsProcessingService 
07-20 15:47:10.881 31314-31314/ai.snips.hellosnips:snipsProcessingService D/ResourcesManager: For user 0 new overlays fetched Null
07-20 15:47:11.031 31314-31314/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:11.631 31314-31314/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_slice_1_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:11.741 31314-31314/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_slice_3_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:11.811 31314-31314/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_slice_6_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:11.891 31314-31314/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_slice_7_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:11.991 31314-31314/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_slice_8_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:12.091 31314-31314/ai.snips.hellosnips:snipsProcessingService I/SnipsPlatform: registering client 143dc82c-5e4e-4c5c-b2ea-0b3884e4c4c8
07-20 15:47:12.191 31314-31314/ai.snips.hellosnips:snipsProcessingService I/System.out: Looking for library 'snips_megazord'
07-20 15:47:12.191 31314-31314/ai.snips.hellosnips:snipsProcessingService I/System.out: Adding paths from jna.library.path: null
07-20 15:47:12.191 31314-31314/ai.snips.hellosnips:snipsProcessingService I/System.out: Trying libsnips_megazord.so
07-20 15:47:12.211 31314-31314/ai.snips.hellosnips:snipsProcessingService W/linker: /data/app/ai.snips.hellosnips-2/lib/arm/libsnips_kaldi.so: unused DT entry: type 0x7ffffffd arg 0x1df61f
07-20 15:47:12.431 31314-31314/ai.snips.hellosnips:snipsProcessingService I/System.out: Found library 'snips_megazord' at libsnips_megazord.so
07-20 15:47:12.461 31314-31314/ai.snips.hellosnips:snipsProcessingService A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x366e6944 in tid 31314 (ocessingService)
07-20 15:47:12.531 2368-2368/? A/DEBUG: pid: 31314, tid: 31314, name: ocessingService  >>> ai.snips.hellosnips:snipsProcessingService <<<
07-20 15:47:13.031 2758-3248/? I/ActivityManager: Process ai.snips.hellosnips:snipsProcessingService (pid 31314)(adj 0) has died(32,581)
07-20 15:47:13.031 2758-3248/? D/ActivityManager: removeProcessNameLocked mProcessNames.remove pid=31314 ,hash=205122781 ,name=ai.snips.hellosnips:snipsProcessingService
07-20 15:47:14.051 2758-2913/? I/ActivityManager: Start proc 31372:ai.snips.hellosnips:snipsProcessingService/u0a217 for service ai.snips.hellosnips/ai.snips.platform.SnipsProcessingService
07-20 15:47:14.061 31372-31372/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=ai.snips.hellosnips:snipsProcessingService 
07-20 15:47:14.121 31372-31372/ai.snips.hellosnips:snipsProcessingService D/ResourcesManager: For user 0 new overlays fetched Null
07-20 15:47:14.221 31372-31372/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:14.561 31372-31372/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_slice_1_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:14.651 31372-31372/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_slice_3_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:14.751 31372-31372/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_slice_6_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:14.841 31372-31372/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_slice_7_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:14.921 31372-31372/ai.snips.hellosnips:snipsProcessingService W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/ai.snips.hellosnips-2/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@ai.snips.hellosnips-2@split_lib_slice_8_apk.apk@classes.dex) because non-0 exit status
07-20 15:47:14.961 31372-31372/ai.snips.hellosnips:snipsProcessingService I/SnipsPlatform: registering client a67cff5a-646b-4317-b3af-a9a9563c419f
07-20 15:47:15.031 31372-31372/ai.snips.hellosnips:snipsProcessingService I/System.out: Looking for library 'snips_megazord'
07-20 15:47:15.031 31372-31372/ai.snips.hellosnips:snipsProcessingService I/System.out: Adding paths from jna.library.path: null
07-20 15:47:15.031 31372-31372/ai.snips.hellosnips:snipsProcessingService I/System.out: Trying libsnips_megazord.so
07-20 15:47:15.031 31372-31372/ai.snips.hellosnips:snipsProcessingService W/linker: /data/app/ai.snips.hellosnips-2/lib/arm/libsnips_kaldi.so: unused DT entry: type 0x7ffffffd arg 0x1df61f
07-20 15:47:15.131 31372-31372/ai.snips.hellosnips:snipsProcessingService I/System.out: Found library 'snips_megazord' at libsnips_megazord.so
07-20 15:47:15.141 31372-31372/ai.snips.hellosnips:snipsProcessingService A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x366e6944 in tid 31372 (ocessingService)
07-20 15:47:15.201 2368-2368/? A/DEBUG: pid: 31372, tid: 31372, name: ocessingService  >>> ai.snips.hellosnips:snipsProcessingService <<<
07-20 15:47:15.511 2758-4313/? I/ActivityManager: Process ai.snips.hellosnips:snipsProcessingService (pid 31372)(adj 0) has died(27,568)
07-20 15:47:15.511 2758-4313/? D/ActivityManager: removeProcessNameLocked mProcessNames.remove pid=31372 ,hash=119997263 ,name=ai.snips.hellosnips:snipsProcessingService