-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speech to Text: OggOpusEncoder hanging on close after Inactivity Timeout #50
Comments
Workaround: I use a timer in my app which calls "microphoneHelper.closeInputStream();". This seems to avoid the problem. |
The problem was originally reported here: https://developer.ibm.com/answers/questions/435993/speech-to-text-oggopusencoder-hanging-on-close-aft.html?childToView=436412#answer-436412 |
Hey @smccants, thanks for bringing this issue up. I've assigned myself to take a look at this as soon as I get some time and I'll report back with any findings. |
I think I'm running into a slightly different flavor of this problem. Any update on when it might be fixed? |
It looks like the hang is a result of this thread never exiting:
While this thread is hung, the main thread is in a spin loop waiting for it:
|
I'm working on a sample Speech-to-text Android App that will timeout after a certain amount of inactivity from the speaker. For testing purposes, I set the timeout at 1 second. However, there seems to be a race condition (which I reproduced in the example by setting the inactivity timeout to 1 second) that causes the MicrophoneHelper to hang on closing.
The hang occurs in MicrophoneCaptureThread.run() line 110 - encoder.close() call. I'm not quite sure what is hanging it up, but if you toggle the microphone and then let it timeout after one or two attempts it will fail this way. The final hang is in MicrophoneInputStream.consume(byte[]).
Here is the link to the sample application I used: https://github.com/watson-developer-cloud/android-sdk/blob/master/example/src/main/java/com/ibm/watson/developer_cloud/android/myapplication/MainActivity.java
The only change I made was to getRecognizeOptions() where I changed the timeout from 2000 to 1.
The text was updated successfully, but these errors were encountered: