MycroftAI / mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform.
https://mycroft.ai
Apache License 2.0
6.49k stars 1.27k forks source link

Make TTS queue a singleton #3051

Closed ken-mycroft closed 2 years ago

ken-mycroft commented 2 years ago

Description

Fixes issue where when remote tts fails and local gets executed they stomp on each other

How to test

You would need a special mimic2_tts.py that periodically throws exceptions, otherwise not easy to test

Contributor license agreement signed?

CLA [ yes ] (Whether you have signed a CLA - Contributor Licensing Agreement

forslund commented 2 years ago

One thing to note is that we might also need update the handling of the tts-cache. I think in this setup only one of the TTS's cache clearing methods will only be called...

krisgesling commented 2 years ago

I was hoping we could merge into both branches, however I've been testing this out on the standard dev channel as well and I think we must have some extra fixes to the mimic1 class in feature/mark-2. If you set your TTS module to mimic it starts playing all sentences in the queue at the same time.

krisgesling commented 2 years ago

Merging this now so we can get it onto tonights build but agree with the extra points raised so we should address those as a followup.

forslund commented 2 years ago

Ok interesting, I'll try that out and see if I can make this work for dev aswell.

ken-mycroft commented 2 years ago

I was worried about this. There might be some mimic1/2 changes i missed. Is this still an issue?

forslund commented 2 years ago

I added a couple of things in the backport to dev PR #3055, it has commit for handling the cache clearing and some minor reorganization moving responsibility to the playback-thread. It also has some further fixes where the fallback could misbehave