Warming up rhasspy

HI all!
Does anyone have issues after a long time of inactivity?
There are no errors in the log it just works really slow…
For example in the morning when I say “Snowboy” I have to wait ~20-30 sec before I hear beep_hi. After that it works as usual with no delays.
I do not do anything to start rhasspy working - just wait

Is it possible to warm up rhasspy somehow? I still can’t fix this issue by myself :grimacing:

Some investigations: I think the issue is in aplay command. Because I see “hotword is detected” immediately, but with no sound
Also when I press Play Recording button in the interface I have some delays for the first time

I don’t think this is coming from Rhasspy directly but just to be sure…

  • What kind of device do you use to run Rhasspy?
  • Do you use an external MQTT broker?
  • Do you use WIFI or Ethernet cable?

Hi @fastjack

  • I’m using rpi 3b+
  • It was external MQTT, but I’ve swithed a week ago to the internal - no success =(
  • It’s ethernet

One more investigation… When I press [play recording] after the delay, I hear beep_hi wav recorded. This means rhasspy started recording before aplay command is finished
Normally it doesn’t happen

I was thinking that the MQTT connection might get closed after a long period of inactivity but with the internal broker and/or an Ethernet connection that should not be the case.

Can you provide the logs when this « delay » happens. That would help pinpoint where this delay occurs… Maybe also your Rhasspy config…

There is nothing strange in the logs:

[DEBUG:2020-10-08 06:13:17,433] rhasspyserver_hermes: Sent 276 char(s) to websocket
[DEBUG:2020-10-08 06:13:14,462] rhasspyserver_hermes: <- NluIntentNotRecognized(input='', site_id='default', id=None, custom_data=None, session_id='default-snowboy-2e0cd4c4-1cbc-49be-ab50-13695dde800e')
[DEBUG:2020-10-08 06:12:52,320] rhasspyserver_hermes: <- HotwordDetected(model_id='snowboy', model_version='', model_type='personal', current_sensitivity=0.5, site_id='default', session_id=None, send_audio_captured=None, lang=None)

06:12:52,320 is the time when I said my hotword… But it was without beep_hi sound
I heard it later and rhasspy recorded it as a command and tried to parse.

Below is my config:

{
    "command": {
        "webrtcvad": {
            "silence_sec": 0.3,
            "vad_mode": 3
        }
    },
    "dialogue": {
        "system": "rhasspy"
    },
    "handle": {
        "system": "hass"
    },
    "home_assistant": {
        "access_token": "XXXXXXXXXXXXXXXXXXXXX",
        "handle_type": "event",
        "url": "http://1.1.1.1:8123/"
    },
    "intent": {
        "fsticuffs": {
            "fuzzy": false
        },
        "fuzzywuzzy": {
            "min_confidence": "0.7"
        },
        "system": "fsticuffs"
    },
    "microphone": {
        "system": "arecord"
    },
    "mqtt": {
        "enabled": "",
        "host": "1.1.1.1"
    },
    "sounds": {
        "aplay": {
            "device": "hw:CARD=Headphones,DEV=0"
        },
        "system": "aplay"
    },
    "speech_to_text": {
        "system": "kaldi"
    },
    "text_to_speech": {
        "system": "picotts"
    },
    "wake": {
        "snowboy": {
            "audio_gain": "1.5",
            "sensitivity": "0.5"
        },
        "system": "snowboy"
    }
}

One more investigation:
This morning before talking to rhasspy I ran aplay command on my host system and there were no delays. So maybe it’s docker issue… next morning I will try to run aplay from rhasspy container

So this is docker issue…
when I run
docker container exec rhasspy aplay -D plughw:1,0 /usr/lib/rhasspy/etc/wav/beep_hi.wav
sometimes I have to wait. But if I run the command directly from my host there is no delay

Does anyone know how to fix it? Looks like docker takes resources from rhasspy container after some time…

Hello All,
I have the same issue with this log on 2 satellites (Raspberry PI ZERO WH and Raspberry PI 3B+) / rhasspy 2.5.6 / wake word HERMES MQTT on the master (raven) :

[ERROR:2020-10-10 17:15:17,044] rhasspyserver_hermes: NotFound(404)
Traceback (most recent call last):
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py”, line 1821, in full_dispatch_request
result = await self.dispatch_request(request_context)
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py”, line 1863, in dispatch_request
raise request_.routing_exception
quart.exceptions.NotFound: NotFound(404)
[ERROR:2020-10-10 17:15:16,864] rhasspyserver_hermes: NotFound(404)
Traceback (most recent call last):
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py”, line 1821, in full_dispatch_request
result = await self.dispatch_request(request_context)
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py”, line 1863, in dispatch_request
raise request_.routing_exception
quart.exceptions.NotFound: NotFound(404)

To unblock this issue on my 2 rhasspys, I can write for example a sigle command in the UI.

Sometimes I see the result of a command earlier than I hear beep_lo confirmation sound.
For example, rhasspy sends command to HA, HA turns on my light and only after 1-2 secs I hear sound…
Maybe it’s reading speed. Or something like cache? So weird :thinking: