Wakeup word stops working after some time

Hey folks,

I’ve played around with rhasspy for quite some time and I was following the 2.5 development closely. I tried almost every build of it. It’s a very cool piece of work! Thank you so much for sharing this with us! Unfortunately, I always seem to run in a bug, where the wakeup word mechanism stops working after some time. Restarting rhasspy immediatly fixes the issue.

Here’s my current setup:

  • Raspberry Pi 4
  • Rhasspy running as a docker image
  • PSeye mic
  • German profile
  • porcupine with wakeword terminator

If you look at the logs, I don’t see anything problematic at first sight. It just stops working after some time and recovers after restart:

[DEBUG:2020-06-09 04:04:59,762] rhasspyserver_hermes: <- NluIntentNotRecognized(    input='', site_id='default', id=None, custom_data=None,     session_id='default-terminator-61aa6f1b-2a74-42e1-b5ea-4228e4020fa3')
[DEBUG:2020-06-09 04:04:56,603] rhasspyserver_hermes: <- HotwordDetected(model_id='/usr/    lib/rhasspy/lib/python3.7/site-packages/rhasspywake_porcupine_hermes/porcupine/resources    /keyword_files/raspberrypi/terminator.ppn', model_version='', model_type='personal',     current_sensitivity=0.5, site_id='default', session_id=None, send_audio_captured=None,     lang=None)
[DEBUG:2020-06-09 04:04:52,767] rhasspyprofile.download:     speech_to_text.deepspeech.mix_weight >0 0 = False
[DEBUG:2020-06-09 04:04:52,767] rhasspyprofile.download:     speech_to_text.kaldi.mix_weight >0 0 = False
[DEBUG:2020-06-09 04:04:52,766] rhasspyprofile.download:     speech_to_text.pocketsphinx.mix_weight >0 0 = False
[DEBUG:2020-06-09 04:04:52,766] rhasspyprofile.download:     speech_to_text.deepspeech.open_transcription True False = False
[DEBUG:2020-06-09 04:04:52,766] rhasspyprofile.download:     speech_to_text.kaldi.open_transcription True False = False
[DEBUG:2020-06-09 04:04:52,765] rhasspyprofile.download:     speech_to_text.pocketsphinx.open_transcription True False = False
[DEBUG:2020-06-09 04:04:52,765] rhasspyprofile.download: speech_to_text.system     deepspeech kaldi = False
[DEBUG:2020-06-09 04:04:52,765] rhasspyprofile.download: Skipping kaldi/model/    ivectors_test_hires/conf/splice.conf (/profiles/de/kaldi/model/ivectors_test_hires/conf/    splice.conf)
[DEBUG:2020-06-09 04:04:52,764] rhasspyprofile.download: Skipping kaldi/model/    ivectors_test_hires/conf/ivector_extractor.conf (/profiles/de/kaldi/model/    ivectors_test_hires/conf/ivector_extractor.conf)
[DEBUG:2020-06-09 04:04:52,764] rhasspyprofile.download: Skipping kaldi/model/    ivectors_test_hires/conf/online_cmvn.conf (/profiles/de/kaldi/model/ivectors_test_hires/    conf/online_cmvn.conf)
[DEBUG:2020-06-09 04:04:52,763] rhasspyprofile.download: Skipping kaldi/model/extractor/    final.ie (/profiles/de/kaldi/model/extractor/final.ie)
[DEBUG:2020-06-09 04:04:52,763] rhasspyprofile.download: Skipping kaldi/model/extractor/    final.dubm (/profiles/de/kaldi/model/extractor/final.dubm)
[DEBUG:2020-06-09 04:04:52,763] rhasspyprofile.download: Skipping kaldi/model/extractor/    splice_opts (/profiles/de/kaldi/model/extractor/splice_opts)
[DEBUG:2020-06-09 04:04:52,762] rhasspyprofile.download: Skipping kaldi/model/extractor/    global_cmvn.stats (/profiles/de/kaldi/model/extractor/global_cmvn.stats)
[DEBUG:2020-06-09 04:04:52,762] rhasspyprofile.download: Skipping kaldi/model/extractor/    online_cmvn.conf (/profiles/de/kaldi/model/extractor/online_cmvn.conf)
[DEBUG:2020-06-09 04:04:52,762] rhasspyprofile.download: Skipping kaldi/model/extractor/    final.mat (/profiles/de/kaldi/model/extractor/final.mat)
[DEBUG:2020-06-09 04:04:52,761] rhasspyprofile.download: Skipping kaldi/model/conf/    mfcc_hires.conf (/profiles/de/kaldi/model/conf/mfcc_hires.conf)
[DEBUG:2020-06-09 04:04:52,761] rhasspyprofile.download: Skipping kaldi/model/conf/    mfcc.conf (/profiles/de/kaldi/model/conf/mfcc.conf)
[DEBUG:2020-06-09 04:04:52,760] rhasspyprofile.download: Skipping kaldi/model/conf/    online_cmvn.conf (/profiles/de/kaldi/model/conf/online_cmvn.conf)
[DEBUG:2020-06-09 04:04:52,760] rhasspyprofile.download: Skipping kaldi/model/phones/    silence_phones.txt (/profiles/de/kaldi/model/phones/silence_phones.txt)
[DEBUG:2020-06-09 04:04:52,760] rhasspyprofile.download: Skipping kaldi/model/phones/    optional_silence.txt (/profiles/de/kaldi/model/phones/optional_silence.txt)
[DEBUG:2020-06-09 04:04:52,759] rhasspyprofile.download: Skipping kaldi/model/phones/    extra_questions.txt (/profiles/de/kaldi/model/phones/extra_questions.txt)
[DEBUG:2020-06-09 04:04:52,759] rhasspyprofile.download: Skipping kaldi/model/phones/    nonsilence_phones.txt (/profiles/de/kaldi/model/phones/nonsilence_phones.txt)
[DEBUG:2020-06-09 04:04:52,759] rhasspyprofile.download: Skipping kaldi/model/model/    tree (/profiles/de/kaldi/model/model/tree)
[DEBUG:2020-06-09 04:04:52,758] rhasspyprofile.download: Skipping kaldi/model/model/    final.mdl (/profiles/de/kaldi/model/model/final.mdl)
[DEBUG:2020-06-09 04:04:52,758] rhasspyprofile.download: Skipping kaldi/model/model/    cmvn_opts (/profiles/de/kaldi/model/model/cmvn_opts)
[DEBUG:2020-06-09 04:04:52,757] rhasspyprofile.download: Skipping kaldi/g2p.fst     (/profiles/de/kaldi/g2p.fst)
[DEBUG:2020-06-09 04:04:52,757] rhasspyprofile.download: Skipping kaldi/    base_dictionary.txt (/profiles/de/kaldi/base_dictionary.txt)
[DEBUG:2020-06-09 04:04:52,756] rhasspyprofile.download: speech_to_text.system kaldi     kaldi = True
[DEBUG:2020-06-09 04:04:52,756] rhasspyprofile.download: speech_to_text.system     pocketsphinx kaldi = False
[INFO:2020-06-09 04:04:52,657] rhasspyserver_hermes: Started
[DEBUG:2020-06-09 04:04:52,656] rhasspyserver_hermes: Subscribed to hermes/intent/#
[DEBUG:2020-06-09 04:04:52,655] rhasspyserver_hermes: Subscribed to hermes/    hotword/+/detected
[DEBUG:2020-06-09 04:04:52,654] rhasspyserver_hermes: Subscribed to rhasspy/asr/default/    default/audioCaptured
[DEBUG:2020-06-09 04:04:52,654] rhasspyserver_hermes: Subscribed to hermes/asr/    textCaptured
[DEBUG:2020-06-09 04:04:52,653] rhasspyserver_hermes: Subscribed to hermes/nlu/    intentNotRecognized
[DEBUG:2020-06-09 04:04:52,652] rhasspyserver_hermes: Subscribed to hermes/audioServer/    default/audioSummary
[DEBUG:2020-06-09 04:04:52,651] rhasspyserver_hermes: Subscribed to hermes/audioServer/    default/audioSummary
[DEBUG:2020-06-09 04:04:52,650] rhasspyserver_hermes: Subscribed to rhasspy/asr/default/    default/audioCaptured
[DEBUG:2020-06-09 04:04:52,649] rhasspyserver_hermes: Subscribed to hermes/nlu/    intentNotRecognized
[DEBUG:2020-06-09 04:04:52,648] rhasspyserver_hermes: Subscribed to hermes/intent/#
[DEBUG:2020-06-09 04:04:52,648] rhasspyserver_hermes: Subscribed to hermes/asr/    textCaptured
[DEBUG:2020-06-09 04:04:52,647] rhasspyserver_hermes: Subscribed to hermes/    hotword/+/detected
[DEBUG:2020-06-09 04:04:52,645] rhasspyserver_hermes: Connected to MQTT broker
[DEBUG:2020-06-09 04:04:52,642] rhasspyserver_hermes: Connecting to 192.168.188.31:1883     (retries: 0/10)
[DEBUG:2020-06-09 04:04:52,642] rhasspyserver_hermes: Starting core
[DEBUG:2020-06-09 04:04:52,637] rhasspyprofile.profile: Loading default profile     settings from /usr/lib/rhasspy/lib/python3.7/site-packages/rhasspyprofile/profiles/    defaults.json
[DEBUG:2020-06-09 04:04:52,635] rhasspyprofile.profile: Loading /profiles/de/    profile.json
[DEBUG:2020-06-09 04:04:52,632] rhasspyprofile.profile: Loading /usr/lib/rhasspy/lib/    python3.7/site-packages/rhasspyprofile/profiles/de/profile.json
[DEBUG:2020-06-09 04:04:52,584] rhasspyserver_hermes: Restarting Rhasspy
[DEBUG:2020-06-08 05:50:26,182] rhasspyserver_hermes: <- HotwordDetected(model_id='/usr/    lib/rhasspy/lib/python3.7/site-packages/rhasspywake_porcupine_hermes/porcupine/resources    /keyword_files/raspberrypi/terminator.ppn', model_version='', model_type='personal',     current_sensitivity=0.5, site_id='default', session_id=None, send_audio_captured=None,     lang=None)
[DEBUG:2020-06-08 05:50:20,707] rhasspyserver_hermes: <- NluIntentNotRecognized(    input='timer für', site_id='default', id=None, custom_data=None,     session_id='default-terminator-41c754cd-ac54-48cd-b3cd-0a019c78588e')
[DEBUG:2020-06-08 05:49:59,239] rhasspyserver_hermes: <- HotwordDetected(model_id='/usr/    lib/rhasspy/lib/python3.7/site-packages/rhasspywake_porcupine_hermes/porcupine/resources    /keyword_files/raspberrypi/terminator.ppn', model_version='', model_type='personal',     current_sensitivity=0.5, site_id='default', session_id=None, send_audio_captured=None,     lang=None)

Do you have any idea?

I used to have the same issue on a Pi zero with Snowboy and personnal hotword. That turned me crasy.

Since I updated to the new 2.5 release I haven’t observed this issue. But I’m not sure that this is what fixed the issue…

I behaved the same on 2.5.0 pre

Raspberry Pi 4
Rhasspy running as a docker image
ReSpeaker 4 Mic Aray
German profile
porcupine with wakeword terminator

I just installed the Debian version of rhasspy which gives me way more logs (I didn’t know where to look in the docker image). And it seems like the issue is caused by pyAudio and the PSeye hardware:

[ERROR:2020-06-11 17:30:32,980] rhasspymicrophone_pyaudio_hermes: record
Traceback (most recent call last):
  File "rhasspy-microphone-pyaudio-hermes/rhasspymicrophone_pyaudio_hermes/__init__.py", line 121, in record
  File "pyaudio.py", line 608, in read
OSError: [Errno -9981] Input overflowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "rhasspy-microphone-pyaudio-hermes/rhasspymicrophone_pyaudio_hermes/__init__.py", line 128, in record
  File "pyaudio.py", line 524, in stop_stream
OSError: Stream not open
[DEBUG:2020-06-11 17:30:32,985] rhasspymicrophone_pyaudio_hermes: -> AudioRecordError(error='Stream not open', site_id='default', context='Device index: None', session_id=None)
[DEBUG:2020-06-11 17:30:32,985] rhasspymicrophone_pyaudio_hermes: Publishing 101 bytes(s) to hermes/error/audioServer/record

Switiching to arcord seems to be the solution for this problem also in my case.
This post can be closed as a duplicate of Pyaudio random failures with 2.5.0-pre.