ReSpeaker 4 Mic Array on RaspberryPi 4 arecords, but doesn't listen ... to me

Hello all!

Strange one here. I’ve installed a ReSpeaker 4 Mic Array (v1) atop of a brand new Raspberry Pi 4 B (4gb) running Raspbian (Kernel v 5.4) following the instructions available here:

I can get all four channels record well and play back in Audacity. I can arecord hello.wav and play it back using aplay. I can even use the record.py script to generate an output.wav file and play it back with aplay. But that’s where the success ends and the weirdness takes over.

Once I sudo pip3 install pvrespeakerdemo and run picovoice_respeaker_demo, I get the ‘[Listening …]’ prompt but it won’t listen to me. However, it will listen to the YouTube video linked from the article.

In fact, it will run through the entire demo if I let it, with the unit on my desk doing exactly what’s happening in the video. Spooky.

Can anyone help me with this? I’ve been playing with it for two days unsuccessfully.

1 Like

I don’t have the solution to your problem but perhaps you might help solve mine since it appears to be closely related.
I also have a ReSpeaker 4-mic board on a new Pi4B, like you do.
I’m using SNOWBOY Hot Word detection software and the “demo.py” program.
It won’t respond when I have only the ReSpeaker active.
However, if I plug in my Logitech USB Microphone/Earpiece Headset unit, it then works very well.
I’m wondering if it is a matter of the default microphone being used by the ALSA/Pulse Audio software?
When I use arecord it works, but then I’m giving it the device (-Dac108)!
When I run the Snowboy demo “demo.py”, I only give it the Hot Word file Simon.pmdl that I created using Snow Boy’s web app. How does it know what microphone to use unless it’s programmed to use the default? That is why I’m focused on the default mic as the solution.
Funny thing is – it worked when I first installed it, but then it quit and I don’t know why or when.
This stuff is akin to Voodoo.
Do you know how to set the default mic in Raspbian?
Thanks
Ray

Hello All, I’m having the same issue with a respeaker 2 mic.
The picovoice respeaker demo only works on --audio_device_index 1 which is listening to audio from the rpi 4 headphone jack.
the mic hat is --audio_device_index 3 which generates the following error

Traceback (most recent call last):
File “/usr/local/bin/picovoice_respeaker_demo”, line 8, in
sys.exit(main())
File “/usr/local/lib/python3.9/dist-packages/pvrespeakerdemo/picovoice_demo.py”, line 144, in main
o.run()
File “/usr/local/lib/python3.9/dist-packages/pvrespeakerdemo/picovoice_demo.py”, line 106, in run
recorder = PvRecorder(device_index=self._device_index, frame_length=self._picovoice.frame_length)
File “/usr/local/lib/python3.9/dist-packages/pvrecorder/pvrecorder.py”, line 81, in init
raise self._PVRECORDER_STATUS_TO_EXCEPTION[status](“Failed to initialize pv_recorder.”)
ValueError: Failed to initialize pv_recorder.

I’ve tried various fixes e.g
:~/mic_hat $ amixer -c 2 cset numid=1 70%
numid=1,iface=MIXER,name=‘Capture Volume’
; type=INTEGER,access=rw—R–,values=2,min=0,max=63,step=0
: values=44,44
| dBscale-min=-17.25dB,step=0.75dB,mute=0
tingtong@hunphayon:~/mic_hat $ amixer -c 2 cset numid=3 on
numid=3,iface=MIXER,name=‘Capture Switch’
; type=BOOLEAN,access=rw------,values=2
: values=on,on

and can confirm audio can be recorded
~/mic_hat $ aplay -f cd -Dhw:1 output.wav
Playing WAVE ‘output.wav’ : Signed 16 bit Little Endian, Rate 16000 Hz, Stereo

To solve this puzzle i think i need to edit a config file in the demo to point the script to the respeaker mic inputs.
if someone could point me to where i should look it would be greatly appreciated.
I’m not sure that would be a final/default fix. ultimately I want the repeaker mic to be the default mic for the moment.