ovos-buildroot icon indicating copy to clipboard operation
ovos-buildroot copied to clipboard

wake word loop weirdness

Open limitless-code opened this issue 4 years ago • 8 comments

Hardware: RPi4 2GB, 32GB sd card, HDMI out to TV for sound, PS3 eye USB for mic. Wake word: Hey Jarvis

Not sure if this is the correct place (mycroft.ai forum maybe a better place?) or not but didn't have this behaviour before on picroft.

Firstly it doesn't respond to the spoken wake word "hey jarvis", until text input is processed via mycroft-cli-client or home assistant sends a message via the notification integration for mycroft, but separate to this it also goes into a wake word loop.

I enter 'play new retro wave' in the mycroft-cli-client and it finds some good tunes and starts playing, then as below it keeps detecting the wake word even though nothing verbal is being said, just music.

2021-08-26 12:21:59.042 | DEBUG    |   403 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 24
12:21:59.042 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 24
2021-08-26 12:21:59.056 | DEBUG    |   403 | mycroft.client.speech.listener:transcribe:224 | STT: play new retro wave
2021-08-26 12:21:59.059 | INFO     |   403 | mycroft.client.speech.__main__:handle_utterance:76 | Utterance: ['play new retro wave']
2021-08-26 12:22:01.910 | INFO     |   403 | mycroft.client.speech.__main__:handle_wakeword:71 | Wakeword Detected: hey jarvis
2021-08-26 12:22:01.914 | DEBUG    |   403 | mycroft.client.speech.mic:listen:725 | Recording...
2021-08-26 12:22:02.422 | INFO     |   403 | mycroft.client.speech.__main__:handle_record_begin:41 | Begin Recording...
2021-08-26 12:22:06.397 | INFO     |   403 | mycroft.client.speech.__main__:handle_record_end:49 | End Recording...
2021-08-26 12:22:06.523 | DEBUG    |   403 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
12:22:06.523 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
2021-08-26 12:22:07.336 | DEBUG    |   403 | mycroft.client.speech.mic:listen:712 | Waiting for wake word...
2021-08-26 12:22:07.351 | DEBUG    |   403 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
12:22:07.351 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
2021-08-26 12:22:07.417 | DEBUG    |   403 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
12:22:07.417 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
2021-08-26 12:22:08.365 | DEBUG    |   403 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
12:22:08.365 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
2021-08-26 12:22:08.626 | ERROR    |   403 | mycroft.client.speech.listener:transcribe:239 | 0
2021-08-26 12:22:08.897 | ERROR    |   403 | mycroft.client.speech.listener:transcribe:240 | Speech Recognition could not understand audio
2021-08-26 12:22:23.825 | INFO     |   403 | mycroft.client.speech.__main__:handle_wakeword:71 | Wakeword Detected: hey jarvis
2021-08-26 12:22:23.833 | DEBUG    |   403 | mycroft.client.speech.mic:listen:725 | Recording...
2021-08-26 12:22:24.388 | INFO     |   403 | mycroft.client.speech.__main__:handle_record_begin:41 | Begin Recording...
2021-08-26 12:22:25.863 | INFO     |   403 | mycroft.client.speech.__main__:handle_record_end:49 | End Recording...
2021-08-26 12:22:25.951 | DEBUG    |   403 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
12:22:25.951 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
2021-08-26 12:22:26.802 | DEBUG    |   403 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
12:22:26.802 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
2021-08-26 12:22:26.818 | DEBUG    |   403 | mycroft.client.speech.mic:listen:712 | Waiting for wake word...
2021-08-26 12:22:26.910 | DEBUG    |   403 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
12:22:26.910 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
2021-08-26 12:22:27.824 | DEBUG    |   403 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
12:22:27.824 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
2021-08-26 12:22:27.842 | ERROR    |   403 | mycroft.client.speech.listener:transcribe:239 | 0
2021-08-26 12:22:27.844 | ERROR    |   403 | mycroft.client.speech.listener:transcribe:240 | Speech Recognition could not understand audio
2021-08-26 12:22:29.494 | INFO     |   403 | mycroft.client.speech.__main__:handle_wakeword:71 | Wakeword Detected: hey jarvis
2021-08-26 12:22:29.530 | DEBUG    |   403 | mycroft.client.speech.mic:listen:725 | Recording...
2021-08-26 12:22:30.063 | INFO     |   403 | mycroft.client.speech.__main__:handle_record_begin:41 | Begin Recording...
2021-08-26 12:22:40.118 | INFO     |   403 | mycroft.client.speech.__main__:handle_record_end:49 | End Recording...
2021-08-26 12:22:40.436 | DEBUG    |   403 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
12:22:40.436 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
2021-08-26 12:22:41.014 | DEBUG    |   403 | mycroft.client.speech.mic:listen:712 | Waiting for wake word...
2021-08-26 12:22:41.859 | DEBUG    |   403 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
12:22:41.859 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
2021-08-26 12:22:42.733 | INFO     |   403 | mycroft.client.speech.__main__:handle_wakeword:71 | Wakeword Detected: hey jarvis
2021-08-26 12:22:42.754 | DEBUG    |   403 | mycroft.client.speech.mic:listen:725 | Recording...
2021-08-26 12:22:42.906 | DEBUG    |   403 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
12:22:42.906 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
2021-08-26 12:22:43.357 | INFO     |   403 | mycroft.client.speech.__main__:handle_record_begin:41 | Begin Recording...
2021-08-26 12:22:44.266 | DEBUG    |   403 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
12:22:44.266 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 3
2021-08-26 12:22:44.295 | ERROR    |   403 | mycroft.client.speech.listener:transcribe:239 | 0

I'd say the mic is overly sensitive perhaps, but it doesn't respond to when I say 'hey jarvis', it only "detects the wake word" when there is continuous loud sound playing from it's self. It will also detect the wake word when there is silence.

limitless-code avatar Aug 26 '21 12:08 limitless-code

In voice.log it shows below. Could not found find model for hey jarvis on precise. and load pocketsphinx instead which is not as accurate? i shall change the wake word to 'hey mycroft' and test again but I was having similar issues with that wake word too.

2021-08-26 12:04:49.800 | DEBUG    |   403 | mycroft.client.speech.mic:listen:712 | Waiting for wake word...
2021-08-26 12:05:05.533 | INFO     |   403 | mycroft.client.speech.hotword_factory:on_complete:319 | Precise download complete!
2021-08-26 12:05:07.145 | WARNING  |   403 | mycroft.client.speech.listener:run:88 | Audio contains no data.
2021-08-26 12:05:07.437 | DEBUG    |   403 | mycroft.client.speech.listener:_load_config:304 | Using microphone (None = default): None
2021-08-26 12:05:07.441 | INFO     |   403 | mycroft.client.speech.listener:create_wake_word_recognizer:328 | Creating wake word engine
2021-08-26 12:05:07.445 | WARNING  |   403 | mycroft.client.speech.listener:create_wake_word_recognizer:341 | Wakeword doesn't have an entry falling backto old listener config
2021-08-26 12:05:07.448 | INFO     |   403 | mycroft.client.speech.hotword_factory:load_module:477 | Loading "hey jarvis" wake word via precise
2021-08-26 12:05:07.455 | DEBUG    |   403 | urllib3.connectionpool | Starting new HTTPS connection (1): github.com:443
12:05:07.455 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): github.com:443
2021-08-26 12:05:07.556 | DEBUG    |   403 | mycroft.util.monotonic_event:wait_timeout:53 | Will wait for 9.899807870000018 sec for Event
2021-08-26 12:05:07.639 | DEBUG    |   403 | urllib3.connectionpool | https://github.com:443 "GET /MycroftAI/precise-data/raw/dist/aarch64/latest HTTP/1.1" 302 142
12:05:07.639 - urllib3.connectionpool - DEBUG - https://github.com:443 "GET /MycroftAI/precise-data/raw/dist/aarch64/latest HTTP/1.1" 302 142
2021-08-26 12:05:07.651 | DEBUG    |   403 | urllib3.connectionpool | Starting new HTTPS connection (1): raw.githubusercontent.com:443
12:05:07.651 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): raw.githubusercontent.com:443
2021-08-26 12:05:07.766 | DEBUG    |   403 | urllib3.connectionpool | https://raw.githubusercontent.com:443 "GET /MycroftAI/precise-data/dist/aarch64/latest HTTP/1.1" 200 111
12:05:07.766 - urllib3.connectionpool - DEBUG - https://raw.githubusercontent.com:443 "GET /MycroftAI/precise-data/dist/aarch64/latest HTTP/1.1" 200 111
2021-08-26 12:05:08.848 | WARNING  |   403 | mycroft.client.speech.hotword_factory:initialize:496 | Could not found find model for hey jarvis on precise.
2021-08-26 12:05:08.854 | INFO     |   403 | mycroft.client.speech.hotword_factory:load_module:477 | Loading "hey jarvis" wake word via pocketsphinx
2021-08-26 12:05:08.962 | DEBUG    |   403 | mycroft.util.monotonic_event:wait_timeout:53 | Will wait for 9.89981207400001 sec for Event
2021-08-26 12:05:08.966 | INFO     |   403 | mycroft.client.speech.listener:create_wakeup_recognizer:365 | creating stand up word engine
2021-08-26 12:05:08.971 | INFO     |   403 | mycroft.client.speech.hotword_factory:load_module:477 | Loading "wake up" wake word via pocketsphinx
2021-08-26 12:05:09.076 | DEBUG    |   403 | mycroft.util.monotonic_event:wait_timeout:53 | Will wait for 9.899819036999986 sec for Event
2021-08-26 12:05:09.142 | WARNING  |   403 | mycroft.util.plugins:load_plugin:52 | Could not find the plugin mycroft.plugin.stt.chromium_stt_plug
2021-08-26 12:05:09.144 | INFO     |   403 | mycroft.stt:create:645 | Loaded the STT plugin chromium_stt_plug
2021-08-26 12:05:09.147 | ERROR    |   403 | mycroft.stt:create:650 | The selected STT backend could not be loaded, falling back to default...
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/mycroft/client/speech/hotword_factory.py", line 490, in initialize
    instance = clazz(hotword, config, lang=lang)
  File "/usr/lib/python3.8/site-packages/mycroft/client/speech/hotword_factory.py", line 211, in __init__
    precise_exe = self.update_precise(precise_config)
  File "/usr/lib/python3.8/site-packages/mycroft/client/speech/hotword_factory.py", line 242, in update_precise
    precise_exe = self.install_exe(precise_config['dist_url'])
  File "/usr/lib/python3.8/site-packages/mycroft/client/speech/hotword_factory.py", line 274, in install_exe
    raise TriggerReload
mycroft.client.speech.hotword_factory.TriggerReload

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/mycroft/stt/__init__.py", line 646, in create
    return clazz()
TypeError: 'NoneType' object is not callable

limitless-code avatar Aug 26 '21 13:08 limitless-code

Indeed, inappropriate PocketSphinx activations are no surprise. Sometimes I drive with PocketSphinx running on my phone, and it goes off when I hit a bump!

I think that's probably a config problem, but I don't mess with Precise. @JarbasAl?

ChanceNCounter avatar Aug 26 '21 15:08 ChanceNCounter

can you share your config? my guess is that its using the old plugins pre migration to OVOS, the fallback to pocketsphinx is hardcoded from mycroft-core, and only works for "hey mycroft" since the phonemes etc are undefined for other words (our plugin should accout for this, but core wont use the plugin in fallback)

slightly more concerning and weird is the logs saying STT failed to load before the wake word failures, it def looks like a bad config (prolly my fault with bad docs)

@limitless-code can you share your .conf ?

JarbasAl avatar Aug 26 '21 16:08 JarbasAl

Attached, have also supplied logs. I have redacted some sensitive bits in the logs. mycroft-conf-logs.zip

I did try to swap Hey Jarvis to Hey Mycroft but my sd card got corrupted after 'sudo reboot' Tried a different sd card but the exact same thing happens after 'sudo reboot'

It tries to start then RPI4 green led flashes 4 times and fails to boot. I don't think both sd cards could have a problem, seems too consistent?

limitless-code avatar Aug 26 '21 18:08 limitless-code

does it work if you replace "jarbas_precise_ww_plug" with "ovos-ww-plugin-precise" ?

i dont see stt changed anywhere, did you previously select the local backend (it messes with user config)?

JarbasAl avatar Aug 26 '21 18:08 JarbasAl

@JarbasAl

I tried the replace suggestion but doesn't improve things. I clicked on mycroft backend and paired via setup screen (with hey jarvis wake word) on first boot after setting up Wifi, nothing else was touched. Still does not respond to "Hey Jarvis" but also now does not do TTS. I did have to do 'sudo systemctl stop mycroft' and 'sudo systemctl start mycroft', not sure if this is the correct way, as cannot reboot the pi without it corrupting the sd card currently.

Same looping wake word detection happening.

It still plays the video and audio of the video though after typing in cli "play new retrowave"

latest logs and configs attached mycroft.zip

limitless-code avatar Aug 26 '21 19:08 limitless-code

mycroft.zip

@JarbasAl

Attached are logs and configs from another fresh install with the Mycroft Backend but paired with 'Hey Mycroft' instead of 'Hey Jarvis' for comparison. Hey Mycroft behaves much better. When music/ video is playing wake word detection happens every few minutes compared to Hey Jarvis which was every few seconds. It still doesn't respond to spoken "hey Mycroft" as it did on picroft but I suspect that's the Mic settings.

re: rpi4 bricking itself after 'sudo reboot' that seems to be OK now after pressing the SD card holder on the RPI4 in more so the all the PINs are in contact with the SD card.

limitless-code avatar Aug 27 '21 09:08 limitless-code

A quick note/ query re: video playback. When playing a video with music with a still image everything works as it should. If it plays a full moving video, the audio and video stutters. It is running via a HDMI port on a big screen. Not sure if VLC (I presume it's using VLC) has hardware acceleration enabled or not. I know in the past the 64 bit kernel (in general and not specific to OVOS) did not have this feature configured/ implemented for VLC. I see the kernel for OVOS is aarch64.

limitless-code avatar Aug 27 '21 10:08 limitless-code

Should be fixed by now

j1nx avatar Dec 29 '23 08:12 j1nx