-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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 handling of hangup timeout during STT processing #134182
base: dev
Are you sure you want to change the base?
Conversation
Hey there @balloob, @synesthesiam, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @balloob, @synesthesiam, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
As far as I can see, this PR only adds some debug logging and shuffles some code around. Can you point out the change that fixes it? |
while True: | ||
async with asyncio.timeout(self._audio_chunk_timeout): | ||
chunk = await self._audio_queue.get() | ||
if not chunk: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, the change is to not put this inside the timeout with
block. But how does that fix it? It means the chunk is set to the previous value, which is true, otherwise it would have broken.
It means that we will also yield the same audio chunk twice, which is not something we would want.
I updated to include only the essential changes. The wyoming STT code needed to be updated to catch the TimeoutError as well as the moving the none check and yield out of the wait/timeout block. Chunk shouldn't be yielded with the same value twice because either it is successfully updated with the new value, it is set to None which would result in breaking the loop, or it times out and throws the TimeoutError which is caught in the wyoming STT. Based on my testing I was not able to get a successful call without both of those changes. |
Breaking change
Proposed change
Fix the handling of hangup timeouts during STT processing in the VOIP integration.
Type of change
Additional information
This PR is related to: #128372
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: