Azure-Samples / cognitive-services-speech-sdk

Sample code for the Microsoft Cognitive Services Speech SDK
MIT License
2.74k stars 1.81k forks source link

[Linux] Failed to initialize platform (azure-c-shared) Error: 2176 #2385

Open ryanleung96 opened 2 months ago

ryanleung96 commented 2 months ago

Describe the bug

The latest Speech SDK v1.37.0 doesn't work with OpenSSL 1.1.1k (RHEL 8). Error code shows 2176. Speech SDK log shows ssl library is not loaded. That makes no sense when the OpenSSL is installed.

To Reproduce

Steps to reproduce the behavior:

  1. Install Speeck SDK binary by following the instructions
  2. Start the Unimrcp server, waiting to new session
  3. Run the test cases in MRCP plugins using the umc command
  4. Unimrcp server throws error when initizing the speech service session

Expected behavior

MRCP server can initialize the session for Speech recogizer and synthizer using speech SDK regardless the version of OpenSSL installed on my machine

Version of the Cognitive Services Speech SDK

v1.37.0

Platform, Operating System, and Programming Language

Additional context

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_BUGZILLA_PRODUCT_VERSION=8.6 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="8.6"

openssl version

OpenSSL 1.1.1k FIPS 25 Mar 2021


- Error messages from MRCP server:

2024-05-20 17:54:02:631829 [INFO] Assign Control Channel e34a12fc168e11ef@speechsynth to Connection :1544 <-> :39028 [0] -> [1] 2024-05-20 17:54:02:631859 [DEBUG] Signal Message to [MRCP Server] [0x7f96bc0030c0;2;3] 2024-05-20 17:54:02:631902 [DEBUG] Wait for Messages [MRCPv2-Agent-1] timeout [600000] 2024-05-20 17:54:02:631914 [DEBUG] Process Message [MRCP Server] [0x7f96bc0030c0;2;3] 2024-05-20 17:54:02:631949 [DEBUG] Dispatch Signaling Message [1] 2024-05-20 17:54:02:631966 [INFO] Process SPEAK Request e34a12fc168e11ef@speechsynth [1] 2024-05-20 17:54:02:631991 [DEBUG] Signal Message to [MS Synth Engine] [0x7f96b8000b60;1;0] 2024-05-20 17:54:02:632009 [DEBUG] Wait for Messages [MRCP Server] 2024-05-20 17:54:02:632053 [DEBUG] Process Message [MS Synth Engine] [0x7f96b8000b60;1;0] 2024-05-20 17:54:02:632078 [INFO] TTS service start to process speak request 2024-05-20 17:54:02:632155 [DEBUG] request type is plain text. 2024-05-20 17:54:02:632170 [DEBUG] Signal Message to [MRCP Server] [0x7f96bc000fa0;3;4] 2024-05-20 17:54:02:632186 [INFO] [MS TTS] creating synthesizer... 2024-05-20 17:54:02:632197 [DEBUG] Process Message [MRCP Server] [0x7f96bc000fa0;3;4] 2024-05-20 17:54:02:632226 [INFO] Process SPEAK Response e34a12fc168e11ef@speechsynth [1] 2024-05-20 17:54:02:632238 [NOTICE] State Transition IDLE -> SPEAKING e34a12fc168e11ef@speechsynth 2024-05-20 17:54:02:632251 [DEBUG] Signal Message to [MRCPv2-Agent-1] [0x7f96d404eca0;1;0] 2024-05-20 17:54:02:632271 [DEBUG] Wait for Messages [MRCP Server] 2024-05-20 17:54:02:632466 [DEBUG] Process Poller Wakeup [MRCPv2-Agent-1] 2024-05-20 17:54:02:632506 [DEBUG] Process Message [MRCPv2-Agent-1] [0x7f96d404eca0;1;0] 2024-05-20 17:54:02:632545 [INFO] Send MRCPv2 Data :1544 <-> :39028 [83 bytes] MRCP/2.0 83 1 200 IN-PROGRESS Channel-Identifier: e34a12fc168e11ef@speechsynth

2024-05-20 17:54:02:632670 [DEBUG] Wait for Messages [MRCPv2-Agent-1] timeout [600000]

terminate called after throwing an instance of 'std::runtime_error' what(): Runtime error: Failed to initialize platform (azure-c-shared). Error: 2176 [CALL STACK BEGIN]

/usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1dfeb5) [0x7f96db54deb5] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1f0687) [0x7f96db55e687] /lib64/libpthread.so.0(+0xfe97) [0x7f96dc60fe97] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1f1601) [0x7f96db55f601] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1a92da) [0x7f96db5172da] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1a6bce) [0x7f96db514bce] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e5d1f) [0x7f96db553d1f] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1c37fe) [0x7f96db5317fe] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1bec16) [0x7f96db52cc16] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0xd735d) [0x7f96db44535d] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e5d1f) [0x7f96db553d1f] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1a6735) [0x7f96db514735] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(+0x1fdc2d) [0x7f96db56bc2d] /usr/local/speechsdk/lib/centos7-x64/libMicrosoft.CognitiveServices.Speech.core.so(synthesizer_create_speech_synthesizer_from_config+0x105) [0x7f96db429f86] /usr/local/unimrcp/plugin/mssynth.so(SpeechSynthesizerFactory::createObject()+0x3f1) [0x7f96dba7e551] /usr/local/unimrcp/plugin/mssynth.so(SynthesizerPool::borrowSynthesizer()+0x10a) [0x7f96dba7f1ea] /usr/local/unimrcp/plugin/mssynth.so(+0x13636) [0x7f96dba79636] [CALL STACK END]


- Speech SDK log:

[464223]: 23350ms SPX_DBG_TRACE_VERBOSE: resource_manager.cpp:133 Created 'CSpxThreadService' as '303073113' [464223]: 23350ms SPX_DBG_TRACE_VERBOSE: resource_manager.cpp:133 Created 'CSpxThreadService' as '303073113' [464223]: 23350ms SPX_TRACE_WARNING: resource_manager.cpp:141 Failed to create 'CSpxCodecAdapter' as '199052375'. Are all required extension libraries loaded? [464223]: 23350ms SPX_DBG_TRACE_VERBOSE: usp_tts_engine_adapter.cpp:62 CSpxUspTtsEngineAdapter [464223]: 23350ms SPX_DBG_TRACE_VERBOSE: resource_manager.cpp:133 Created 'CSpxUspTtsEngineAdapter' as '919101823' [464223]: 23351ms SPX_TRACE_ERROR: AZ_LOG_ERROR: shim_openssl.c:55 libssl could not be loaded [464223]: 23351ms SPX_TRACE_ERROR: AZ_LOG_ERROR: tlsio_openssl.c:2175 Could not load libssl [464223]: 23351ms SPX_TRACE_ERROR: exception.cpp:130 About to throw Runtime error: Failed to initialize platform (azure-c-shared). Error: 2176 [CALL STACK BEGIN]

github-actions[bot] commented 1 month ago

This item has been open without activity for 19 days. Provide a comment on status and remove "update needed" label.

pankopon commented 1 month ago

See notes on how to configure OpenSSL for Linux especially in non-Debian/Ubuntu environments. The current latest Speech SDK 1.38.0 release has improved OpenSSL support, but it won't run on RHEL 8 unless the glibc version there can be updated. The new minimum baseline is Ubuntu 20.04 LTS or compatible with glibc 2.31 or newer.

github-actions[bot] commented 4 weeks ago

This item has been open without activity for 19 days. Provide a comment on status and remove "update needed" label.