Rhasspy offline voice assistant toolkit

What is Al for you ? I see that you speak about al/AL and not AI/ai like Romkabouter thought.

Artificial life? :slight_smile:

I just pushed some fixes tonight that should help you on an RPi 3 (not a B+). Please update your repo and re-run the create-venv.sh script. It should now take only around 5-10 minutes, depending on your internet speed.

1 Like

One of the ways I could imagine adding A.I. into Rhasspy is filling in missing details. If you say “turn on the light”, Rhasspy doesn’t know which light. But if it knows where you are (in the living room) and that there’s only one light, it should be able to figure it out. This could be really simple, like setting defaults for specific Rhasspy satellites, or it could involve actual A.I. with inference, abduction, etc.

Either way, I’d be interested to see it!

Thank you very much. You understand what I mean
This is amazing
I will wait

This cool. I made the installation and ran the venv. However it crashes on a certain point.

./run-venv.sh --profile el

ERROR:SnowboyWakeListener:receiveMessage
Traceback (most recent call last):
  File "/home/pi/rhasspy/rhasspy/actor.py", line 108, in on_receive
    self._state_method(message, sender)
  File "/home/pi/rhasspy/rhasspy/wake.py", line 288, in in_loaded
    self.load_detector()
  File "/home/pi/rhasspy/rhasspy/wake.py", line 356, in load_detector
    ), f"Can't find snowboy model file (expected at {model_path})"
AssertionError: Can't find snowboy model file (expected at /home/pi/rhasspy/profiles/el/snowboy.umdl)
INFO:__main__:Started
DEBUG:root:Starting web server at http://0.0.0.0:12101

And when I try to open the url, it loads and immediately crashes with this error:

DEBUG:__main__:Loading phoneme examples from /home/pi/rhasspy/profiles/el/phoneme_examples.txt
INFO:geventwebsocket.handler:192.168.1.100 - - [2019-05-23 11:41:58] "GET /api/phonemes HTTP/1.1" 200 2207 0.016054
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
ERROR:DialogueManager:receiveMessage
Traceback (most recent call last):
  File "/home/pi/rhasspy/rhasspy/actor.py", line 108, in on_receive
    self._state_method(message, sender)
  File "/home/pi/rhasspy/rhasspy/dialogue.py", line 231, in in_asleep
    self.handle_any(message, sender)
  File "/home/pi/rhasspy/rhasspy/dialogue.py", line 492, in handle_any
    self.handle_forward(message, sender)
  File "/home/pi/rhasspy/rhasspy/dialogue.py", line 507, in handle_forward
    mics = recorder_class.get_microphones()
  File "/home/pi/rhasspy/rhasspy/audio_recorder.py", line 237, in get_microphones
    default_name = audio.get_default_input_device_info().get("name")
  File "/home/pi/rhasspy/.venv/lib/python3.6/site-packages/pyaudio.py", line 949, in get_default_input_device_info
    device_index = pa.get_default_input_device()
OSError: No Default Input Device Available

From my understanding I should plug in a device to make the recording (which I havent), and that makes sense… But shouldnt it just ignore the absence of an input device rather than completely crash? Or is there something else I am missing?

EDIT: I disabled everything from the profile page and it now works fine. I suppose the extra software needed has to be downloaded before you start the venv. If thats the case, then you might want to have everything disabled from start so we dont have to download unnecessary software if we dont have to use them and only enable features we want.

It’s a trade-off with what to have enabled by default. Most people expect to start Rhasspy with a mic and immediately be able to use a wake word, etc. It might be useful to do something on the first execution of run-venv.sh where it checks for a mic and asks the user if they’d like to download additional files. It should definitely not crash in either case, though! Did the whole thing crash, or just the DialogueManager? In other words, was the web interface still accessible?

Also, I notice that you’re using the Greek (el) profile. This is great, and I’d love to hear your feedback on the profile itself. Specifically, does it work as you’d expect and do the default sentences represent what you would actually say? I don’t know Greek, so I rely on community members to help me get beyond Google Translate :slight_smile:

I noticed this too when I was setting up Rhasspy with the virtual environment on my NAS without microphone and speakers. I don’t remember the exact error messages and which component was crashing, but in my case the web interface wasn’t responsive: I couldn’t disable audio because the web interface stopped working then. I fixed this by manually setting the microphone and sounds systems to “hermes” in profile.json (by copying the relevant parts from the configuration of my other Rhasspy instance, in a Docker container). After a restart of Rhasspy using this configuration, the crash didn’t reappear.

1 Like

The whole thing crashed. The web interface was unresponsive and when I ctrl+c the terminal, it became responsive for a millisecond and then the interface went down (as it was supposed to do) since I terminated the process.

Hello!
I have just started playing with Rhasspy - by that I mean I created a docker container a few days ago and have been trying to get the basics to work.

I not changed anything except getting it to connect to Home Assistant - that is now working…
Next I wanted to change the wake work to pocketsphinx as I am not ready to create my own wake work with snowboy yet - I don’t even have mic/speakers hooked up… :slight_smile:

When I change the wake word, save, and restart Rhasspy, it changes back to snowboy.
As I said, I have changed basically nothing - so is there something I am doing wrong?

Thanks!
DeadEnd

Glad to have you on board!

I’ve got a fix for the wake word setting issue, and hopefully some better error handling for when a microphone is not attached. The Docker containers are building as I type :slight_smile:

Allright, I switched to docker as per Michaels suggestions. Installed and runs fine. Do I have to install and the rest of the components? If yes, how do I do that? This is my first time with docker, please bare with me.

Everything is included in the Docker image, except for the individual profile files (that would add another gigabyte or so).

I just updated to the latest docker version to try out wavenet tts but i cant get it to work correctly as its always using some default setting for voice and gender:

[DEBUG:13464] GoogleWaveNetSentenceSpeaker: Calling Wavenet (lang=en-GB, voice=Wavenet-C, gender=MALE, rate=22050)

No matter what i setup in the ui or in my profile.json:

"text_to_speech": {
    "system": "wavenet",
    "wavenet": {
        "gender": "MALE",
        "language_code": "en-GB",
        "voice": "Wavenet-B",
        "fallback_tts": "picotts"
    }
},

On https://cloud.google.com/text-to-speech/ there is no Option for Gender and the Wavenet-C is a female voice. Am i doing something wrong? No errors show up in the log.

The sample webpage also allows for configuring speed and pitch, will this be possible with rhasspy in the future?

PS: i used my what time is it event so its not using any cached sentences.

Checking the sourcecode and it looks like there is an issue.
The profile json says: “voice”: “Wavenet-B”, but when the code is called, it checks for a setting:
“text_to_speech.wavenet.wavenet_voice”, which defaults to “Wavenet-C” if not found.

That should be:
“text_to_speech.wavenet.voice”

Ah thanks, could have figured this out as well :slight_smile:
Manually changing the profile json works for fixing this and i get the english voice.

I played arround with the nodered timer example and have a few questions.
I am a total beginner with nodered, just installed it a few minutes ago.
The example works great if i dont send the intents to HA, but it seems the internal intent api (which the nodered flow relys) on wont fire with normal wakeword detection if home assistant is configured.
Is this by design or am i missing something?

i am currently trying to convert the example to use the ha event instead.

Hi

I’m trying to get Rhasspy up and running on a raspberry pi and docker. I’ve added a usb sound card an a web camera, but I can’t see that anything is recorded.

What am I missing in getting this right?

I am using HA events, because I used the event to tigger automations which send TTS messages back to Rhasspy

yeah got it working now as well. Biggest problem was with HA Events that the full message is not stored in the vent but only the event name and rules.
Because of this it was a bit of hassle to get the timer to repeat what time was set and i ended up with a lot of if and else for it to sound natural :slight_smile:

If someone wants my modified function just tell me.

Update:
Ok got my hands dirty with node-red and created a beefed up timer.
This one also support pausing and resuming timers as well as stopping them completely, it will also tell you the time left or if there is a paused timer if you ask for it.

@synesthesiam:
Any plans for sound playback with rhasspy? (stored files or urls?)
I know i could install a mediaplayer on my hermes satellite and use it thorugh home assistant but using rhasspy for this would be a bit simpler imo.
I thought about having a soundfile being played when my timer is ready instead of or in combination with tts.

Do you mean the /api/play-wav endpoint? You can use this REST endpoint to play a WAV file. Have a look at http://IPOFYOURRHASSPY:12101/api/ for a list of the available REST API URLs.