Rhasspy offline voice assistant toolkit

Hi @synesthesiam
Could you please help me with setup rhasspy?
I am using adddon for Home Assistant. I have a problem, my profille could not be applied correcty. It’s stucked on some old state. I try to set another microphone, change wake word, but profile in Advanced tab doesn’t update.

Physical file of profile on the drive has updated version, but it doesn’t match with Advanced tab. And after restart addon, my last changes is not updated and stucked from Advanced working.
Why profile in Advanced tab of web view is different from physical file? How to fix it.
Thank you

I suggest remove the addon and the files an /share and start over.
Make a backup of your sentences and slots

Hello @synesthesiam and everyone!
first off, thanks for this amazing piece of software !
not sure if my question/request belonged to “issues” on github, so I’ll try to explain here.

I’m using the virtualenv installation on a rpi 3, with a ps3eye mic via pyaudio, with the Italian language model.

I’d like to know if there is any way to improve the speech recognition, providing more examples for a more reliable word matching, as I’m experiencing a very frustrating unreliable recognition.
In fact, the commands accendi (turn on) and spegni (turn off) get mixed very often (70% of the times, even without any noise in the room) I’m puzzled since they sound very different, and i’m not even talking with my hands (which is very difficult for an Italian :smile: )
jokes aside, looking ad the phonemes for these custom words, they look, and sound, reasonably close to the real pronunciation, but I’m wondering if and how I can provide more examples for a better model.
Thanks !

1 Like

Hi All!
Playing with PS3 Eye and got some difficulties concerning Microphone gain! May be someone has an experiences and can share with us?!

My experiences are:

  1. Some Good asound.conf available on the internet. Like this - https://gist.github.com/AfzalivE/54214bf437ca1775b5b8e7934cc137db
  2. Rhasspy don’t catch asound.conf from HASS host. You need to push your configuration in rhasspy container. Simple way is to edit /usr/share/hassio/tmp/75f2ff60_rhasspy_asound. Be careful - after rhasspy container restarted - file will be replaced. I think @synesthesiam be able to solve this!:wink:

What I couldn’t solve:

  1. alsamixer doesn’t work with PS3 Eye -> can’t control Microphone gain

Did you see this older asoundrc/alsa post?

Yes! The same configuration here - https://gist.github.com/AfzalivE/54214bf437ca1775b5b8e7934cc137db

@synesthesiam - already implement asound.conf in Rhasspy 2.4.17 - Rhasspy Announcements - Great!

@synesthesiam - something broke in 2.4.17.1:

INFO:__main__:Started
DEBUG:__main__:Starting web server at http://0.0.0.0:12101
Running on https://0.0.0.0:12101 (CTRL + C to quit)
[2020-01-23 16:00:07,217] ASGI Framework Lifespan error, continuing without Lifespan support
WARNING:quart.serving:ASGI Framework Lifespan error, continuing without Lifespan support
ALSA lib conf.c:1852:(snd_config_load1) _toplevel_:2:0:Unexpected end of file
ALSA lib conf.c:3615:(config_file_open) /root/.asoundrc may be old or corrupted: consider to remove or fix it
ALSA lib conf.c:3537:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib conf.c:3986:(snd_config_update_r) hooks failed, removing configuration
ALSA lib conf.c:1852:(snd_config_load1) _toplevel_:2:0:Unexpected end of file
ALSA lib conf.c:3615:(config_file_open) /root/.asoundrc may be old or corrupted: consider to remove or fix it
ALSA lib conf.c:3537:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib conf.c:3986:(snd_config_update_r) hooks failed, removing configuration
ALSA lib conf.c:1852:(snd_config_load1) _toplevel_:2:0:Unexpected end of file
ALSA lib conf.c:3615:(config_file_open) /root/.asoundrc may be old or corrupted: consider to remove or fix it
ALSA lib conf.c:3537:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib conf.c:3986:(snd_config_update_r) hooks failed, removing configuration
Expression 'alsa_snd_config_update()' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1354
Expression 'BuildDeviceList( alsaHostApi )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 767
ERROR:PyAudioRecorder:to_recording
Traceback (most recent call last):
  File "/usr/share/rhasspy/rhasspy/audio_recorder.py", line 158, in to_recording
    self.audio = pyaudio.PyAudio()
  File "/usr/local/lib/python3.6/dist-packages/pyaudio.py", line 677, in __init__
    pa.initialize()
OSError: [Errno -9999] Unanticipated host error
DEBUG:PyAudioRecorder:recording -> started

asound.conf

pcm.!default {
  type asym
  capture.pcm "cap"
  playback.pcm "speaker"
}
pcm.mic {
  type plug
  slave {
    pcm "hw:1,0"
  }
}
pcm.speaker {
  type plug
  slave {
    pcm "hw:0,0"
  }
}


pcm.array {
 type hw
 card VOICE
}
pcm.array_gain {
 type softvol
   slave {
   pcm "array"
   }
 control {
   name "Mic Gain"
   count 2
   card 0
   }
 min_dB -10.0
 max_dB 5.0
 resolution 10
}
pcm.cap {
 type plug
 slave {
   pcm "array_gain"
   channels 4
   }
 route_policy sum
}

2.4.17 - everything fine!

In container:
root@75f2ff60-rhasspy:/# cat /root/.asoundrc
/share/rhasspy/asound.conf

In this version, I accidentally overwrote /root/.asoundrc with an empty file. This may be causing your problems. See this post for how to put your asound.conf into the Rhasspy add-on configuration.

You change cat to echo in https://github.com/synesthesiam/hassio-addons/commit/f9e047ecb8adc4caec1ead274068fd1ca7b57d6e

In my opinion put asound.conf to /share/rhasspy and set “asoundrc” variable in Config of add-on to “/share/rhasspy/asound.conf” is more clear and useful.

For those who are encountered this problem too:
After you change /etc/asound.conf for PS3Eye to someone like:

pcm.!default {
  type asym
  capture.pcm "cap"
  playback.pcm "speaker"
}
pcm.speaker {
  type plug
  slave {
    pcm "hw:0,0"
  }
}

ctl.!default {
    type hw
    card 0
}

pcm.array {
 type hw
 card VOICE
}
pcm.array_gain {
 type softvol
   slave {
   pcm "array"
   }
 control {
   name "PS3Eye Gain"
   count 2
   card 0
   }
 min_dB -40.0
 max_dB 5.0
 resolution 10
}
pcm.cap {
 type plug
 slave {
   pcm "array_gain"
   channels 4
   }
 route_policy sum
}

And after restart(I don’t know another way to reload alsa). You can mange gain by running -

alsamixer -V capture

One more “sound bar” with name “PS3Eye Gain” will appear in alsamixer control panel!

1 Like

@synesthesiam add, please, expose port 12333/udp to rhasspy container for GStreamer input!

1 Like

Done, thanks! :+1:

1 Like

Please help me
I reinstalled and reported an error

Did your Home Assistant access token get deleted?

I have changed the new key
and reconfigure the inaccessible alerts

Is there a trick for getting different wake words to work? I am trying to get jarvis (downloaded from snowboy github and place in the snowboy dir) to work with snowboy, but everytime I change it in the settings, the UI crashes and becomes inaccessible?

I think the Jarvis model contains two sub-models, so you need to go to Rhasspy’s settings, find the Snowboy sensitivity, and provide two values like “0.5,0.5”. You should also check “Apply Frontend”. See this page for more details.

That did it! Thanks for the hint. Now if I could only speed up wavenet :grin:

Ahw man, I just implemented the ps3eye fix from this sub and the microphone is working great now!

New problem has arisen though. I just upgraded to 2.4.18 and suddenly Webrtcvad is timing out so every command now takes about 30 seconds.

DEBUG:WebrtcvadCommandListener:Voice command started
WARNING:WebrtcvadCommandListener:Timeout

Anyone else experiencing this? Scratch that! Everything works absolutely fabulous, the problem only occurs when I have told rhasspy to turn on the ventilation. Apparently the fans are a little too loud for WebrtcvadCommandListener so it does not know when to stop listening.
Intent recognition is spot on.

Thanks!