synesthesiam / hassio-addons

My Hass.IO add-ons
44 stars 18 forks source link

Porcupine wake word #20

Open thegnuu opened 3 years ago

thegnuu commented 3 years ago

I am currently trying to add a wake word to porcupine but somehow I am not able to figure out how this is done.

I just added it to my profile at the following path /share/rhasspy/profiles/en/porcupine/jarvis.ppn. This matches the config of my Rhasspy Add-On. Setting the name of the file is not working and the refresh button does nothing as well.

Am I missing something here?

I used Rhasspy on a dedicated PI before and setting this up worked without any issues.

MikeLDPT commented 3 years ago

Hi @thegnuu. I am having the same issue.

I was a little surprised that there was no ../en/porcupine/ directory with .ppn created automatically on choosing porcupine as the wake word engine with Rhasspy (on Hassio). I created the directory manually and placed a downloaded .ppn file in there. Save and restart and "refresh" causes timeout after a quite a few seconds and no words populate the Available Keywords: box.

Have you managed to resolve the issue by any chance?

I notice that there are errors in the Rhasspy log:

[ERROR:2021-01-21 16:17:03,233] rhasspyserver_hermes: 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 1869, in dispatchrequest return await handler(**request.view_args) File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/main.py", line 826, in api_wake_words hotwords = await core.get_hotwords() File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py", line 887, in get_hotwords handle_finished(), messages, message_types File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py", line 971, in publish_wait result_awaitable, timeout=timeout_seconds File "/usr/lib/python3.7/asyncio/tasks.py", line 423, in wait_for raise futures.TimeoutError() concurrent.futures._base.TimeoutError

I hope someone has cracked this one!

thegnuu commented 3 years ago

@MikeLDPT It seems like an issue with Rhasspy itself.

I have not tested it right now, since I just used one of my spare PIs to run Rhasspy on it, but it looks like there was an update of porcupine in 2.5.9 which might resolve this issue!

See this: https://community.rhasspy.org/t/wake-word-porcupine-help-is-needed/2104/14?u=thegnuu

Have you tested it with 2.5.9?

Mouky66 commented 3 years ago

Same issue with 2.5.9

MikeLDPT commented 3 years ago

Yes, I can concur that I'm running 2.5.9.... The changelog in Rhasspy mentions: "Upgrade porcupine wake word system to 1.9". Seems the latest version of prcupine is 1.9.

I have tried using Raven insetad and that does not seem to have any issues with updating the wake config files. It places the .wav files in the \rhasspy\profiles\en\raven directory OK.

It "feels" like an error with Porcupine knowing exactly where the .ppn file is. No idea really though as yet.

synesthesiam commented 3 years ago

I was a little surprised that there was no ../en/porcupine/ directory with .ppn created automatically on choosing porcupine as the wake word engine with Rhasspy (on Hassio).

The porcupine Python package includes all the default keywords in its install directory. Only custom keywords need to go in the profile.

I just added it to my profile at the following path /share/rhasspy/profiles/en/porcupine/jarvis.ppn.

This looks correct to me, but I will need to test again on Hass.io. Testing on my desktop, creating a ".ppn" file in the en/porcupine directory and hitting Refresh immediately shows the new keyword.

While I look into this more, I'll update the web UI to show the exact path where it's expecting the files :+1:

MikeLDPT commented 3 years ago

Thank you Synesthesiam. In case it helps, here are a couple of screen shots. I am running this under Hassio on a raspberry pi and assume I have chosen the corect format .ppn file. I downloaded again the porcupine_raspberry-pi.ppn from github and placed it here:

image

I then chose Porcupine as the wake word engine. Raven was previously chosen. The configuration looks like this, and when you click on the drop down to select "available keywords" nothing is there. Clicking on refresh causes the timeout error after a number of seconds:

image

which causes the error messages in the log:

[ERROR:2021-01-28 15:31:30,327] rhasspyserver_hermes: 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 1869, in dispatchrequest return await handler(**request.view_args) File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/main.py", line 826, in api_wake_words hotwords = await core.get_hotwords() File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py", line 887, in get_hotwords handle_finished(), messages, message_types File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py", line 971, in publish_wait result_awaitable, timeout=timeout_seconds File "/usr/lib/python3.7/asyncio/tasks.py", line 423, in wait_for raise futures.TimeoutError() concurrent.futures._base.TimeoutError

Raven on the other hand had no problems putting the Wav files in its alloted directory, and so it seems raven can find and access the directory area :

image