-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
[TTS] ~3 minute delay when sending text to Google cast / home #46631
Comments
cast documentation |
A workaround is to manually invoke the service
That has no delay and doesn't store mp3 files within HASS. |
Hey there @emontnemery, mind taking a look at this issue as its been labeled with an integration ( |
I've observed that the audios in
Looks like a TTS bug, could a moderator add the label |
The problem in home-assistant-libs/pychromecast#356 is that the default media player built into chromecasts does not handle live streams well. That problem is very unlikely to have anything to do with the issue here. If the tts media needs a lot of time to be generated, that's most likely the root cause. |
Thanks @emontnemery! Sorry for the initial mislabeling. I realized this while writing the report, as it happens 😅 Going down the rabbit hole, here are some more findings. I've ran this snippet: from gtts import gTTS
tts = gTTS(text='Esto es una prueba', lang='es')
tts.save('prueba.mp3') And on my personal machine, this is instantaneous. This issue replicates exactly when running HassOS on a Raspi 4 and also when running HassOS on a VM (Core i5 with spare resources). They are connected through WiFi - but so is my personal machine that doesn't have a delay when running the python command. Dependencies do differ a bit. Personal machine: Unfortunately I can't find any useful or "replicatable" text in the logs (neither at the python execution, the supervisor log, core log, nor the internal journalctl log). |
Opened a query at gTTS in case they can provide more insight: pndurette/gTTS#281 |
Side note! This won't work anymore, Google Translate has pretty much removed this endpoint (it might work if you're lucky but it's very unreliable). |
As a workaround, you can entirely drop the default engine (Google Translate) and choose PicoTTS:
For stability and privacy, it is not a good idea to provide Google Translate as the default TTS engine. Leaving this issue open until resolved (or until Google finally drops this undocumented API, haha). |
Today I tested Google Translate TTS again, and it works as expected.
The delays must have been fixed with some update in HASS or the networking libraries - remember that the issue used to replicate exactly on a dedicated, wired Raspberry setup. I'm still puzzled that the delay only appeared within Docker. However, this could have also been due to the slightly different package versions. Thank everyone for helping troubleshoot this issue! :) |
The problem
There's a very large delay (varying ~3 minutes) when sending a TTS command to a chromecast device with the default method. See screen capture below.
I've verified this with [Chromecast 2,3, 4K and Google Home Mini] and with HASS installed in [Raspberry 4 and HassOS virtualbox VM].
I started using HASS in March 2020 and have always observed this. Please let me know what information you need
What is version of Home Assistant Core has the issue?
core-2021.2.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Google Cast (more likely: tts)
Link to integration documentation on our website
https://www.home-assistant.io/integrations/cast/
Example YAML snippet
Anything in the logs that might be useful for us?
# Put your logs below this line 2021-02-16 15:29:28 ERROR (Thread-8) [homeassistant.components.cast.media_player] Failed to cast media https://www.home-assistant.io/images/cast/splash.png. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address
Related issues & discussions:
The text was updated successfully, but these errors were encountered: