ReSpeaker 4-mic HAT not detected by Rhasspy new install

I purchased a ReSpeaker 4-mic HAT after seeing it mentioned extensively in Rhasspy docs … thus thought it’s best (or at least best supported) hardware to add voice control to Home Assistant. On re-reading the Rhasspy docs I see that ReSpeaker is not “recommended”, but “Most of the local audio testing has been done with …”

Installed ReSpeaker 4-mic hardware on Raspberry Pi 4.
Got it demonstrated as working on Raspberry Pi OS by using HinTak’s driver and audacity.

Fresh new install of Home Assistant OS 5.13, supervisor-2021.03.9 and core-2021.4.3 on a RasPi 4.
Followed Rhasspy instructions to install on Hass.io (at https://rhasspy.readthedocs.io/en/latest/installation/#hassio) - Current version: 2.5.10.1. Instructions say to set the Rhasspy Assistant Add-on’s Audio configuration before starting the add-on … but Audio input drop-down box contains only “default” and Audio Output drop-down contains “Default”, “Built-in audio stereo”, and “Built-in audio stereo”.
Reboot Host just to make sure everything is reset … and still no audio devices listed.

Rhasspy is started, so go to Rhasspy Settings page (at port 12101), and select all the “recommended” options (PyAudio for Audio Recording and aplay for Audio Playing). Restart … and under Audio Recording click [Refresh] and available options for “Device” are: Default Device, JACK audion connection kit, Discard all samples or generate zero samples, and PulseAudio Sound Server.

I have poured over posts here, on seeedstudio’s forum and Home Assistant forum. It seems that seeed ceased supporting their products a year ago, and since then HinTak (not a seeed employee) has been trying to keep up with upstream changes to the Raspberry Pi OS. There has been several suggestions over that time, most of which are probably now out-of-date and many technically over my head.

So, are there fairly simple instructions for getting a ReSpeaker to work with Rhasspy add-on to Home Assistant ?
And if this is not going to be a well supported option in future I am happy to return my new ReSpeaker board - but what microphone hardware would be a better option ?

I’m sure you linux gurus are tired of repeatedly answering essentially the same question from noobs … but there it is. thanks in advance.

1 Like

The Problem here is that you seem to be using the HomeAssistant OS. This is a different operating system than what PiOS (basically just debian) uses.
You can try to see if its possible to install the drivers in this OS.

Otherwise, think about installing HomeAssistant Supervised on a Debian System or simply using HomeAssistant Core with an OS of your choice.

Personally I would prefer to take a fresh Raspberry Pi OS, and install HA and Rhasspy direct on it. I don’t know docker, and for me it just adds more complexity.

But I assume that HomeAssistantOS method is recommended for a reason (including better support), and that Rhasspy documentation also lists the HA Rhasspy add-on because it will work for the majority of cases.

So maybe the problem is that I am trying to add hardware to my HA server and do everything on one box ?

Exactly.
Home Assistant OS is there to make it easy to support the full Home Assistant Experience. But this also locks down what else you can do on this machine.

PiOS works for HomeAssistant as well, but the only OS currently officially supported for a supervised HA install would be Debian 10.

The Rhasspy Addon is working fine, but you currently do not get access to your Microphone.
For example, you could install the microphone on a second raspberry and connect this as a satellite to your HA Rhasspy instance. This HA Rhasspy would then be the master and take care of STT, Intent Handling etc. while the Satellite could simply be required for Wake Word Detection and Recording.

Its a bit confusing with docker as they are isolated containers you just have to share that device in the docker run and also any asound.conf files.

Such as a docker run like this that @KiboOst posted.

docker run -d -p 12101:12101 \
	--name rhasspy \
	--restart unless-stopped \
	-v "$HOME/.config/rhasspy/profiles:/profiles" \
	-v "/etc/localtime:/etc/localtime:ro" \
	-v "/etc/asound.conf:/etc/asound.conf" \
	--device /dev/snd:/dev/snd \
	--ipc="host" \
	rhasspy/rhasspy \
	--user-profiles /profiles \
	--profile fr

Another confusion is utils on the host are often used that have no effect on a isolated container which essentially is another instance.

docker exec -it <container_name> /bin/bash

Then your on the inside and then set things up

OK, it’s falling into place now. Thanks.

I thought having ReSpeaker, Rhasspy and Home Assistant on one machine would be more responsive than inter-machine communication … so tried to install Home Assistant Core onto Raspberry Pi OS. Yes, I know it says for experienced users only, so no surprise that the instructions given didn’t work when cut and pasted.

So … change to Rhasspy on one RasPi with ReSpeaker, and communicating with HA and Rhasspy on another RasPi.

I have installed Home assistant OS and Rhasspy add-on onto my RasPi4 and configured it.

For satellite use a RasPi 3B with desktop raspberry Pi OS.
Installation - Rhasspy indicates that a raspberry Pi 4 is arm64 - but this resulted in 9 unmet dependencies when I tried to install. Running the dpkg command indicates my RasPi is actually a “armhf” … and the correct .deb file does install. Suggest an update to the documentation.

On the subject of documentation, I suggest changing references to the seeed’s github repository to HinTak’s branch GitHub - HinTak/seeed-voicecard: This is an enhancement fork with the explicit aim of supporting current shipping Raspbian/Ubuntu kernels without requiring downgrading. Please donate at https://hintak.github.io/ if it works for you.

Also under Tutorials - Rhasspy the link in “If you’re running Rhasspy on a Raspberry Pi Zero, please follow these instructions instead.” points to localhost:

Rhasspy documentation is a little contradictory, on the subject of appropriate installation types.

I now understand that it is NOT practical to install a mic/sound card on the same physical machine with Home Assistant - unless one is an expert at docker.

And Rhasspy’s Tutorial for Base/Satellite is OK until you want to action the voice command which was entered - the tutorial doesn’t cover intents, and the reference manual has no example.

1 Like

Pi3 / Pi4 are Armv7/Armv8 just like X86 with Windows 32bit/64bit you downloaded the 32bit OS the 64bit is here https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2021-05-28/2021-05-07-raspios-buster-arm64-lite.zip

Sorry, i’m inexperienced user… so i’m basically folowing the differents tutorials (in order) :

  1. -install Debian Buster with Raspberry Pi Desktop from here https://www.raspberrypi.org/software/operating-systems/ and ther (tuto - french) Chapitre 3 : L'installation du Raspberry - Coxprod DIY
  2. -install respeaker 4mic hat GitHub - respeaker/seeed-voicecard: 2 Mic Hat, 4 Mic Array, 6-Mic Circular Array Kit, and 4-Mic Li, successfully tested
  3. -install Home Assistant supervised from here (tuto - “official”) https://peyanski.com/how-to-install-home-assistant-supervised-official-way/#Home_Assistant_Supervised_method, here (tuto - french) ✅ Installer Home Assistant sur RPi (ou autres SBC), Debian (Méthode Docker & Supervisor) - Installation - Home Assistant Communauté Francophone and there GitHub - home-assistant/supervised-installer: Installer for a generic Linux system
  4. -install Rhasspy add-on GitHub - synesthesiam/hassio-addons: My Hass.IO add-ons by adding the repos to the “3 points on the corner upper right” in the Home assistan add-on store

and like @donburch Audio input drop-down box contains only “default” and Audio Output drop-down contains “Default”
So, @rolyan_trauts , could you explained where should we run this docker command ? I used only script…

Sorry for this newbie’s questions… and thanks you for your help !

The docker command @rolyan_trauts mentions is one that runs rhasspy as its own service, not as a homeassistant addon. I could be wrong here, but I don’t think anyone was successful in using a respeaker mic together with the homeassistant addon. I myself use both rhasspy and homeassistant, but I don’t use the core version and the addon, I run both as separate services in docker.

From what I read in this thread, for some reason the rhasspy addon for homeassistant does not get access to the microphone and it was suggested to use a 2nd normal rhasspy instance for microphone input as a satellite.

Personally, since you said you were a beginner I would advise you to first read up on how docker works, and then run rhasspy as a normal docker container instead of an addon. As far as I know there is nothing gained from using the homeassistant addon aside from dodging the manual docker stuff and learning how to use docker is something that most ppl end up doing anyway once they start tinkering around with rhasspy more, I certainly did.

Docker itself can be a bit annoying when updating, since you have to actually shut down the old instance before starting the new and this is the problem most beginners run into with rhasspy docker. If you are willing to put a bit of work into it, I would suggest checking out docker-compose which is a service of sorts that manages docker containers that are specified in a file. Basically, the docker command mentioned above would go into a file for docker compose looking something like this:

version: "3.9"
services:
  rhasspy_2.5:
    container_name: rhasspy_2.5
    image: "rhasspy/rhasspy"
    restart: unless-stopped
    volumes:
        - ./rhasspy_2.5/profiles:/profiles
    ports:
        - "12101:12101"
    devices:
        - "/dev/snd:/dev/snd"
    command: --user-profiles /profiles --profile fr
    network_mode: host

and to update you would use docker-compose pull and docker-compose up -d and it will check for updates for all containers specified in the file and download them with the first command while the 2nd command will restart the containers so they are all up to date. I personally prefer it over docker just starting a 2nd container instead of updating the first and port conflicts if I didn’t remember to take the container down and having to do that manually for all 15 docker containers on 3 different pis. The “disadvantage” of docker-compose is, that most docker containers only specify the docker command and it takes a while to get used to translating those correctly to a docker-compose file.

I don’t have one perfect guide for you to follow, but I did find something that gives a pretty good overview over docker containers, how docker services work and even how to best manage multiple containers.

I only took a basic look at it, but this does look line it should be suitable for a beginner to understand. I would also offer a French one, but I am afraid my 3 years of French in school left me able to ask where the train station is in French but unable to understand any answer that isn’t just left or right, so I don’t think I could pick anything useful out.

Hopefully, this will help you out a bit
Daenara

Above all, thanks you very much pour your detailed explanation and your advices !

I didn’t understand that reSpeaker HAT is not suitable with rhasspy add-on (i mean, easily, for beginners). I tried two configurations :

  1. HA + Rhasspy add-on, but, now, i know it is over…
  2. docker HA + docker Rhasspy, as you suggest (i would try later docker compose, in a second step, when i will succesfully configure those two softwares…)

So, i’ll focus on the second point. Despite all the efforts and tuto, its uneasy to install “plug and play” those softs because all little errors are hard to solve (eg : not install wpa_supplicant.conf on your RPI before install HA (i configure my RPI from an other computer in command line and web UI for both Rhasspy and HA)).

Next step, struggling with integration, or try this (came yesterday, like a Christmas gift !):

https://community.rhasspy.org/t/how-im-integrating-between-rhasspy-and-home-assistant/3090

Thanks for the tuto about docker, it will really help me !

PS : I don’t know what is worst between your level after 3 years learning French, or my level In English after 10 years (as you can read :frowning: ) ! Most important, i understand what you’ve told !

My understanding (as a fairly new HA and Rhasspy user) is that the problem is the 3-way combination of HA OS, Rhasspy and ReSpeaker HAT all on one machine. I believe the documentation could be clearer … but the result of designing HA and Rhasspy to be extremely flexible and implemented in lots of different ways … is that no easy set of instructions will cover all possible situations.

HA OS with Rhasspy add-on works great … as the base station.
The problem with adding a respeaker to this is that HA OS does not allow users to add the respeaker driver; and without the driver, Rhasspy cannot see the respeaker.

I think you still have at least 2 options.

I personally had a second RasPi here, so installed Raspberry Pi OS, respeaker driver and Rhasspy (with or without Docker) on the second machine; and configured it as a satellite configuration. It works well.

I believe you can get an all-in-one solution - just not using the easy HA OS installation option.
Install respeaker driver onto Debian OS, then install HA and Rhasspy. As i understand it, you loose some of the HA features and ease-of-use … but you have more control and can give Rhasspy access to the respeaker driver.

I did not know HA had a problem with wpa_supplicant.conf, at least the docker version should not care about something like that since docker is in charge of networking for it. Personally, all my pis are connected via cable because there are tons of wifis around and not one of them works without problems, not even the one in the same room as my pis, cable is just more stable. Set the pi up, give it a static ip either on the pi directly or via the router and I am set for configuration.
If you run into any problems with rhasspy installation, try the search here and if it doesn’t already finds the solution, just ask, chances are, someone already ran into the problem and can help solve it, or you were the first to try a new docker image and one needed resource or file didn’t end up in the docker image which can happen sometimes, then you even found a relevant bug while at it. Rhasspy should work without problems with the command @rolyan_trauts provided.

Your English is way better than my French, I would struggle even formulating a simple question, I never kept up with the language and I just don’t know more than a few basic words. Last time I was in France I tried ordering a baguette in French and was laughed at for my try, so next time, I will just order in English or by pointing at what I want because my French is too bad to use.

I think its more than that. It is possible to install the HA Core on PiOS or Debian, but the addon loading system doesn’t seem to be capable to work with mics using the pi pins. My guess is, that it works fine with USB mics somehow, otherwise there wouldn’t be much point of using it at all in my opinion, but the respeaker specifically does not work with HA Core, regardless of HA OS or not, at least as far as I know.

Yeah, this is one solution, but personally, for the first tests, especially in a dev environment, this is a bit complicated to set up. From reading this forum it seems the tutorials most beginners struggle with are master/satellite configuration tutorials, so I would suggest not doing that until you are at least familiar with the rhasspy configuration gui.

This is completely possible and running beside me right now. I run on PiOS with a docker-compose setup of homeassistant, rhasspy, node-red, hermes-led-control and my self written rhasspy skills. While it is possible to directly integrate rhasspy and homeassistant with events/intents I use node-red to integrate the two, just because most often I have something more complicated than just turning on/off a light and I can’t get my head around homeassistants scripts and automations.

The ease of use lost for homeassistant is next to nothing, you only use access to the addons, and all they do is run a docker container for you automatically and expose the configuration file i the homeassistant gui. As soon as you know your way around docker, and optionally have something like docker-compose to make updating multiple containers easier, you have more options without the addon system. To top it all off, HA Core hoggs all audio devices, even on a PiOS or Debian install, so you have no chance to even play a sound with something that was not started by HA Core without shutting everything down. Especially bad if you are not planning to use it only as a backend server and do other stuff on the same device (I have a kodi media pi behind my tv that will soon learn how to reverse proxy http(s) in its spare time, no way I could use HA Core on that, HA Docker would work).

I did not know HA had a problem with wpa_supplicant.conf, at least the docker version should not care about something like that since docker is in charge of networking for it.

Due to the error message, I assume the problem gone from that (and after configuring HA without that file, everything goes right…) : I haven’t the landing page container.

Personally, all my pis are connected via cable because there are tons of wifis around and not one of them works without problems, not even the one in the same room as my pis, cable is just more stable.

I agree with you, but it’s just easier, in my home, to avoid cables :slight_smile: . No problem, I finally connect my Rpi via cable due to the problems in configuring HA…

If you run into any problems with rhasspy installation, try the search here and if it doesn’t already finds the solution, just ask, chances are, someone already ran into the problem and can help solve it, or you were the first to try a new docker image and one needed resource or file didn’t end up in the docker image which can happen sometimes, then you even found a relevant bug while at it. Rhasspy should work without problems with the command @rolyan_trauts provided.

The problem was with HA… Don’t worry abour Rhasspy !
Now, I 'll check if HA takes intents with REST API… api/intents seems to be no more supported. To be continued :slight_smile: :
https://developers.home-assistant.io/docs/api/rest/
https://rhasspy.readthedocs.io/en/latest/usage/#home-assistant