Can't Detect Hotword


#1

Hello,

Update: I’ve verified that I can successfully detect hotwords using Snowboy but for some reason Snips isn’t working.

I have verified that I can record/playback correctly but I can’t get snips to detect “Hey Snips”. I’m getting some errors about PulseAudio: Unable to connect: Connection refused but I’m not sure if that’s important or how to fix it.

System: Raspberry Pi 3
Microphone: ReSpeaker 7 Mic Array

Result of aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  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
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: UAC20 [ReSpeaker MicArray UAC2.0], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Result of arecord -l

**** List of CAPTURE Hardware Devices ****
card 1: UAC20 [ReSpeaker MicArray UAC2.0], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

.asoundrc

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

ctl.!default {
  type hw
  card 1
}

Here are the logs I’m getting:

Running Snips
snips-asr-google is disabled
Spawning /usr/bin/snips-asr /usr/share/snips/asr --no_fst_map --beam_size=8 mqtt
Spawning /usr/bin/snips-audio-server mqtt --frame=256
Spawning /usr/bin/snips-tts mqtt
Spawning /usr/bin/snips-hotword /usr/share/snips/hotword/ mqtt
Spawning /usr/bin/snips-queries mqtt --assistant /opt/snips/config/assistant --user_directory /opt/snips/config
Spawning /usr/bin/snips-dialogue mqtt --assistant /opt/snips/config/assistant/assistant.json --config /usr/share/snips/dialogue --timeout 20
snips-analytics is disabled
snips-debug is disabled
[ ok ] Starting network daemon:: mosquitto.
2017-10-23 22:29:51,088 CRIT Supervisor running as root (no user in config file)
2017-10-23 22:29:51,105 INFO supervisord started with pid 55
2017-10-23 22:29:52,111 INFO spawned: 'snips-tts' with pid 58
2017-10-23 22:29:52,121 INFO spawned: 'snips-dialogue' with pid 59
2017-10-23 22:29:52,130 INFO spawned: 'snips-asr' with pid 60
2017-10-23 22:29:52,138 INFO spawned: 'snips-hotword' with pid 61
2017-10-23 22:29:52,146 INFO spawned: 'snips-audio-server' with pid 62
2017-10-23 22:29:52,156 INFO spawned: 'snips-queries' with pid 63
[22:29:52.458086] INFO :hermes::mqtt: Connecting to MQTT broker at address 127.0.0.1:1883
[22:29:52.529382] INFO :rumqtt::connection: $$$ Connected to broker
[22:29:52.540672] INFO :hermes::mqtt: Connecting to MQTT broker at address localhost:1883
[22:29:52.649712] INFO :rumqtt::connection: $$$ Connected to broker
[22:29:52.649969] INFO :snips_dialogue_hermes: Loading the configuration file
[22:29:52.747202] INFO :snips_dialogue_hermes::config: Loading language en
[22:29:52.834013] INFO :snips_dialogue_hermes        : Starting...
[22:29:53.764167] INFO :hermes::mqtt: Connecting to MQTT broker at address 127.0.0.1:1883
2017-10-23 22:29:53,809 INFO success: snips-tts entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-10-23 22:29:53,810 INFO success: snips-dialogue entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-10-23 22:29:53,812 INFO success: snips-asr entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-10-23 22:29:53,814 INFO success: snips-hotword entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-10-23 22:29:53,815 INFO success: snips-audio-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-10-23 22:29:53,818 INFO success: snips-queries entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[22:29:53.816919] INFO :rumqtt::connection: $$$ Connected to broker
[22:29:53.828970] INFO :queries_hermes    : loading model at path "/opt/snips/config/assistant"
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

[22:29:54.908035] INFO :snips_audio_portaudio: Use input device: "default"
[22:29:55.011212] INFO :hermes::mqtt         : Connecting to MQTT broker at address 127.0.0.1:1883
[22:29:55.033118] INFO :rumqtt::connection   : $$$ Connected to broker
[22:29:55.568705] INFO :hermes::mqtt: Connecting to MQTT broker at address localhost:1883
[22:29:55.587553] INFO :rumqtt::connection: $$$ Connected to broker
[22:29:57.800758] INFO :queries_hermes    : model loaded in 3971 ms
[22:29:57.814132] INFO :queries_hermes    : Idle
[22:30:12.960502] INFO :snips_dialogue_hermes::dialogue: Timeout is reached. Going to Idle mode
snips_stt --use-energy=false --num-mel-bins=40 --num-ceps=40 --low-freq=20 --high-freq=-400 --sample-frequency=16000
[22:30:22.101375] INFO :hermes::mqtt: Connecting to MQTT broker at address 127.0.0.1:1883
[22:30:22.109640] INFO :rumqtt::connection: $$$ Connected to broker
[22:30:22.137739] INFO :snips_asr_hermes  : Idle
[22:30:32.960531] INFO :snips_dialogue_hermes::dialogue: Timeout is reached. Going to Idle mode

#2

Hi !

How did you manage to fix your problem ?
I have the same issue.

Thanks a lot :slight_smile:


#3

Hi Maureen,

I had an issue with the boot order of the sounds cards (on board vs usb). I had to add this config file:

/etc/modprobe.d/alsa-base.conf

# This sets the index value of the cards but doesn't reorder.
options snd_usb_audio index=0
options snd_bcm2835 index=1

# Does the reordering.
options snd slots=snd_usb_audio,snd_bcm2835

Then i changed my .asoundrc to:

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

Hope it helps


#5

Hi ! Thank you for your answer

I tried again this morning typing “snips” and it worked like a dream.
I then changed a bit of the Python handler to have it do what I want. But all of a sudden it doesn’t work anymore and I get the same connection problem as before…

I tried what you gave me but it didn’t change anything.
It’s really weird it’s randomly working and then not working…

Please help :slight_smile:


#6

did you reboot? after changing the alsa config u have to reboot the pi.


#7

Yes I have !

I still have the “PulseAudio : Unable to connect” error.
And with those changes I can’t do arecord anymore (audio open error : No such file or directory).

If I just change in .asoundrc the hw of the capture to : hw:0,0 (corresponding to USB Advanced Audio Device) (instead of your 1,0)
then arecord works fine, but I still have the “PulseAudio : Unable to connect” error when trying snips.


#8

I am using a USB sound card and a random microphone plugged on the jack of the sound card.
Is it possibe that these devices are not compatible with snips ?
Looking through the posts I saw that it was working with a PS3 eye camera. Should I maybe get this ?

What’s weird is that it worked for like 10 minutes this morning before going back to the same exact error !

Thanks a lot !


#9

if it was working, then maybe your mic is the culprit. i would try a new
mic.


#10

Ok I’ll try that and keep you up to date
Thanks for your answers !


#11

Hey !
It works fine now that I bought the recommended microphone and speakers !
Thanks again