Respeaker 4 mic hat instructions do not work

#1

Hi all,

I have the respeaker 4 hat on a raspberry pi 3b+ with the newest raspbian image.

I have carefully followed the instruction on Seeeds forum page (as linked from the the product page). I have the leds workings with pixels_demo.py, and can record with arecord and play back with aplay.

However kws_doa.py does not work (from the 4mics_hat library)

(env) pi@pistt:~/4mics_hat $ python kws_doa.py
[‘arecord’, ‘-t’, ‘raw’, ‘-f’, ‘S16_LE’, ‘-c’, ‘4’, ‘-r’, ‘16000’, ‘-D’, ‘default’, ‘-q’]
arecord: main:788: audio open error: No such file or directory

I have tried other options but nothing seems capable of listening to the 4 mic hat for input correctly for speech recognition.

Typing arecord -L yields

(env) pi@pistt:~/4mics_hat $ arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
playback
ac108
default
sysdefault:CARD=seeed4micvoicec
seeed-4mic-voicecard,
Default Audio Device
dmix:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard,
Direct sample mixing device
dsnoop:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard,
Direct sample snooping device
hw:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard,
Direct hardware device without any conversions
plughw:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard,
Hardware device with all software conversions

Is there something wrong with the setup?

I have spent some 6 or 7 hours trying to get ANYTHING to respond to voice in any way without any result. I am tearing my hair out - any one any help???

This hat seems not only a bad design (does NOT sit on the pi without running fowl of the of the camera connector) but the instructions simply do not work. This is not usually the type of software support you get with products from pimoroni.

thanks

Shifters

#2

Not the type of software support, because it’s not a Pimoroni product!

You may have some luck on the seeed studio forum: https://forum.seeedstudio.com

#3

Pimoroni may not manufacturer it but they do sell it so some support in actually getting the product to work at all would be appreciated!

#4

Hi all,

ok this is how i got the hat to work with snowboy:

Follow the seeed instruction to install the driver (and test with audacity).

git clone https://github.com/respeaker/seeed-voicecard.git
cd seeed-voicecard/
sudo ./install.sh
sudo reboot

sudo apt-get update
sudo apt-get upgrade
sudo apt-get upgrade --fix-missing
arecord -L
aplay -L
arecord -l
arecord -Dac108 -f S32_LE -r 16000 -c 4 hello.wav
ls

there should be a hello.wav which should play.

git clone https://github.com/respeaker/4mics_hat.git
pip3 install spidev gpiozero
ls
cd 4mics_hat/
ls
python3 pixels_demo.py

I used python3 and no virtual env. The leds should flash.

sudo apt-get install python-pyaudio python3-pyaudio sox
sudo apt-get install python3 python3-all-dev python3-pip build-essential swig git libpulse-dev
sudo apt-get install portaudio19-dev
sudo apt-get install libatlas-base-dev

pip3 install pyaudio

#5

Change your ~/.asoundrc file i.e. nano ~/.asoundrc

pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm “hw:0,0”
}
capture.pcm {
type plug
slave.pcm “hw:1,0”
}
}

rec t.wav

The following should show that it can hear you through the hat microphones.

Now get snowboy:

wget https://github.com/Kitt-AI/snowboy/archive/master.zip

unzip the file with unzip

cd into snowboy_master and go into swig/Python3

type make

cd …/…/examples/Python3

edit the snowboydecoder.py line 5 from

from . import snowboydetect

to

import snowboydetect

You now need to generate the model for your watch/trigger word, and this is the best bit of snowboy - you can do it on their website for free and it gives you the model to download and it seems to work really well!!!

The URL is https://snowboy.kitt.ai/

Create a login and record your model directly onto the website and then download it to your examples/Python3 folder.

type python3 demo4.py your_model.pmdl

Speak your alert word and it will trigger - what you say next goes to google to translate into text.

I hope all those steps are clear - they are reconstructed from the bash history that i used.