snips-sam
Version:
The Snips Assistant Manager
100 lines (70 loc) • 3.23 kB
Markdown
---
layout: article
title: "ReSpeaker 7-Mic Array"
permalink: /articles/microphones/respeaker7/
toc: Automatic setup using Sam|Manual setup
---
The [ReSpeaker 7-Mic Array](https://www.seeedstudio.com/ReSpeaker-Mic-Array-Far-field-w%2F-7-PDM-Microphones-p-2719.html) is a microphone array designed for prototyping. It features an XMOS XVSM-2000 DSP chip, providing excellent performance for ASR and wakework detection even in a noisy setting.
It has a small, convenient size factor, and as a bonus, it features a led ring. Furthermore, both microphone and leds can be accessed with a single USB cable, rather than through GPIO ports. This allows for more versatile configurations, and reduces the amount of space required.
# Automatic setup using Sam
Sam allows your to easily set up a microphone via a command-line wizard. Simply run:
```sh
$ sam setup microphone respeaker7
```
which will guide you through the set up. It will also set up the required drivers for having leds working.
# Manual setup
If you don't want to use Sam, you can setup the ReSpeaker the manual way. The ReSpeaker features both a microphone array and a led ring, both of which require manual setup.
## Microphone
First, check that the ReSpeaker is correctly detected as a recording device:
```sh
$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Array [ReSpeaker Microphone Array], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
```
In this example, the ReSpeaker is identified as card 1 and device 0.
To tell Snips to use this device for recording, edit your `/etc/asound.conf` file, or create it if it does not exist, and add or modify the `capture.pcm` section:
```ini
pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm "hw:0,0"
}
capture.pcm {
type dsnoop
ipc_key 5432
slave {
pcm "hw:1,0"
buffer_size 96000
}
}
}
```
Note: the `playback.pcm` is shown here for convenience as it corresponds to using the default Raspberry Pi jack output for audio playback. If your setup is different, this section may also be.
The important part is `hw:1,0`. Change this to match your card and device IDs respectively, if they differ in the above output for `aplay` and `arecord`.
## Leds
The ReSpeaker leds requires `libusb` which allows you to fully manipulate the leds over USB.
First, obtain the device vendor ID and product ID using the `lsusb` command:
```sh
$ lsusb
Bus 001 Device 005: ID 2886:0007
...
```
The last two colon-separated numbers, `2886` and `0007` correspond to the vendor and product IDs.
Now, add the following line to `/lib/udev/rules.d/50-rspk.rules` (requires root privileges):
```
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="VENDOR_ID", ATTRS{idProduct}=="PRODUCT_ID", MODE="660", GROUP="plugdev"
```
making sure to replace `VENDOR_ID` and `PRODUCT_ID` with the values provided by the above `lsusb` command.
Now, add the username `pi` to the `plugdev` group:
```sh
$ sudo adduser pi plugdev
```
Next, force the `udev` system to see the changes:
```sh
$ sudo udevadm control --reload
$ sudo udevadm trigger
```
Finally, reboot the device, and you are all set.