How to build a working german profile with hass.io on a Raspberry Pi 3B+

Hello Rhasspy-Community :slight_smile:

I am quite new to this community and Rhasspy, as you might see in my community profile :sweat_smile:

When following a tutorial on setting up Rhasspy on a Raspberry Pi 3B+ with Matrix Voice, I could not get a german profile working. Thats why I created a specific topic on the problem, that I thought I had. While my conversation with @fastjack, @geoffrey and @Jorg_Baumann I learned a lot of things that led me to the point, where I saw my whole problem.

the problem:
I am unable to create a working german profile.

the setup:

  • Raspberry Pi 3B+
  • Raspbian Buster
  • Matrix Voice as Microphone
  • Rhasspy Version 2.4.19 in Docker Container

what would help:
Every hint on which Toolkit to choose for which category in the settings and what to do to get them working all together will help me a lot. Also I would love to hear about getting hass.io working with Rhasspy on one Raspberry Pi.

what I tried:

  • installed an english profile which worked kind of good with porcupine as wake word toolkit (no option for a german profile)
  • tried to use Kaldi for Speech Recognition with a workaround of @Jorg_Baumann in german profile, that said Kaldi is ā€œnot compatible with this profileā€ (situation described in my other topic mentioned above); sadly did not work for me

I read a lot of topics and it seems like there are some more Germans and some Europeans with similar languages on here, that could possibly help me with building a profile. This would be very nice of you :slight_smile:

Thank you in advance and best wishes
RaspiManu

EDIT: added setup info

Not sure if itā€™s much help, but hopefully encouraging: one of my family members runs rhasspy on three pcs (his desktop linux pc with microphone, an old thinkpad as server without microphone and running node-red too, and a rhaspberry pi sattelite with a usb microphone in the living room). He uses the English porcupine as wakeword, kaldi with german recognition, openfst as intent recognizer and is pretty happy about it. He uses only virtual environments, no docker - all his computers run current versions of either xubuntu or raspbian.

Can this information push you in the right direction?

Hi @ulno,
every help is much appreciated, gives me an impression on what other people do and pushes me in the right direction. I got some questions about this setup:

  • How can he use the english ā€œporcupineā€ as wake word? When I used Porcupine as wake word toolkit in the english profile, it worked quite good, but in the german profile it did not react and I pronounced the word ā€œporcupineā€ just like in english. I heard it only works with English, doesnā€™t it?

  • How was he able to select Kaldi with german recognition? Both my profiles, EN and DE show me this:

    I tried using it with the workaround of @Jorg_Baumann described in my other topic linked above, but could not manage to get it working.

Hi RaspiManu,
Sorry, but I only can repeat that for me that was the only way to get Kaldi working.

My Hardware: Raspi 4 / 4Gbyte RAM, ReSpeaker 4-Mic Array.
Running Rhasspy 2.4.19 in a docker container under Raspbian Buster light.

My suggestion would be, first to make a clean environment:
1.)

docker ps
(that list you all containers)

  1. ) Stop all containers:

docker stop <container id>

3.) Delete all containers (if you have multiple containers, remove all of them):

docker rm <container id>

4.) List all downloaded images:

docker images

  1. Delete all downloaded images:

docker rmi <image id>

If deleting throws an error try this:

docker rmi -f <image id>

  1. Delete all your profiles under /home/pi/.config/rhasspy/profiles/ (en/de)

  2. Now you can try again to install Rhasspy:

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

(I would suggest, first try with english profile, to see, if Kaldi works now.)

If thatā€™s fine you can stop the docker container with the english profile:

docker stop < container id >

Then you can install the German profile:

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 de

Normally, of course, Kaldi should work out of the box with the German profile, but Iā€™ve found no way to activate it with my workaround.

BTW: Iā€™m using snowboy as wakeword.
__
If you like, you can visit the German ioBroker forum: ioBroker - rhasspy-offline-sprachsteuerung where Rhasspy is also discussed (Iā€™m also there as joergeli)

Good luck!

Addendum:
I read somewhere, that porcupine-wakeword is not so good for German profile, because itā€™ designed for English?

1 Like

Ah, this bug I had in English too. I fixed that with deleting the profile and never selecting pocketsphinx (or via upgrading to 2.4.19 - happened at the same time). Which version are you using?

Thank you very much for that very detailed description and the other hints, @Jorg_Baumann. I will try this as soon as possible.

Sorry @ulno for not describing my setup in the topic. Just forgot that point and will add it to the initial text now. How can I never select pocketsphinx, when it is the default, isnā€™t it?

When you start with an empty profile the first time, kaldi was selectable for me. Saving settings once disabled it. Is that the same for you?

Yes, same for me. When I tried setting up a clean english profile in a new docker container yesterday, I was able to choose Kaldi right after the first boot. So I chose it , saved and restarted, but no download popped up and Kaldi was not choosable anymore.

And you are running 2.4.19?

Yes, my setup consists of a Raspberry Pi 3B+ with a Matrix Voice, Raspbian Buster and Rhasspy Version 2.4.19 in a docker container. Sorry, I added it to the initial text of the topic but did not write it in my reply :sweat_smile:

Hi @ulno, @Jorg_Baumann and everyone else interested in this topic,

Itā€™s been some time now and Iā€™m still not able to use Kaldi for speech recognition. I tried everything mentioned in here (except one thing, to be discussed later) but had no luck. Thatā€™s why I set up a fresh image of Buster and tried it again with installing the english profile. Sadly I still get the message, that Kaldi is ā€œnot compatible with this profileā€.

When looking at the hardware and software setup described by @Jorg_Baumannā€¦ :

ā€¦ I see 3 differences to my setup:

  • I use a Raspberry Pi 3B+.
  • My microphone is a Matrix Voice (working well).
  • I use a desktop version of Raspbian Buster, because one goal of my project is voice controlling things shown on the screen.

Did anyone have problems with one of my setupā€™s components (soft- / hardware)?

The one thing to be discussed later:

I still donā€™t know how to never select pocketsphinx, because itā€™s the default of every fresh installed image of Rhasspy 2.4.19. How can I set up a fresh image without pocketsphinx to test this?

Hi,
IMHO Raspi 3B is Ok, because in the past I also used a 3B with Kaldi.
Itā€™s only a little bit slower than my Raspi 4.
Matrix Voice also should be OK, because I know from another user, that Kaldi works with his Matrix Voice.
Buster Desktop perhaps slows down the speed a bit , but should not be a problem.

Meanwhile I installed Rhasspy V2.5-pre several times on a separate Raspi4 Test-System and there Kaldi works out of the box (after downloading the necessary files) with German profile. ( on the other hand, I have other problems with Rhasspy V2.5-pre, but not with Kaldi)
Perhaps you can also try to test Rhasspy V2.5-pre, to see, if Kaldi is working?

Hi @Jorg_Baumann,
thanks for the fast response. Can I test 2.5-pre with just stopping my 2.4.19 docker container and starting a new one with 2.5-pre, or will I have to remove the complete 2.4.19 image?
If I build my system with 2.5-pre, will it be possible to just update it to 2.5 when fully released, or will I have to build it again?

IMHO stopping the 2.4.19-container will be OK, but for security I would save the profile-directory before installing 2.5-pre
2.5-pre -> 2.5 final: IMHO, when 2.5 final is released, I would make a new container, because at the moment we donā€™t know what differences will be between 2.5-pre and 2.5 final.
But I think, thatā€™s not hard work, when you backup your profile before.

By the way, Iā€™m no Rhasspy specialist and can only share my experiences

Thanks @Jorg_Baumann for answering my questions. I will try it with 2.5-pre as soon as possible.

It works!
I stopped the 2.4.19 docker container, started a new one with 2.5.0-pre and was able to choose Kaldi. It is very nice for recognizing the german language. This is the first time, I got kind of a working base system of Rhasspy. Thank you very much for your continuing help, @Jorg_Baumann.

Finally, we can move on to the second goal of this topic:
Having Home Assistant as intent handler on the same Pi.
I will start experimenting with it in a few days, so at this point, I am very interested in these questions:

  • What type of installation of home assistant would fit best for my case? (need it inside Raspbian)
  • Are there any good hints for a complete Home Assistant newbie before starting?

Donā€™t use the hassos version of home assistant. That one has some issues with hogging the audio devices and at least for me the known workarounds were never permanent. I use the home assistant docker now, that one does not interfere with the audio devices.

Thank you very much for that hint, @Daenara.
Is the docker version of home assistant updatable or will I have to overwrite it, when a new version is released?

I am actually not sure, I didnā€™t update since I switched to docker. The concept of docker would be to overwrite it, I think. There should be a section in the hass installation guide about how to update thought.

I got some more RasPis and was thinking about setting up one as Rhasspy and one with HassOS and let them communicate inside my local network so both have better performance and I got the updates and AddOns for Home Assistant. Could this be a good idea?

Because of the problems you had with HassOs, @Daenara,ā€¦
Could you please explain them a little bit more? Did HassOs have a problem with the devices for communicating with Rhasspy, microphone etc., or did you have problems with some Bluetooth Speakers in your home or something similar, that directly interacts with Home Assistant? Will I also have these problems, if I go for my idea described above?