Looks like our posts just crossed - will take a look at your suggestions when a few more of my brain cells are working properly.
Thanks for trying to make this work for me.
I wonder if you were to replace the contents of /usr/share/alsa/alsa.conf
with something like what I had pasted earlier for .asoundrc
if it would let you do the microphone/speakers on different devices.
BTW, you can avoid having to modify any files inside the docker container by adding another -v
to your docker run
. Something like docker run ... -v /full/path/to/your/alsa.conf:/usr/share/alsa/alsa.conf ...
will replace just that one file in the Docker container with something on your local system.
Thanks, Iâll play around with that.
Next question:
Does this install support a âhotwordâ yet or do I need to do something else?
Iâve added a few settings to the Settings tab so that you can enable the wake/hot word (restart required).
A word of warning: this is using pocketsphinx for wake word detection, so itâs not terribly robust. Thereâs a threshold setting in the profile JSON that can be adjusted (wake.pocketsphinx.threshold
), but itâs not a great solution.
My plan going forward is to create another Docker container with snowboy and Mycroft Precise, and have it use Rhasspyâs HTTP API.
which is the correct way to update? Something like this?
docker pull synesthesiam/rhasspy-server:armhf
docker stop synesthesiam/rhasspy-hassio-addon:armhf
docker rm synesthesiam/rhasspy-hassio-addon:armhf
docker run -d -p 12101:12101 \
--restart unless-stopped \
-e RHASSPY_PROFILES=/profiles \
-v "$HOME/.rhasspy:/profiles" \
-v /dev/snd:/dev/snd \
--privileged \
synesthesiam/rhasspy-server:armhf
am I going to lose all my custom word and sentences?
This doesnât look correct, as it is referring to the name of the image rather than the container that is running. You need to do
docker container ls
to list all of the containers, and remove the ones you need to by id, or name.
In future, you can use -rm
in the docker run
command, and the container will be removed automatically when it is stopped, assuming you donât make any changes inside it.
Before updating, Iâd recommend verifying that your custom sentences and words are stored in $HOME/.rhasspy
. You should find the files sentences.ini
and custom_words.txt
in the appropriate directory under profiles
. As an extra precaution, you can copy/paste them out of the text boxes in the Sentences and Words tabs.
For managing containers/images, Iâd highly recommend installing Portainer. Itâs easy to restart containers as well as view logs and connect into a shell.
No module named ârasa_nluâ
I just saw this error
This should be quick fix. I decided to move RasaNLU outside of the Rhasspy container, but your profile must still be set to use it.
If you can get to your profile.json
file (inside $HOME/.rhasspy/profiles/en
if youâre using English), look for an an intent
section and change the system
from rasa
to fuzzywuzzy
{
...
"intent": {
"system": "fuzzywuzzy",
...
},
....
}
Youâll need to re-train your profile, and then you should be good to go.
{
âhome_assistantâ: {
âaccess_tokenâ: ââ,
âapi_passwordâ: ââ,
âevent_type_formatâ: ârhasspy_{0}â,
âurlâ: âhttp://hassio/homeassistant/â
},
âintentâ: {
âfuzzywuzzyâ: {
âexamples_jsonâ: âintent_examples.jsonâ
},
ârasaâ: {
âconfigâ: ârasa_config.ymlâ,
âexamples_markdownâ: âintent_examples.mdâ,
âproject_dirâ: ârasa_projectsâ,
âproject_nameâ: âdefaultâ
},
âremoteâ: {
âurlâ: âhttp://my-server:12101/api/text-to-intentâ
},
âsystemâ: âfuzzywuzzyâ
},
âmicrophoneâ: {
âsystemâ: âpyaudioâ
},
ârhasspyâ: {
âdefault_profileâ: âenâ,
âlisten_on_startâ: true,
âpreload_profileâ: true
},
âsoundsâ: {
ârecordedâ: âetc/wav/beep_lo.wavâ,
âwakeâ: âetc/wav/beep_hi.wavâ
},
âspeech_to_textâ: {
âg2p_modelâ: âg2p.fstâ,
âgrammars_dirâ: âgrammarsâ,
âpocketsphinxâ: {
âacoustic_modelâ: âacoustic_modelâ,
âbase_dictionaryâ: âbase_dictionary.txtâ,
âcustom_wordsâ: âcustom_words.txtâ,
âdictionaryâ: âdictionary.txtâ,
âlanguage_modelâ: âlanguage_model.txtâ,
âunknown_wordsâ: âunknown_words.txtâ
},
âremoteâ: {
âurlâ: âhttp://my-server:12101/api/speech-to-textâ
},
âsentences_iniâ: âsentences.iniâ,
âsentences_textâ: âsentences.txtâ,
âsystemâ: âpocketsphinxâ
},
âtext_to_speechâ: {
âespeakâ: {
âphoneme_mapâ: âespeak_phonemes.txtâ
},
âphoneme_examplesâ: âphoneme_examples.txtâ,
âsystemâ: âespeakâ
},
âtrainingâ: {
âbalance_sentencesâ: true,
âregexâ: {
âreplaceâ: [
{
â-â: " "
}
],
âsplitâ: â\s+â
},
âtokenizerâ: âregexâ
},
âwakeâ: {
âpocketsphinxâ: {
âkeyphraseâ: âokay rhasspyâ,
âthresholdâ: 1e-40
},
âsystemâ: âpocketsphinxâ
}
}
this is my profile.json file
I pulled the docker image this afternoon, and although everything works as before, I am getting this error periodically
rhasspy-server | ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
rhasspy-server | ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
rhasspy-server | ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
rhasspy-server | ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
rhasspy-server | Cannot connect to server socket err = No such file or directory
rhasspy-server | Cannot connect to server request channel
rhasspy-server | jack server is not running or cannot be started
Iâm not sure what it means, or if it is important.
Itâs not a problem. PyAudio seems to try and go out to multiple backends, and those messages are its attempts. Iâd like to silence them, since they end up just being noise.
Your profile looks good. When do you get the error?
when i got the intent
OK, Iâll take a look. The next version of Rhasspy Iâll put out here will have rasa-nlu removed entirely. Iâll just have a separate Docker image with rasaNLU.
What is the cheapest microphone on usb working with this project? I saw u are recommending ps eye but can u recommend something else?
Hello,
First I would like to say that this is a nice project, thanks! Iâve successfully installed Rhasspy in a Python Virtual Environment on my Raspberry Pi Zero with a Respeaker 2-Mics Pi HAT and connect it with my server for the CPU power (client/server installation).
The only problem Iâve found is the hotword detection, itâs not as accurate as I wish. Trying to play with the threshold values (best practices: keyphrase thresholds) and different hotwords gives a lot of false positives or no response at all. Iâve read that this is a known problem with the Pocketsphinx module and youâre working on it. But Iâve also read that there was an alternative in earlier releases named Snowboy, but it was incompatible with the Hass.io installation. Is this module entirely removed or are there possibilities to make this work again for environments without Hass.io (donât have a Hass.io installation, running Home Assistant in a Docker container on a separate VM)?
Thanks!
I havenât tried anything cheaper than the PS3 eye. Itâs currently 7 USD on Amazon, which seems hard to beat for such a good microphone. Snips did a benchmarking a while back you might be interested in reading: https://medium.com/snips-ai/benchmarking-microphone-arrays-respeaker-conexant-microsemi-acuedge-matrix-creator-minidsp-950de8876fda
Glad to hear youâve gotten it installed and working! The issue Iâm facing with Snowboy (and currently Mycroft Precise) is the fact that Hass.io is based on Alpine Linux, which uses different system libraries than other Linux distros.
Outside of Alpine, though, I have both working just fine! All that needs to be done is a little glue between this project and Rhasspyâs web interface. Once the wake word is detected, it just needs to do an HTTP POST to the /listen-for-command
endpoint in Rhasspy, which will âwakeâ it up and have it start listening for a command. Iâll see if I can get an example working this weekend.