alexa-pi / AlexaPi

Alexa client for all your devices! # No active development. PRs welcome # consider https://github.com/respeaker/avs instead
MIT License
1.33k stars 396 forks source link

AlexaPi - not picking up wakeword #451

Open SmakyTaky opened 5 years ago

SmakyTaky commented 5 years ago

I have installed Raspbian Stretch on a Rasberry Pi 3+ with MagicMirror with the MMM-AlexaPi module installed and configured.

AlexaPi was installed to communicate with MagicMirror. I followed AlexaPi documentation to get it installed, I configured pulse audio to run in system-wide mode.

Whenever I boot the system I get Magic Mirror to load properly followed by "hello" on the speakers signaling AlexaPi is working. Logfile for both MagicMirror & AlexaPi shows no communication errors.

However, I am unable to have AlexaPi to react to the keyword "Alexa" and something I noticed is that Alexa would from time to time "wake up" reacting to my voice randomly and even responding to me stating it could not understand me.

Debugging Script output

AlexaPi log...

mar 26 17:01:04 RasPiSMirror systemd[1]: Started Alexa client for all your devices.
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.front.0:CARD=0'
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround40.0:CARD=0'
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround71.0:CARD=0'
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
mar 26 17:01:08 RasPiSMirror python3[26796]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
mar 26 17:01:08 RasPiSMirror python3[26796]: connect(2) call to /tmp/jack-999/default/jack_0 failed (err=No such file or directory)
mar 26 17:01:08 RasPiSMirror python3[26796]: attempt to connect to server failed
mar 26 17:01:09 RasPiSMirror python3[26796]: INFO: Magic Mirror HTTP Server - :5055
mar 26 17:01:09 RasPiSMirror python3[26796]: INFO: Checking Internet Connection ...
mar 26 17:01:09 RasPiSMirror python3[26796]: INFO: Connection OK
mar 26 17:01:09 RasPiSMirror python3[26796]: INFO: AVS token: Requesting a new one
mar 26 17:01:10 RasPiSMirror python3[26796]: INFO: AVS token: Obtained successfully
mar 26 17:10:42 RasPiSMirror python3[26796]: INFO: Triggered: pocketsphinx
mar 26 17:11:03 RasPiSMirror python3[26796]: INFO: Triggered: pocketsphinx
mar 26 17:23:30 RasPiSMirror python3[26796]: INFO: Triggered: pocketsphinx
mar 26 17:24:01 RasPiSMirror python3[26796]: INFO: Triggered: pocketsphinx
mar 26 17:25:36 RasPiSMirror python3[26796]: INFO: Triggered: pocketsphinx

MagicMirror Log:

Starting MagicMirror: v2.6.0
Loading config ...
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
No helper found for module: worldclock.
Initializing new module helper ...
Module helper loaded: calendar
No helper found for module: compliments.
No helper found for module: currentweather.
No helper found for module: weatherforecast.
Initializing new module helper ...
Module helper loaded: newsfeed
Initializing new module helper ...
Module helper loaded: MMM-NowPlayingOnSpotify
No helper found for module: MMM-Scrobbler.
Initializing new module helper ...
Module helper loaded: MMM-GoogleMapsTraffic
Initializing new module helper ...
Module helper loaded: MMM-MyCommute
Initializing new module helper ...
Module helper loaded: stocks
Initializing new module helper ...
Module helper loaded: MMM-Remote-Control
Initializing new module helper ...
Module helper loaded: MMM-AlexaPi
Initializing new module helper ...
Module helper loaded: MMM-Volume
All module helpers loaded.
Starting server on port 8080 ... 
Server started ...
Connecting socket for: updatenotification
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Connecting socket for: MMM-NowPlayingOnSpotify
Connecting socket for: MMM-GoogleMapsTraffic
Starting node_helper for module: MMM-GoogleMapsTraffic
Connecting socket for: MMM-MyCommute
====================== Starting node_helper for module [MMM-MyCommute]
Connecting socket for: stocks
stocks helper started ...
Connecting socket for: MMM-Remote-Control
Starting node helper for: MMM-Remote-Control
Connecting socket for: MMM-AlexaPi
Starting node helper for: MMM-AlexaPi
Connecting socket for: MMM-Volume
Sockets connected & modules started ...
Launching application.

Looking at tmp/AlexaPi-runtime-rcwjzbjp (the only path that exists for AlexaPi right now) I noticed a single mp3 file created there.. however trying to play with

aplay -r 16000 -f S16_LE -D hw:0,0 b71506d672a260f13e757f00fa63fbc1.mp3

would yield a high pitch 1 sec or so sound.. no actual recording of anything I might have said that triggered pocketsphinx to identify a "wakeword".

Not sure where to go from here. As it seems AlexaPi is configured and managing sound properly (I can manually play and record sound using the above configuration - Speaker through jack & USB Microphone). Magic Mirror does connect to AlexaPi as there are not connection errors recorded but it seems AlexaPi is not either recording properly the sound or simply failing to recognize the wakeword.

SmakyTaky commented 5 years ago

I just noticed the mp3 file is actually something that got recorded from what AlexaPi actually responded. Probably I should try some other paramters for aplay to play it properly.

b71506d672a260f13e757f00fa63fbc1.zip

However, again the odd thing here is that AlexaPi is randomly picking sound while I am talking and responded... and seems to me it is even taking that as actual input for it.

SmakyTaky commented 5 years ago

Anyone?

EmerickH commented 5 years ago

Hello, Your audio is not well configured (for audio output at least), please follow: https://emerickh.github.io/AlexaPi-config/setup/alsa.html

SmakyTaky commented 5 years ago

Your audio is not well configured (for audio output at least), please follow: https://emerickh.github.io/AlexaPi-config/setup/alsa.html

Well... not sure about that... I did modify the config.yaml file with:

input_device: "CMTECK MINI: USB Audio (plughw:1,0)" output: "alsa" output_device: "plughw:CARD=ALSA,DEV=0"

and I can clearly hear alexa saying "hello". It is the recording that seems not to be working properly,

SmakyTaky commented 5 years ago

There are a few folders under tmp named AlexaPi-runtime-something but none of them have any files under them.

EmerickH commented 5 years ago

Are you on a RPI Zero? They have the same issue here https://github.com/Kitt-AI/snowboy/issues/430 Try using PulseAudio: https://emerickh.github.io/AlexaPi-config/setup/pulse.html (you may have to run it in system-wide mode)