Rhasspy offline voice assistant toolkit

Thanks for the reply, but in that thread it requires an underlying OS for the respeaker to work, such as Debian. I have no underlying OS.

How would you run Rhasspy with no OS?

I think he means he is running hassio and not linux with hassio on top of it either in docker or in a venv.

2 Likes

Yes thanks, this is what I mean.

That would be a neat trick. There has to be an underlying operating system, else docker, python, and hass.io could not run. :frowning:

Has anyone gotten hass.io rhasspy install working with a google voice hat?

I was able to install it when I just had rhasspy installed via docker on top of raspian but I am not sure how I can install the voice hat onto the hass.io image.

I havenā€™t tried doing it in hassio as I gave up on running HA on the pi and moved to an old laptop, but Iā€™m curious how you got the aiy voice hat running on raspbian.
Any links you can share?

Thanks

I used the following instructions to setup for use with Snips, before I realised snips was going bye bye.

[using a RaspberryPi 3B+ with 2019-04-08-raspbian-stretch-lite, and a Fedora Linux PC]

  1. copy a clean raspbian lite install to an microSD card sudo dd if=$image_file of=/dev/mmcblk0 bs=4M status=progress
  2. in /dev/mmcblk0/boot partition create 2 files
  • empty text file called ā€˜sshā€™ to allow ssh access: touch ssh
  • to connect to wifi create file wpa_supplicant.conf and fill:
        country=[lowercase country code]
	ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
	update_config=1
	network={
		ssid="Your Wi-Fi network name"
		psk="Your Wi-Fi network password"
	}
  1. boot up and connect to pi through ssh ssh [email protected] [password: raspberry]
  2. setup and update
	sudo raspi-config [change default password, expand filesystem, update, etc]
	sudo reboot
	sudo rpi-update
	sudo reboot
	sudo apt update && sudo apt upgrade
	sudo reboot
  1. install AIY VoiceKit v1 hardware support
	sudo apt install git
	git clone https://github.com/google/aiyprojects-raspbian.git
	cd aiyprojects-raspbian
	git checkout voicekit
	sudo scripts/configure-driver.sh
	sudo scripts/install-alsa-config.sh
  1. install Sam Command Line Interface on your computer (not the pi)
            sudo dnf install nodejs npm
            sudo npm install -g snips-sam
  1. find pi in your LAN, connect, and install software
	sam devices
	sam connect [IP]
	sam init
  1. reboot and test system
	sudo reboot
	sam test speaker
	sam test microphone

from this link https://forum.snips.ai/t/using-snips-on-google-voice-kit-v1-hardware/2153/18

I did have some issues with a docker install of Rhasspy using this method, I couldnā€™t control the volume and it was a bit intermittent. I think the intermittentness came from me trying to fix the volume.

@synesthesiam
I am having a hard time trying to migrate my Pi3 to a more Robust Intel I5 machine. I opted for a Proxmox > Ubuntu > Docker setup, so a lot of things are new to me, then I have a lot to learn.
I could get Rhasspy installed in Docker, but could not change language (en to pt).
In ~/.config there is no rhasspy folder. Then I tryed to change language in Advanced Tab, including:

    "rhasspy": {
        "default_profile": "pt"
    },

But it didnā€™t work.
I donā€™t know how to find the profile config. Sorry for any lack of knowledge, but I am trying my best. I hope you can point me to the right direction.

Also, I could get the Playstation Eye Mic be recognized by Ubuntu VM and Rhasspy detected it, but if I choose it in Settings Tab it returns an error. If I leave it as ā€œdefaultā€, then it works.

I will take the opportunity to ask if there is any advantage installing the docker version instead of the hassio addon. Installing the hassio addon would create a docker container too, but maybe I would have an easier way to config since I would have access to addon config.
Sorry for probably some basic questionsā€¦
Thanks.

PS: v 2.4.16

Your profile directory is installed according to the docker command used to start/run your docker container. Do you still have the docker command you used to start it?

docker run -d -p 12101:12101 \
      --restart unless-stopped \
      -v "$HOME/.config/rhasspy/profiles:/profiles" \
      --device /dev/snd:/dev/snd \
      synesthesiam/rhasspy-server:latest \
      --user-profiles /profiles \
      --profile en

https://rhasspy.readthedocs.io/en/latest/installation/

One other thought: If you installed the docker environment as the ā€˜rootā€™ user, then the profiles directory may be beneath /root/.config instead of /home/pi/.config/

Yes. Thatā€™s the way I run it. I just was in the hope that changing languages would be as easier as before.
Well, so I will have to ask another stupid question. Can I run the command below to change it to start as as pt profile?

docker container update 12345abcdef --user-profiles /profiles \ --profile pt

Where 12345abcdf is the code of the container.
I know there are many ways to do it.
Thanks for your help and sorry for some basic questions.

PS: I tryed and it didnā€™t work. (unknown flag: --user-profiles)
Maybe is better to remove the container and start it again with ā€œdocker run ā€¦ profile ptā€.

Anyway I would like to learn how to change language the easy way.

Iā€™m not able to reach into my home LAN from work, but did you try double-clicking the ā€˜enā€™ icon on the upper-right hand part of the web GUI? I donā€™t know if that allows changes, Iā€™m just guessing.

Yes, I had the same idea that it would be cool if we could change the language clicking in that icon, but it does not work that way.

Then I tryed to remove the container and de image and pull it again. Now, when I run the command ā€œdocker run ā€¦ --profile ptā€, it returns " Docker: invalid reference format".

In Portainer I can see that the image is there as ā€œUnusedā€, but I canā€™t get it to runā€¦
So I got stuck.

PS: Got it running. It was some breaking line in the copy/paste process.
Now it is running with pt profile.

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