[SOLVED] Mic Array Not Working

#1

Hello, newb here. I have been playing with the matrix creator the last few days. I was able to get everloop working but I have not been able to get the mics working.

I essentially tried to do two things :
https://matrix-io.github.io/matrix-documentation/matrix-creator/resources/microphone/
and

Here is my creator state running malos

Here are my two devices in the alasmixer


When I run the below command I hear nothing back
arecord recording.wav -f S16_LE -r 16000 -d 5 aplay recording.wav
When I run the below command I do hear audio output. This leads me to believe that the issue isn’t on the output but on the input.
sudo aplay /usr/share/sounds/alsa/Front_Center.wav

On the snips side when I run “sam test speaker” I hear the output
When I run “sam test microphone” I don’t hear anything on the playback after talking to it.
When I run “sam status” one thing I do notice is that snips-audio-server and snips-analytics are shown as “not running” while everything else is “running”

Any help is greatly appreciated. My goal is to get the audio working and then move on to the camera next.

#2

Can you post the out of aplay -l and arecord -l?

1 Like
#3

Thanks for reply. Below are the outputs

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7

pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7

#4

ok, that shows no Matrix output and input device.
Did you follow step 1 from here?: https://www.hackster.io/matrix-labs/matrix-voice-and-matrix-creator-running-snips-ai-b48344

Basically do on the Pi:

curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
echo “deb https://apt.matrix.one/raspbian $(lsb_release -sc) main” | sudo tee /etc/apt/sources.list.d/matrixlabs.list
sudo apt-get update
sudo apt-get upgrade
sudo reboot

And after that:

sudo apt install matrixio-kernel-modules
sudo reboot

Please do those steps and then post aplay -l and arecord -l again :slight_smile:

#5

I thought I had ran those commands but I must not have. Now when I run sudo apt-get update I get this message
E: Type ‘“deb’ is not known on line 1 in source list /etc/apt/sources.list.d/matrixlabs.list
E: The list of sources could not be read.

In that file the contents are
“deb https://apt.matrix.one/raspbian stretch main”

I was trying to determine the issue and was reading online that the quotes could cause this. Any idea on this? I can’t seem to edit that file though. I tried running gksudo gedit /etc/apt/sources.list.d/matrixlabs.list but nothing happens.

#6

@dwoods,

This likely happened because you copy pasted all of what Rom said at once. Try this part first:

curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list
sudo apt-get update
sudo apt-get upgrade 

Then reboot
sudo reboot

Then install the kernel modules.

I replicated the issue and this solved it for me after a reboot. This happens because upgrade needs user input of y/n and if you have input after that it is unable to complete.

Let us know if that helps.

#7

doh! That fixed it.

thanks a ton

#8

After running the commands here is the latest output from aplay and arecord. I still don’t seem to be getting anything recorded.

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7

pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7

#9

Did you install the kernel modules?

Run
sudo apt install matrixio-kernel-modules

Then separately
sudo reboot

#10

I did. I actually ran through that whole process again twice now.
Now when I run
amixer set PCM 100% && arecord recording.wav -f S16_LE -r 16000 -d 5 && aplay recording.wav

I get this message
amixer: Unable to find simple control ‘PCM’,0

When I run sudo apt-get upgrade it did not require user input y/n like Samreen mentioned in her post.
Also when i run the kernel install it states 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded

#11

Any other possible ideas on what I could be doing wrong here? I’ve got the video working well now so my only hold up for my project currently is this mic issue.

#12

Hey @dwoods,

It would be good to know some more info so we can focus our troubleshooting.

  • What is your Raspberry Pi’s model?
  • What OS are you using (Raspbian Stretch Lite/Desktop, etc)?

Can you post the output of the following commands?

This command lists all the loaded kernel modules with matrix in their names.

lsmod | grep matrix

This command lists all the installed packages with matrix in their name, and the status of the install.

dpkg -l | grep matrix

#13

Thanks for the help

Model : 3b+
OS : Raspbian GNU/Linux 9 (stretch)

lsmod | grep matrix
this command returns nothing which confuses me. I have run the kernel install multiple times.

dpkg -l | grep matrix
ii libmatrixio-creator-hal:armhf 0.3.7 armhf Hardware Abstraction Layer for MATRIX.
ii libmatrixio-creator-hal-dev 0.3.7 armhf Hardware Abstraction Layer for MATRIX (headers)
ii libmatrixio-malos:armhf 0.1.3 armhf Libraries of MATRIX abstraction layer for MOS
ii libmatrixio-protos:armhf 0.1.5 armhf Protocolbuffers for MATRIX abstraction layer
ii libswresample-dev:armhf 7:3.2.12-1~deb9u1+rpt1 armhf FFmpeg library for audio resampling, rematrixing etc. - development files
ii libswresample2:armhf 7:3.2.12-1~deb9u1+rpt1 armhf FFmpeg library for audio resampling, rematrixing etc. - runtime files
ii matrixio-creator-init 0.4.13 armhf Install scripts that can program the MATRIX Creator FPGA and SAM3 IMU.
ii matrixio-kernel-modules 0.1.4 armhf Install kernel modules for MATRIX devices.
ii matrixio-malos 0.3.5 armhf Allows queries to MATRIX Creator hardware via ZMQ.
ii matrixio-openocd 1.0.1 armhf Open on-chip JTAG debug solution for ARM and MIPS systems
ii matrixio-protobuf 3.5.0 armhf Protocol Buffers - Google’s data interchange format. (From GRPC 3.5.0)
ii matrixio-xc3sprog 1.1.1 armhf Spartan3, XCF and CPLD JTAG programmer and other utilities.

#14

@dwoods,

This is pretty unusual. You have all the initialization packages and kernel modules installed, yet the kernel modules haven’t been loaded.

Could you navigate to the following folder:

sudo nano /boot/config.txt

Scroll down to the bottom and check if the following line is there. If not, please add it.

dtoverlay=matrixio

Then reboot your device. This allows and activates the MATRIXIO Kernel modules.

#15

It was there already.

2019-04-18-130356_1600x1200_scrot

#16

Hi @dwoods,

Your issue is an uncommon one, so there are a couple of options to pinpoint where the problem is.

Do you have an extra microSD card (or is it okay for you to start over on your current one) so you can start from scratch just to purely test the mics without any additional configurations? In this case, I would ask you to just install the matrix packages & kernel modules on a fresh Raspbian Stretch install, then test the mics. So, follow this guide that you had mentioned earlier exactly.

This would give us a base point to troubleshoot the mic issue without the chance of camera packages or other settings interfering.

If it is not feasible for you to do so, I can try to replicate your issue, troubleshoot from here, and let you know what I come up with. In that case, it would be best if you could tell me exactly the sequence of steps that you took, what camera you are using, and what packages you installed for it/configurations you changed.

Let me know what works for you.

Best,
Samreen

#17

I think I can play with a new sd card and try that. It may take me a bit as I didn’t have to install this from scratch on arrival. We ordered the matrix creator cv kit so the pi came already flashed and setup.

For me, the first thing I did was https://matrix-io.github.io/matrix-documentation/matrix-hal/getting-started/installation-package/
Then I moved to matrix lite https://matrix-io.github.io/matrix-documentation/matrix-lite/installation/
Then I watched this and ran these commands : https://www.youtube.com/watch?v=Wqyt8hM3sHs

Then I ran https://matrix-io.github.io/matrix-documentation/matrix-lite/reference/everloop/
Then I moved to the microphone https://matrix-io.github.io/matrix-documentation/matrix-creator/resources/microphone/

#18

@dwoods,

That’s interesting. The MATRIX Creator CV kit comes with MATRIX HAL, MATRIX Core, and if you got the kit within the past two weeks, MATRIX Lite JS already installed. If you go to the Desktop, there should be folders with example programs for each library layer. The kernel modules should also be installed, so arecord and the MATRIX HAL mic examples should work out of the box.

The video with the steps that you referenced are for MOS installation which is deprecated. So, while it’s not supposed to happen, maybe it configured something which messed with the kernel modules.

I think starting from scratch is the best option. Not sure if you need any help there, but you can follow this guide we have to flash and setup your SD card.

Let us know how it goes!

Best,
Samreen

#19

@dwoods,

Here is the current kit image that we flash on the MATRIX Creator CV Kit. So, all you would have to do is flash this image, and run the following to check if the mics work.

arecord -f S16_LE recording.wav
aplay recording.wav

Hope this helps!

Best,
Samreen

#20

Wow. Thanks! I really appreciate the help.

I will give this a go tomorrow.

1 Like