weixin_39842237
weixin_39842237
2020-12-26 01:29

Android App crashes during speech recognition when SpeechConfig.fromEndpoint is used

Describe the bug I'm using speech containers (https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-container-howto), so I need to run the SpeechConfig.fromEndpoint function to configure the endpoint. The SpeechConfig object is created correctly, but when I start recording speech, the android app crashes.

But if you are very quiet and do not say anything, the app does not crash and the result is after a while "NoMatch".

To Reproduce Steps to reproduce the behavior: 1. take the sample for stt as a basis 2. replace SpeechConfig.fromSubscription(...) with SpeechConfig.fromEndpoint(endpointUri, subscriptionKey)

Version of the Cognitive Services Speech SDK 1.6 (and previous versions)

Version of Speech-To-Text Container 1.1.3-amd64-de-de-preview

Platform, Operating System, and Programming Language - OS: Android 8.0.0 - Testdevice: Samsung Galaxy S7 - Programming language: Java

Additional context Logcat: --------- beginning of crash 2019-07-04 14:19:11.676 8689-10644/com.example.testazurecognitiveservices A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 10644 (gnitiveservices) 2019-07-04 14:19:11.821 10694-10694/? I/crash_dump64: obtaining output fd from tombstoned 2019-07-04 14:19:11.829 4763-4763/? I//system/bin/tombstoned: received crash request for pid 8689 2019-07-04 14:19:11.838 10694-10694/? I/crash_dump64: performing dump of process 8689 (target tid = 10644) 2019-07-04 14:19:11.839 10694-10694/? A/DEBUG: 2019-07-04 14:19:11.839 10694-10694/? A/DEBUG: Build fingerprint: 'samsung/heroltexx/herolte:8.0.0/R16NW/G930FXXS4ESC3:user/release-keys' 2019-07-04 14:19:11.839 10694-10694/? A/DEBUG: Revision: '9' 2019-07-04 14:19:11.839 10694-10694/? A/DEBUG: ABI: 'arm64' 2019-07-04 14:19:11.839 10694-10694/? A/DEBUG: pid: 8689, tid: 10644, name: gnitiveservices >>> com.example.testazurecognitiveservices <<< 2019-07-04 14:19:11.839 10694-10694/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- 2019-07-04 14:19:11.840 10694-10694/? A/DEBUG: x0 0000000000000000 x1 0000000000002994 x2 0000000000000006 x3 0000000000000008 2019-07-04 14:19:11.840 10694-10694/? A/DEBUG: x4 00000074c88ff694 x5 00000074c88ff694 x6 00000074c88ff694 x7 0000007400000073 2019-07-04 14:19:11.840 10694-10694/? A/DEBUG: x8 0000000000000083 x9 2e00a9215fe5c391 x10 0000000000000000 x11 0000000000000001 2019-07-04 14:19:11.840 10694-10694/? A/DEBUG: x12 ffffffffffffffff x13 0000003000000030 x14 000000000000000d x15 aaaaaaaaaaaaaaab 2019-07-04 14:19:11.840 10694-10694/? A/DEBUG: x16 00000074ec2f22f8 x17 00000074ec293408 x18 00000000000b19b3 x19 00000000000021f1 2019-07-04 14:19:11.840 10694-10694/? A/DEBUG: x20 0000000000002994 x21 00000074c88ff650 x22 00000074ccc21b90 x23 00000000005a06e0 2019-07-04 14:19:11.840 10694-10694/? A/DEBUG: x24 00000074c88ff694 x25 000000000000000f x26 00000074c8900588 x27 00000074c88ff890 2019-07-04 14:19:11.840 10694-10694/? A/DEBUG: x28 00000074c8900588 x29 00000074c88ff510 x30 00000074ec245bd4 2019-07-04 14:19:11.840 10694-10694/? A/DEBUG: sp 00000074c88ff4d0 pc 00000074ec293410 pstate 0000000060000000 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: backtrace: 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #00 pc 000000000006b410 /system/lib64/libc.so (tgkill+8) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #01 pc 000000000001dbd0 /system/lib64/libc.so (abort+88) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #02 pc 000000000034e1cc /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (ZN9Microsoft17CognitiveServices6Speech4Impl24CSpxUspRecoEngineAdapter16OnSpeechFragmentERKNS1_3USP17SpeechFragmentMsgE+1632) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #03 pc 000000000031ecf4 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (_ZN9Microsoft17CognitiveServices6Speech4Impl26ISpxObjectWithSiteInitImplINS2_16ISpxUspCallbacksEE12InvokeOnSiteIZNS2_22CSpxUspCallbackWrapper16OnSpeechFragmentERKNS1_3USP17SpeechFragmentMsgEEUlNSt6__ndk110shared_ptrIS4_EEE_EEvT+84) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #04 pc 000000000031d0ec /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (ZN9Microsoft17CognitiveServices6Speech4Impl22CSpxUspCallbackWrapper16OnSpeechFragmentERKNS1_3USP17SpeechFragmentMsgE+48) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #05 pc 00000000003f0d68 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #06 pc 00000000003e9be8 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (_ZN9Microsoft17CognitiveServices6Speech3USP10Connection4Impl15OnTransportDataEP18_TransportResponsePv+5668) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #07 pc 00000000003fdde4 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #08 pc 000000000040dc6c /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #09 pc 00000000004072c8 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (socketio_dowork+612) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #10 pc 00000000003fd7e8 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (TransportDoWork+756) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #11 pc 00000000003e5374 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (_ZN9Microsoft17CognitiveServices6Speech3USP10Connection4Impl6DoWorkENSt6__ndk18weak_ptrIS4_EE+120) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #12 pc 00000000003eefe8 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #13 pc 000000000039f9a4 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (_ZNSt6__ndk113packaged_taskIFvvEEclEv+88) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #14 pc 000000000039ec4c /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (_ZN9Microsoft17CognitiveServices6Speech4Impl17CSpxThreadService4Task3RunEv+48) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #15 pc 000000000039ef90 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (_ZN9Microsoft17CognitiveServices6Speech4Impl17CSpxThreadService6Thread10WorkerLoopENSt6__ndk110shared_ptrIS4_EE+424) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #16 pc 00000000003a17d4 /data/app/com.example.testazurecognitiveservices-zVRomdsKKPljoekxUOGy4A==/lib/arm64/libMicrosoft.CognitiveServices.Speech.core.so (_ZNSt6__ndk114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEPFvNS_10shared_ptrIN9Microsoft17CognitiveServices6Speech4Impl17CSpxThreadService6ThreadEEEESE_EEEEEPvSI+76) 2019-07-04 14:19:11.856 10694-10694/? A/DEBUG: #17 pc 0000000000067d04 /system/lib64/libc.so (_ZL15__pthread_startPv+200) 2019-07-04 14:19:11.857 10694-10694/? A/DEBUG: #18 pc 000000000001f348 /system/lib64/libc.so (__start_thread+68) 2019-07-04 14:19:11.975 4738-10640/? W/AudioFlinger: RecordThread: buffer overflow 2019-07-04 14:19:11.992 4922-5146/? D/SensorHubManager: onGetSensorHubDataLocked: library(22) = 1, 1, 44, 1, 1, 1, 2, -92, 103, 36, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 48 2019-07-04 14:19:11.993 4922-5147/? D/CAE: onGetSensorHubData(SensorHubParserProvider.java:91) - onGetSensorHubData Event [event buffer len :22], AP_WAKEUP 2019-07-04 14:19:11.994 4922-5147/? I/CAE: parse(SensorHubParserProvider.java:192) - buffer size = 22 2019-07-04 14:19:11.995 4922-5147/? I/CAE: parse(SensorHubParserProvider.java:203) - 1, 1, 44, 1, 1, 1, 2, -92, 103, 36, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 48, 2019-07-04 14:19:11.996 4922-5147/? I/CAE: parse(SLMonitorRunner.java:301) - parse:4 2019-07-04 14:19:11.996 4922-5147/? D/CAE: parse(SLMonitorRunner.java:323) - dataSize:1 2019-07-04 14:19:11.997 4922-5147/? D/CAE: display(SLMonitorRunner.java:604) - ================= STEP_LEVEL_MONITOR ================= 2019-07-04 14:19:11.998 4922-5147/? I/CAE: display(SLMonitorRunner.java:721) - DT=[1], DC=[1], TS=[1562242728740], ST=[SE], SC=[0], DI=[0.0], CA=[0.0], DU=[10032] 2019-07-04 14:19:11.999 4922-5151/? D/SemContextService: Service.updateContext() : service = Step Level Monitor 2019-07-04 14:19:12.002 12416-17318/? I/Sensor[0x06]: [0x01] 33 2019-07-04 14:19:12.002 12416-17318/? I/Sensor[0x04]: [0x01] 1562242728740[0x02] 0[0x03] 2[0x04] 10032 2019-07-04 14:19:12.983 4763-4763/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones//tombstone_01 2019-07-04 14:19:12.993 4922-10695/? W/ActivityManager: crash : com.example.testazurecognitiveservices,0 2019-07-04 14:19:12.994 4922-10695/? W/ActivityManager: Force finishing activity com.example.testazurecognitiveservices/.MainActivity 2019-07-04 14:19:12.994 4922-10695/? W/MultiScreenManagerService: moveTaskBackToDisplayIfNeeded(): root activity or app is null, task=TaskRecord{7953d93d0 #7660 A=com.example.testazurecognitiveservices U=0 StackId=1 sz=1}, rootActivity=null 2019-07-04 14:19:12.995 4922-4922/? D/MdnieScenarioControlService: Listener Real Multi Window State : true 2019-07-04 14:19:13.025 4922-4994/? D/CustomFrequencyManagerService: acquireDVFSLockLocked : type : DVFS_MIN_LIMIT frequency : 2600000 uid : 1000 pid : 4922 pkgName : AMS_APP_HOME 2019-07-04 14:19:13.027 4922-4994/? D/ActivityManagerPerformance: AMP_acquire() HOME 2019-07-04 14:19:13.029 3192-3192/? E/lowmemorykiller: Error writing /proc/8689/oom_score_adj; errno=22 2019-07-04 14:19:13.037 4922-4999/? I/ActivityManager: Showing crash dialog for package com.example.testazurecognitiveservices u0 2019-07-04 14:19:13.042 10200-10200/? I/DMT-SMReceiver: Received : com.samsung.android.sm.ACTION_ERROR 2019-07-04 14:19:13.045 4922-4999/? D/ScrollView: initGoToTop

该提问来源于开源项目:Azure-Samples/cognitive-services-speech-sdk

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39732249 weixin_39732249 4月前

    Hi ,

    if you're using recognizeOnceAsync(), can you try with the endpoint ending in /speech/recognition/interactive/cognitiveservices/v1 instead of /speech/recognition/dictation/cognitiveservices/v1, as is suggested by the container documentation?

    Or use the suffix /speech/recognition/dictation/cognitiveservices/v1 or /speech/recognition/conversation/cognitiveservices/v1 but switch to startContinuousRecognitionAsync() / stopContinuousRecognitionAsync() ?

    (Definitely we shouldn't crash here, we'll take a look at that. Also, we'll try to improve the docs...)

    Thanks, Mark

    点赞 评论 复制链接分享
  • weixin_39842237 weixin_39842237 4月前

    Hi -msft, your first workaround works for me. Thank you. But what exactly is the difference between dictation and interactive endpoint?

    Best regards, Sebastian

    点赞 评论 复制链接分享
  • weixin_39622891 weixin_39622891 4月前

    recognizeOnceAsync is using interactive mode, expects an audio message of maximum of 15 seconds and expects only one result out of the analysis of this audio fragment. The usage is typical command and control scenarios, you say one command, decode the command, and then initiate one action

    ContinuousRecognition uses conversation/dictation modes for an ongoing transcription of a lengthy audio stream. You keep speaking and will receives a continous stream of hypothesis and results from the services.

    Wolfgang

    点赞 评论 复制链接分享
  • weixin_39622891 weixin_39622891 4月前

    closing - ....

    点赞 评论 复制链接分享

相关推荐