-
Notifications
You must be signed in to change notification settings - Fork 55
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
Playback issue #271
Comments
Yep. I get the same issue. Mine is when playing a BBC radio stream, described below. This issue happens when I play a BBC radio stream from Music Assistant to Voice PE. If I play the same stream to a Google speaker, the problem doesn't happen. If I play the same URL from RadioBrowser within Home Assistant, the stream will play on the Voice PE H/W. It seems that this problem is a combination of using PE hardware, with MA radio stations, and the BBC streams. The BBC stream is created in MA using the add custom station option: When the stream is played, this is the error on the PE hardware:
|
I also get "HTTP_CLIENT: Connection timed out before data was ready!" when trying to announce a long response with Google Cloud TTS. It seems there is a hard-coded 5-second timeout somewhere in HAVPE and it fails if the TTS takes longer than that to return a response:
I looked in the HASS debug, and if I take the output text and run it through the same TTS via home assistant, then it works perfectly fine (but it takes longer than 5 seconds). So it seems there is some kind of a timeout in the HAVPE config, but I had no luck finding where it might be looking at the code :( I've tried changing the default timeout in |
I've investigated it more and traced the timeout to this line: I've increased it and now HAVPE properly waits for TTS to finish processing long responses. Would be really nice to have this as a configurable option someday! |
Sorry for the triple-posting, I'll shut up after this one :) I wonder what was the reason behind the 5s timeout - was it a random value or was there any specific reason to land on such a low value? The problem here (besides not being able to generate longer responses) is that HASS TTS integrations have different timeouts - for example, it's 10s for Google Cloud TTS. Let's say you use it and it takes 6 seconds to generate the audio:
So you end up with the same component (your TTS engine) behaving differently with the same input depending on if HAVPE is in the mix or not. To make things even worse, this problem will occur seemingly at random, as shorter responses will play fine. This is not a great user experience, since it creates a (wrong) impression that HAVPE is unstable. It's also hard to debug because of this implicit timeout, so it's difficult to understand what's going on, especially given the error which is too cryptic/generic for an average user.. Here is a good example of a person likely hitting the same issue and being confused about the reasons: https://community.home-assistant.io/t/http-timeout-for-voice-assistant-pe-even-though-the-response-is-recieved/834200. At the very least, I would propose increasing the timeout. But I think the best solution is making it a configurable parameter: power users could tweak it to fit their use cases, and it will also make it explicit, reducing the number of confused users thinking there is something wrong with their HAVPEs. Perhaps better error handling with a more actionable error could be a nice cherry on top (something like "Your TTS request timed out after X seconds! If this happens on longer responses, try increasing the timeout in the configuration!"). |
I lied - I won't shut up, I guess :) Here is an alternative workaround for streaming LLMs responses directly into TTS: https://github.com/eslavnov/llm-stream-tts. |
I'm experiencing a playback issue with my Voice PE. I have tested both firmware version 24.10.15 and the latest manually installed version (Firmware: 25.1.0 (ESPHome 2024.12.2)) from the official site .
The problem arises during audio playback. The playback stops after about 30-40 seconds with a brief hiccup, displaying the error message "The media pipeline's file reader encountered an error." in the ESP console. I have tested multiple sources, including Music Assistant, external MP3 files, and TTS, and all function correctly with other media players on my network. However, with TTS, long responses do not play at all, while shorter ones work perfectly. The Voice PE responds quickly on my end.
Here are two examples of playback failures:
Music Assistant & External MP3 File : Stops after a few seconds.
TTS (Text-to-Speech) : Long TTS responses do not play fully or at all.
For reference regarding connection quality, I have observed good Wi-Fi performance (-49 dB) and minimal ping issues:
Thank you for your assistance!
Originally posted by @haginator in #255 (comment)
The text was updated successfully, but these errors were encountered: