question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to initialize platform (azure-c-shared). Error: 2153

See original GitHub issue

We probably got something wrong but we can’t start the demo synthesis program on Ubuntu 22.04

uname -a
Linux pop-os 6.0.12-76060006-generic #202212290932~1671652965~22.04~452ea9d SMP PREEMPT_DYNAMIC Wed D x86_64 x86_64 x86_64 GNU/Linux

The error is down in share libraries somewhere:

Traceback (most recent call last):
  File "/home/ric/Desktop/chatgpt_siri/speech_synthesis.py", line 11, in <module>
    speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)
  File "/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/speech.py", line 2108, in __init__
    _call_hr_fn(fn=_sdk_lib.synthesizer_create_speech_synthesizer_from_config, *[
  File "/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/interop.py", line 62, in _call_hr_fn
    _raise_if_failed(hr)
  File "/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/interop.py", line 55, in _raise_if_failed
    __try_get_error(_spx_handle(hr))
  File "/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/interop.py", line 50, in __try_get_error
    raise RuntimeError(message)
RuntimeError: Exception with error code: 
[CALL STACK BEGIN]

/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1b9787) [0x7fefe35b9787]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1dd4b1) [0x7fefe35dd4b1]
/lib/x86_64-linux-gnu/libc.so.6(+0x99f68) [0x7fefe4e99f68]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1de66e) [0x7fefe35de66e]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1a7399) [0x7fefe35a7399]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1a5877) [0x7fefe35a5877]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1c0099) [0x7fefe35c0099]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1d832a) [0x7fefe35d832a]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x17ff00) [0x7fefe357ff00]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0xe087d) [0x7fefe34e087d]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1c0099) [0x7fefe35c0099]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x177dd3) [0x7fefe3577dd3]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x1eb0b5) [0x7fefe35eb0b5]
/home/ric/.cache/pypoetry/virtualenvs/chatgpt-siri-7TtG-LRn-py3.10/lib/python3.10/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(synthesizer_create_speech_synthesizer_from_config+0xf3) [0x7fefe34c5c02]
/lib/x86_64-linux-gnu/libffi.so.8(+0x7e2e) [0x7fefe5032e2e]
/lib/x86_64-linux-gnu/libffi.so.8(+0x4493) [0x7fefe502f493]
/usr/lib/python3.10/lib-dynload/_ctypes.cpython-310-x86_64-linux-gnu.so(+0xa451) [0x7fefe4dc3451]
[CALL STACK END]

Runtime error: Failed to initialize platform (azure-c-shared). Error: 2153

And our little test code for completeness

# This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
speech_config = speechsdk.SpeechConfig(subscription=os.environ.get('SPEECH_KEY'), region=os.environ.get('SPEECH_REGION'))
audio_config = speechsdk.audio.AudioOutputConfig(use_default_speaker=True)

# The language of the voice that speaks.
speech_config.speech_synthesis_voice_name='en-US-JennyNeural'

speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)

# Get text from the console and synthesize to the default speaker.
print("Enter some text that you want to speak >")
text = input()

speech_synthesis_result = speech_synthesizer.speak_text_async(text).get()

if speech_synthesis_result.reason == speechsdk.ResultReason.SynthesizingAudioCompleted:
    print("Speech synthesized for text [{}]".format(text))
elif speech_synthesis_result.reason == speechsdk.ResultReason.Canceled:
    cancellation_details = speech_synthesis_result.cancellation_details
    print("Speech synthesis canceled: {}".format(cancellation_details.reason))
    if cancellation_details.reason == speechsdk.CancellationReason.Error:
        if cancellation_details.error_details:
            print("Error details: {}".format(cancellation_details.error_details))
            print("Did you set the speech resource key and region values?")

Thanks

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
gamevelostercommented, Feb 4, 2023

After applying your temp fix, how do we revert OpenSSL v1.1.1 back to v3 in the efuture?

Where can we view the backlog ticket # 4471701?

1reaction
ralph-msftcommented, Jan 31, 2023

Thank you for reporting this issue. Ubuntu 22.04 moved to OpenSSL version 3. The Cognitive Services Speech SDK has not been updated to support OpenSSL 3 and instead is still using OpenSSL 1.1.1.

We have labeled the issue as ‘accepted’ here and are now also tracking a fix for this in on our backlog (# 4471701). We will respond here once we have an update.

In the meantime, you may be able to temporarily work around this by manually installing the OpenSSL 1.1.1 packages. However some issues to keep in mind:

  • We have not tested if this causes conflicts with other packages or building other packages. Please proceed at your own risk
  • You will need to manually ensure that you are using the latest OpenSSL 1.1.1 version yourself to avoid any potential security issues
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Microsoft Cognitive Speech error "Failed ...
How to fix Microsoft Cognitive Speech error "Failed to initialize platform (azure-c-shared)"? ... I am using Microsoft.CognitiveServices.Speech ( ...
Read more >
Runtime error: Failed to initialize platform (azure-c-shared) ...
When I use the default Azure sample code to convert speech to text using the activated speech service, it shows that "Speech Recognition ......
Read more >
ErrorDetails=Runtime error: Failed to initialize platform ...
Speech Services Client on docker for Linux | Recognition error : ErrorDetails=Runtime error: Failed to initialize platform (azure-c-shared) #441.
Read more >
Azure speech-to-text api error while using with AWS Lambda
Error Error details: Runtime error: Failed to initialize platform (azure-c-shared)```. https://stackoverflow.com/q/70539168/5804554.
Read more >
How to fix Microsoft Cognitive Speech error "Failed to initialize ...
Coding example for the question How to fix Microsoft Cognitive Speech error "Failed to initialize platform (azure-c-shared)"?-unity3d c#.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found