ReSpeaker 4-Mic Array, with Raspberry Pi 3B+

Hi there!

I’m a senior H/W engineer, but totally new to S/W stuffs!

I’m going to create a Home Automation project with ReSpeaker 4-Mic Array & Raspberry Pi 3B+, and experienced a major problem can’t be solved yet.

I followed the steps from : <LINK_TEXT text=“http://wiki.seeedstudio.com/ReSpeaker_4 … pberry_Pi/”>http://wiki.seeedstudio.com/ReSpeaker_4_Mic_Array_for_Raspberry_Pi/</LINK_TEXT> .

The Audacity and “pixels_demo.py” worked fine.

However, the " kws_doa.py" had NO response!



My pi’s response to “arecord -L”:

pi@raspberrypi:~/seeed-voicecard $ arecord -L

null

Discard all samples (playback) or generate zero samples (capture)

default

playback

ac108

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

pi@raspberrypi:~/seeed-voicecard $



It seems lack of “capture”, “dmixed” & “array”. Does this matter?



And after runing “kws_doa.py”, the Audacity recording responsed “Device Busy”. Looks the MIC resource was occupied. And I have to reboot to fix it.



Thank you for any comment & help!!



By the way, I ignored that problem and went next kws_doa.py demo. This was its response:

(env) pi@raspberrypi:~/4mics_hat $ python kws_doa.py

[‘arecord’, ‘-t’, ‘raw’, ‘-f’, ‘S16_LE’, ‘-c’, ‘4’, ‘-r’, ‘16000’, ‘-D’, ‘default’, ‘-q’]

Hi there,



it does not matter about the “capture” text.



when you run the kws_doa.py, please say “snowboy” and you will get the direction. thanks.



(env) pi@raspberrypi:~/4mics_hat $ python kws_doa.py

[‘arecord’, ‘-t’, ‘raw’, ‘-f’, ‘S16_LE’, ‘-c’, ‘4’, ‘-r’, ‘16000’, ‘-D’, ‘default’, ‘-q’]

detected 1 at direction 225.209292078

detected 1 at direction 225.209292078

detected 1 at direction 225.209292078

Dear Mr. Yu,

Thanks for your reply!

I think I did follow the steps to install them.



The following works GOOD:

arecord -Dac108 -f S32_LE -r 16000 -c 4 hello.wav

aplay hello.wav



Here’s the response:

(env) pi@raspberrypi:~/voice-engine $ cd ~/4mics_hat

(env) pi@raspberrypi:~/4mics_hat $ python kws_doa.py

[‘arecord’, ‘-t’, ‘raw’, ‘-f’, ‘S16_LE’, ‘-c’, ‘4’, ‘-r’, ‘16000’, ‘-D’, ‘default’, ‘-q’]



There’s still no response to “snowboy”!

Should I check anything else?

Thanks!!

Hi there,



Please try to play the snowboy audio file and see if it can detect it. thanks.



<LINK_TEXT text=“https://github.com/SeeedDocument/forum_ … nowboy.wav”>https://github.com/SeeedDocument/forum_doc/raw/master/reg/snowboy.wav</LINK_TEXT>

Dear Mr. yu,

It works with your WAV file! Now, I can go further and explore more.

Thank you very much for your support!!

Dear Mr. Yu,

I went further with running “python ns_kws_doa_alexa_with_light.py” and got “avs.alexa:status code: 204”. After saying “snowboy”, it jumped out of a lot of DEBUG message. Then I asked “who are you?”, the LEDs and console seemed response to the word. However, I did NOT hear any thing from speaker!

I’m 100% sure the speaker is OK, by playing “snowboy.wav”. And the Internet connection is OK, too.

Should I hear Alexa talk from the speaker?

Thanks for your support!!

Hi there,



We have 3 players (mpv, mpg123 and gstreamer) to use. SpeechSynthesizer and Alerts prefer mpg123 which is more responsive. AudioPlayer likes gstreamer > mpv > mpg123. Gstreamer supports more audio format and works well on raspberry pi. We can also specify the player of AudioPlayer using the environment variable PLAYER. So please try below commands to enable the voice. thanks.



sudo apt install mpg123

PLAYER=mpg123 python ns_kws_doa_alexa_with_light.py