Snips Air - RPI 3b+ & Zero

Hi Everyone!

Have a few questions but really quick kudos to the Snips.ai team on an incredible product.

My question is a multipart but I would appreciate any help at all!

I’m running HASS on a RPI 3 b+ along side Snips.

I also have an RPI Zero with a Adafruit i2s Mems microphone connected.

I have setup the link between snips and Hass on the b+ to the best I can (most of the tuts all have different info/config). I am not able to get it working.

I have setup MQTT on hass as:
127.0.0.1
1883
As per snips setup guide.

I have then setup the i2s mems on the zero and can confirm it is recording sounds as expected.

I can not for the life of me get the zero to communicated or even recognise the wake word at all.

Can someone help me out with a setup guide or guidance. It would be greatly appreciated.

Cheers

Hello,

So you’re trying to get configure a satellite correct? Have you read that documentation https://snips.gitbook.io/documentation/installing-snips/multi-device-setup-satellites? Have you tried config A or B?

Hi @valf!

I am trying to set up both I guess.
I have already followed the doc you sent through, for configuration A.

Still can’t get it working for some reason. I have set up the i2s mems. Does this mic work with snips?

Regarding the mics I don’t know, if you can record things it should be working yes, check the asound.conf to see if its the correct audio card settings but I don’t think its coming from the mics since you can record audio with it

I will have another look at the asound file, see if it’s configured properly. It would obviously be different as the doc you sent is for the respeaker.

Regarding the MQTT. In Hass, I have set the following
MQTT:
Broker: 127.0.0.1
Port: 1883
This is correct?

I also noticed in the docs the hotword setup. Using config A, will the pi zero detect the hotword?

I have not set this up on either devices.

Best is to ask on the Home Assistant category then because I’m not used to it, it is not related to Snips.
Yes the Pi Zero would detect the hotword.

Hi Valf,

Just had another look and I can see that the i2s mems uses .asoundrc and there is no configuration in the asound.conf file for this microphone.

Could this be an issue?

This is my syslog

 Oct 16 03:00:25 raspberrypi snips-audio-server[700]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem

Oct 16 03:00:25 raspberrypi snips-audio-server[700]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem

Oct 16 03:00:25 raspberrypi snips-audio-server[700]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

Oct 16 03:00:25 raspberrypi snips-audio-server[700]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

Oct 16 03:00:25 raspberrypi snips-audio-server[700]: Cannot connect to server socket err = No such file or directory

Oct 16 03:00:25 raspberrypi snips-audio-server[700]: Cannot connect to server request channel

Oct 16 03:00:25 raspberrypi snips-audio-server[700]: jack server is not running or cannot be started

Oct 16 03:00:25 raspberrypi snips-audio-server[700]: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

Oct 16 03:00:25 raspberrypi snips-audio-server[700]: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

Oct 16 03:00:25 raspberrypi snips-audio-server[700]: INFO:snips_audio_portaudio: Use input device: "default"

Oct 16 03:00:52 raspberrypi systemd[1]: Started Session c7 of user pi.

This is my snips.toml on the MAIN unit

[snips-common]

# bus = "mqtt"

# mqtt = "localhost:1883"

# audio = ["+@mqtt"]

# assistant = "/usr/share/snips/assistant"

# user_dir = "/var/lib/snips"

## MQTT authentication

# mqtt_username = ""

# mqtt_password = ""

## MQTT TLS configuration

# mqtt_tls_hostname = ""

# mqtt_tls_disable_root_store = false

# mqtt_tls_cafile = ""

# mqtt_tls_capath = ""

# mqtt_tls_client_cert = ""

# mqtt_tls_client_key = ""

[snips-analytics]

[snips-asr]

# no_fst_map = true

# beam_size = 8

# model = "/usr/share/snips/asr"

# audio = ["+@mqtt"]

[snips-asr-google]

# credentials = "/usr/share/snips/googlecredentials.json"

# audio = ["+@mqtt"]

[snips-audio-server]

# frame = 256

bind = "main@mqtt"

# mike = "Built-in Microphone"

# disable_playback = false

[snips-dialogue]

# resources = "/usr/share/snips/dialogue"

# session_timeout = 15

# lambda_timeout = 5

# retry_count = 3

# sound_feedback_enabled_default = true

[snips-hotword]

# model = "/usr/share/snips/hotword"

# hotword_id = "default"

# sensitivity = "0.5"

audio = ["main@mqtt", "office@mqtt"]

[snips-nlu]

[snips-tts]

## Choose one tts provider (defaults to picotts)

# provider = "picotts"

# provider = "makerstts"

# provider = "customtts"

## customtts specific configuration (here configured to use picotts)

# customtts = { command = ["pico2wave", "-w", "%%OUTPUT_FILE%%", "-l", "%%LANG%$

And on the SATELLITE

[snips-common]

# bus = "mqtt"

 mqtt = "192.168.100.229:1883"

# audio = ["+@mqtt"]

# assistant = "/usr/share/snips/assistant"

# user_dir = "/var/lib/snips"

## MQTT authentication

# mqtt_username = ""

# mqtt_password = ""

## MQTT TLS configuration

# mqtt_tls_hostname = ""

# mqtt_tls_disable_root_store = false

# mqtt_tls_cafile = ""

# mqtt_tls_capath = ""

# mqtt_tls_client_cert = ""

# mqtt_tls_client_key = ""

[snips-analytics]

[snips-asr]

# no_fst_map = true

# beam_size = 8

# model = "/usr/share/snips/asr"

# audio = ["+@mqtt"]

[snips-asr-google]

# credentials = "/usr/share/snips/googlecredentials.json"

# audio = ["+@mqtt"]

[snips-audio-server]

# frame = 256

bind = "office@mqtt"

# mike = "Built-in Microphone"

# disable_playback = false

[snips-dialogue]

# resources = "/usr/share/snips/dialogue"

# session_timeout = 15

# lambda_timeout = 5

# retry_count = 3

# sound_feedback_enabled_default = true

[snips-hotword]

# model = "/usr/share/snips/hotword"

# hotword_id = "default"

# sensitivity = "0.5"

# audio = ["+@mqtt"]

[snips-nlu]

[snips-tts]

## Choose one tts provider (defaults to picotts)

# provider = "picotts"

# provider = "makerstts"

# provider = "customtts"

## customtts specific configuration (here configured to use picotts)

# customtts = { command = ["pico2wave", "-w", "%%OUTPUT_FILE%%", "-l", "%%LANG%$

From the provided info, it seems all correct. Could be from memes. So please follow these steps so that you are able to see more detailed logs:

1/ On master, run snips-watch -vvv, then try to trigger satellite. Paste the log here(If it can be triggered)
If it’s not possible to trigger:
2/ On satellite, run sudo systemctl stop snips-audio-server,
3/ Then run snips-audio-server -vvv , you will now see all the detailed output of the audio server on satellite.
4/ Try to trigger the satellite, get the output log.

Expect all of this, there are some tips to help:
A/ Before stop audio server, you can use systemctl status snips-audio-server on satellite to check if the audio server is running
B/ arecord -l command will list out all the record devices. Remember the devices number and card number of the one you are supposed to use. Then check the file nano /etc/asound.conf, if the record device is with the correct dev number and card number.

Hi @coorfang!

Thanks for the help.

Ran what you suggested.
Both WATCH commands through SAM and on the MAIN device stay stuck at,
“Watching on localhost:1883 (MQTT)”

The “snips-audio-server -vvv” command on the satellite device has output the following:
[10:26:52.323998] DEBUG: snips_common_cli::cli : conf lookup: snips-audio-server.frame -> Ok(None)

[10:26:52.326118] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.frame -> Ok(None)

[10:26:52.327119] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.hijack -> Ok(None)

[10:26:52.328194] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.hijack -> Ok(None)

[10:26:52.330209] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.nomike -> Ok(None)

[10:26:52.331893] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.nomike -> Ok(None)

[10:26:52.333573] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.mike -> Ok(None)

[10:26:52.335218] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.mike -> Ok(None)

[10:26:52.336603] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.bind -> Ok(Some("sat1@mqtt"))

[10:26:52.337548] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.bind -> Ok(Some("sat1@mqtt"))

[10:26:52.339618] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.bus -> Ok(None)

[10:26:52.340433] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.bus -> Ok(None)

[10:26:52.341176] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.mqtt -> Ok(None)

[10:26:52.341873] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.mqtt -> Ok(Some("192.168.100.229:1883"))

[10:29:53.129404] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.mqtt_username -> Ok(None)

[10:29:53.129725] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.mqtt_username -> Ok(None)

[10:29:53.129947] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.mqtt_password -> Ok(None)

[10:29:53.130143] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.mqtt_password -> Ok(None)

[10:29:53.130357] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.mqtt_tls_hostname -> Ok(None)

[10:29:53.130662] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.mqtt_tls_hostname -> Ok(None)

[10:29:53.232557] DEBUG: **snips_audio_server** : About to start audio main server on MQTT with site-id sat1

[10:29:53.234435] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.disable_playback -> Ok(None)

[10:29:53.236146] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.disable_playback -> Ok(None)

[10:29:53.240130] DEBUG: **snips_common_cli::cli** : conf lookup: snips-audio-server.output -> Ok(None)

[10:29:53.240453] DEBUG: **snips_common_cli::cli** : conf lookup: snips-common.output -> Ok(None)

[10:29:53.259159] DEBUG: **snips_broadcast_mqtt_server** : Audio reading started

[10:29:53.266597] DEBUG: **snips_audio_portaudio** : Attempt 0

[10:29:53.265930] DEBUG: **snips_broadcast_mqtt_server** : MQTT Audio forwarding thread started

[10:29:53.274457] DEBUG: **snips_audio_portaudio** : Mike source capture started

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

[10:29:53.371773] DEBUG: **snips_audio_portaudio** : Attempt 1

Cannot connect to server socket err = No such file or directory

Cannot connect to server request channel

jack server is not running or cannot be started

JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

[10:29:53.436699] DEBUG: **snips_audio_portaudio** : Portaudio: Ok("PortAudio V19.6.0-devel, revision 396fe4b6699ae929d3a685b3ef8a7e97396139a4")

[10:29:53.438050] DEBUG: **snips_audio_portaudio** : Looking for default input device

[10:29:53.439609] INFO : **snips_audio_portaudio** : Use input device: "default"

[10:29:53.446654] DEBUG: **snips_audio_portaudio** : Start capture: InputSettings { params: Parameters { device: Index(DeviceIndex(7)), channel_count: 1, suggested_latency: 0.005804988662131519, is_interleaved: true, sample_format: PhantomData }, sample_rate: 16000.0, frames_per_buffer: 256, flags: }

[10:29:53.456666] DEBUG: **snips_audio_portaudio** : start capture loop

[10:29:53.472642] DEBUG: **snips_audio_portaudio** : Attempt 2

[10:29:53.574077] DEBUG: **snips_audio_portaudio** : Attempt 3

[10:29:53.575026] DEBUG: **snips_audio_portaudio** : Mike initialization looking good 

Let me know if you need any more info to deduce a reason from.

Cheers

Looks like the audio server is in fault. I see “sat1@mqtt” that’s not how you declared it in your previous posts

I also see your network address being on 192.168.100.xx . You wanted it on layer 100? Or you’re on Cisco hardware?

What’s the content of your asound.conf?

Does “arecord test.wav” work? Can you play that said file with “aplay test.wav”?

I wiped and changed the config. The device name is now set as sat1 in both MAIN and SAT device.

I’m running a double router setup. I’m up in the mountains so no internet except 4g. Have a dongle connected to a tplink and then a faster dlink 2900 wired in. The only way the network works is if both are in dhcp mode. Wired, but it’s working.

Everything is connected to the dlink, so the local IP is 192.168.100.xx

asound file is good. Have checked that many times. Can record and playback by transfering from pi zero to Mac. Can confirm it is recording sounds.

We’ve been debugging my Snips install begining 2018 for about a week until we found out that yes, arecord was working as well as aplay was playing… But snips-audio-server was crashing when trying to use the configurations…

This is my asound.conf file

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

This was configured with the “Sam setup audio” command

Any ideas on what kind of dumb magic is not making everything work like the symphony it’s meant to be? Haha

This is wried, do you remember where you set this parameter?

Hi @coorfang!

Set it up in the snips.toml file on the satellite device.

I ahvejt keep this forum updated but I’ve been troubleshooting with @Psycho on this discord channel Support General.

I have come to think it’s the i2s MEMS and it’s configuration. While it works perfectly with the pi and arecord, snips just isn’t returning any mic test data.

Maybe there is a configuration in the capture device under asound.conf I could add to make it work, not sure.

You may have to have a quick read of the Adafruit i2s MEMS RPI setup guide to get an idea of the working configuration.

Any pointers?

I know this is old, but in case anyone finds this useful, I managed to get two MEMS mics working.

I also used the MAX98357 amp and dac with snips 0.63.2

The asound.conf file had to be modified after running config. Mine ended up looking like this:

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