-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix deadlock on process termination #30
base: master
Are you sure you want to change the base?
Conversation
I've just been running through the original tutorial again (with this patch in place), and it crashes with error on the step:
Sadly, reverting the patch fixes this crash. So more work is needed somewhere. |
I've been doing some more testing with and without the patch. I will raise a new issue with more information later on (I have also reduced my config file to bare minimums). |
Please share the debug logs (add |
At the moment I'm always running with debug on. Just wondering if the debug flag is passed on to the subprograms because there is little output. |
Yes, there is little debug output in general, but at least may give some more information on where and what is crushing |
Feel free to add your own debug info |
Still have problems.... Docker starts, mic and wakeword detection working, after wakeword recognition, I see this log:
=> After that, nothing is happening any more, stuck |
@pipsen If you restart your faster-whisper server, does it help? Any logs from the faster-whisper server? |
Fixes#26Fixes #27
Fixes #29
Fixes #31
Fixes #55
From the asyncio.subprocess.wait specification:
This is exactly what we are doing.
stdout=PIPE
mic
program: read from the process until ASR is doneIf between 2 and 3 the process outputs more data (as mic continues to record the sound), it creates a deadlock: we wait for the process to finish and the process waits for us to read the data he had already sent us.
This PR fixes that race condition as recommended in the documentation, by using
communicate()
, which will read all the data and then wait for the process to terminate.