Comments (3)
The issue seems to be that the processData()
function, which is running in the thread created to process responses from aws for that call, does not exit. I think to troubleshoot I suggest adding some more logging there.
Specifically, I wonder about this if condition
If that is not true -- if switch_core_session_locate(m_sessionId.c_str());
returns null, meaning the session is gone, I think we should add a log message so we can see that.
This log message:
stream got final response
Is the event that should cause the processData
function to exit, and the thread to therefore end.
So if that is happening (I'm not sure it is) then we won't hit this code below in that if condition
std::lock_guard<std::mutex> lk(m_mutex);
m_finished = true;
m_cond.notify_one();
switch_core_session_rwunlock(psession);
That setting of the condition is what "wakes up" the processData()
here:
while (true) {
std::unique_lock<std::mutex> lk(m_mutex);
m_cond.wait(lk, [&, this] {
return (!m_deqAudio.empty() && !m_finishing) || m_transcript.TranscriptHasBeenSet() || m_finished || (m_finishing && !shutdownInitiated);
});
Therefore, that thread may block there, waiting for a condition that never happens.
Just an idea, but try adding that logging to get further.
So...to summarize this theory:
- The session ends, as part of that we call
m_pStream->close()
at line 272 - This in turn causes AWS to complete transcribing and invoke
OnResponseCallback
- In
OnResponseCallback
the call toswitch_core_session_locate(m_sessionId.c_str());
fails because the session is gone - Therefore no condition is raised and
processData()
blocks forever in its while loop
Please investigate when you have time @byoungdale and let me know what you think
from drachtio-freeswitch-modules.
Yes, thank you. Just saw this. The psession
is gone, I had checked that. So, I added this else to the if (psession) {
block:
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "GStreamer %p session is closed/hungup. Need to unblock thread.\n", this);
std::lock_guard<std::mutex> lk(m_mutex);
m_finished = true;
m_cond.notify_one();
}
and it unblocks processData
's loop, I see the await ep.destroy()
finishing, and I don't see the zombie call anymore.
But, does onResponseCallback
only run when the transcription stream is finished? I'm having trouble finding AWS C++ SDK documentation that references onResponseCallback.
from drachtio-freeswitch-modules.
Ah, I see onResponseCallback
is passed to StartStreamTranscriptionAsync
.
from drachtio-freeswitch-modules.
Related Issues (20)
- Facing issue with Azure Transcribe module HOT 2
- How to play the audio to caller? HOT 1
- How to activate mod_dialogflow in fusionpbx HOT 2
- lws_glue.cpp:185 connection failed: read failed HOT 1
- Smart Formatting on Deepgram HOT 1
- add support for Azure speech segmentation
- add support for google voice activity timeout
- mod_google_transcribe: Feature Request: Support for `google::cloud::speech::v2` HOT 2
- mod_google_transcribe: Feature Request: Make the sample rate in `RecognitionConfig` configurable
- mod_google_transcribe: Bug: Calling transcribe2_function in mod_google_transcribe.c sometimes crashes HOT 2
- mod_google_transcribe: Feature Request: Allow google speech to text endpoint to be configurable
- deepgram websocket connection closed after few seconds of transcription HOT 4
- mod_audio_fork: Do we need to disconnect audio fork connection?
- Executed the last dialplan instruction after use dialogflow_start
- freeswitch restart issue HOT 3
- **/usr/local/freeswitch/mod/mod_audio_fork.so: undefined symbol: fork_session_send_text**
- mod_audio_fork: memory leak in mod audio fork
- Ability to audio_fork callee channel mono to a wss-url
- Deepgram module latency issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drachtio-freeswitch-modules.