Picroft not responding to wake word

Hi,

I’m running the latest stable Picroft image (2018-03-14) from the download page on a Raspberry Pi 3 Model B (not B+) with a USB mic and 3.5mm output. I can’t get Mycroft to respond to ‘Hey Mycroft’.

If I pacmd set-default-source 1 and arecord -f S16_LE -r 16000 -d 5 test.wav then I can play back the file successfully.

Incidentally the output from pacmd list-sources (and therefore occasionally the device index) sometimes changes after reboot. Is there any other way of specifying a device?

I’ve noticed in the logs that /home/pi/.mycroft/mycroft.conf isn’t loaded so I’ve symlinked /home/mycroft/.mycroft/mycroft.conf there. Should I just edit /home/mycroft/.mycroft/mycroft.conf instead? This isn’t clear in the Picroft audio troubleshooting documentation, which just says to edit ~/.mycroft/mycroft.conf without specifying which user’s home directory ~ refers to. I have the following in /home/mycroft/.mycroft/mycroft.conf:

{
  "listener": {
    "device_index": 1
  }
}

I also seem to have an issue with the venv not being activated at boot. Is this normal on Picroft? I couldn’t find any documentation about this. On login, I get the following (note the ImportError):

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Aug 16 10:34:59 2018
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named mycroft.version

***********************************************************************
** Picroft enclosure platform version: 2018-03-14
**
***********************************************************************
This image is designed to make getting started with Mycroft easy.  It
is pre-configured for a Raspberry Pi that has a speaker or headphones
plugged in to the Pi's headphone jack, and a USB microphone.
***********************************************************************

I can run test_microphone and hear the sound I’ve recorded but only once I’ve activated the venv. (This isn’t obvious from the welcome information at login.) I’m also getting lots of ALSA errors:

pi@picroft:~ $ test_microphone
Shutting down mycroft...
Starting a 5 second test recording...
/home/pi/bin/test_microphone: line 8: mycroft-audio-test: command not found
Playing back the recording...
Restarting mycroft...
pi@picroft:~ $ source /opt/venvs/mycroft-core/bin/activate
(mycroft-core) pi@picroft:~ $ test_microphone
Shutting down mycroft...
Starting a 5 second test recording...
 ===========================================================
 ==         STARTING TO RECORD, MAKE SOME NOISE!          ==
 ===========================================================
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 pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
 ===========================================================
 ==           DONE RECORDING, PLAYING BACK...             ==
 ===========================================================
10:32:05.006 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/configuration/mycroft.conf loaded
10:32:05.015 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/configuration/mycroft.conf loaded
10:32:05.021 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded
10:32:05.027 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/pi/.mycroft/mycroft.conf loaded
10:32:05.044 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
10:32:05.545 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/ HTTP/1.1" 301 106
10:32:05.553 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): api.mycroft.ai:80
10:32:05.742 - urllib3.connectionpool - DEBUG - http://api.mycroft.ai:80 "GET /v1/device HTTP/1.1" 302 0
10:32:05.750 - urllib3.connectionpool - DEBUG - Resetting dropped connection: api.mycroft.ai
10:32:06.201 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device HTTP/1.1" 401 38
10:32:06.217 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
10:32:06.667 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/auth/token HTTP/1.1" 401 38
10:32:06.682 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /var/tmp/mycroft_web_cache.json loaded
10:32:06.685 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded
10:32:06.689 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/pi/.mycroft/mycroft.conf loaded
Playing WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
Playing back the recording...
Restarting mycroft...

In case it helps, here’s a sample /var/log/mycroft-speech-client.log

10:46:38.604 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/configuration/mycroft.conf loaded
10:46:38.612 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/configuration/mycroft.conf loaded
10:46:38.617 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded
10:46:38.622 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/mycroft/.mycroft/mycroft.conf loaded
10:46:38.639 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
10:46:39.139 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/05336e3c-a5f0-4818-8c4a-7cd41895423a HTTP/1.1" 200 409
10:46:39.155 - mycroft.api:send:115 - DEBUG - Updating etag for: device/05336e3c-a5f0-4818-8c4a-7cd41895423a
10:46:39.162 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/configuration/mycroft.conf loaded
10:46:39.167 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded
10:46:39.171 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/mycroft/.mycroft/mycroft.conf loaded
10:46:39.178 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
10:46:39.750 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/05336e3c-a5f0-4818-8c4a-7cd41895423a/setting HTTP/1.1" 200 3038
10:46:39.765 - mycroft.api:send:115 - DEBUG - Updating etag for: device/05336e3c-a5f0-4818-8c4a-7cd41895423a/setting
10:46:39.771 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
10:46:40.282 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/05336e3c-a5f0-4818-8c4a-7cd41895423a/location HTTP/1.1" 200 883
10:46:40.297 - mycroft.api:send:115 - DEBUG - Updating etag for: device/05336e3c-a5f0-4818-8c4a-7cd41895423a/location
10:46:40.315 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded
10:46:40.318 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/mycroft/.mycroft/mycroft.conf loaded
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 pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
10:46:40.433 - mycroft.client.speech.listener:create_wake_word_recognizer:243 - INFO - creating wake word engine
10:46:40.437 - mycroft.client.speech.hotword_factory:load_module:252 - INFO - Loading "hey mycroft" wake word via precise
10:46:40.449 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/mycroft/.mycroft/mycroft.conf loaded
10:46:40.455 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): github.com:443
10:46:40.937 - urllib3.connectionpool - DEBUG - https://github.com:443 "GET /MycroftAI/precise-data/raw/dist/armv7l/latest HTTP/1.1" 302 141
10:46:40.945 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): raw.githubusercontent.com:443
10:46:41.116 - urllib3.connectionpool - DEBUG - https://raw.githubusercontent.com:443 "GET /MycroftAI/precise-data/dist/armv7l/latest HTTP/1.1" 200 111
10:46:42.875 - mycroft.client.speech.listener:create_wakeup_recognizer:263 - INFO - creating stand up word engine
10:46:42.879 - mycroft.client.speech.hotword_factory:load_module:252 - INFO - Loading "wake up" wake word via pocketsphinx
10:46:43.048 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
10:46:43.542 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/05336e3c-a5f0-4818-8c4a-7cd41895423a HTTP/1.1" 304 0
10:46:43.560 - mycroft.api:send:111 - DEBUG - Etag matched. Nothing changed for: device/05336e3c-a5f0-4818-8c4a-7cd41895423a
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514
Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2818
10:46:43.576 - mycroft.messagebus.client.ws:on_open:61 - INFO - Connected

and here’s a sample /var/log/mycroft-audio.log:

10:47:07.330 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/configuration/mycroft.conf loaded
10:47:07.547 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/configuration/mycroft.conf loaded
10:47:07.788 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded
10:47:08.036 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/mycroft/.mycroft/mycroft.conf loaded
10:47:08.053 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
10:47:08.601 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/05336e3c-a5f0-4818-8c4a-7cd41895423a HTTP/1.1" 200 409
10:47:08.843 - mycroft.api:send:115 - DEBUG - Updating etag for: device/05336e3c-a5f0-4818-8c4a-7cd41895423a
10:47:09.072 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/configuration/mycroft.conf loaded
10:47:09.300 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded
10:47:09.528 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/mycroft/.mycroft/mycroft.conf loaded
10:47:09.534 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
10:47:10.058 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/05336e3c-a5f0-4818-8c4a-7cd41895423a/setting HTTP/1.1" 200 3038
10:47:10.315 - mycroft.api:send:115 - DEBUG - Updating etag for: device/05336e3c-a5f0-4818-8c4a-7cd41895423a/setting
10:47:10.323 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
10:47:10.833 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/05336e3c-a5f0-4818-8c4a-7cd41895423a/location HTTP/1.1" 200 883
10:47:11.087 - mycroft.api:send:115 - DEBUG - Updating etag for: device/05336e3c-a5f0-4818-8c4a-7cd41895423a/location
10:47:11.333 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded
10:47:11.562 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/mycroft/.mycroft/mycroft.conf loaded
10:47:11.650 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
10:47:12.146 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/05336e3c-a5f0-4818-8c4a-7cd41895423a/subscription HTTP/1.1" 200 114
  Carnegie Mellon University, Copyright (c) 1999-2011, all rights reserved
  mimic developers, Copyright (c) 2016, all rights reserved
  version: mimic-1.2.0.2 ()
10:47:12.264 - mycroft.audio.main:main:473 - INFO - Starting Audio Services
10:47:12.278 - mycroft.messagebus.client.ws:on_open:61 - INFO - Connected
10:47:12.283 - mycroft.audio.main:get_services:68 - INFO - Loading services from /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/audio/services/
10:47:12.292 - mycroft.audio.main:load_services:112 - INFO - Loading chromecast
10:47:21.027 - mycroft.audio.main:load_services:112 - INFO - Loading mopidy
10:47:21.035 - mycroft.audio.main:load_services:112 - INFO - Loading mpg123
10:47:21.040 - mycroft.audio.main:load_services:112 - INFO - Loading mplayer
10:47:21.127 - mplayer__init__:<module>:20 - ERROR - install py_mplayer with pip install git+https://github.com/JarbasAl/py_mplayer
10:47:21.131 - mycroft.audio.main:load_services:118 - ERROR - Failed to import module mplayer
ImportError("No module named 'py_mplayer'",)
10:47:21.134 - mycroft.audio.main:load_services:112 - INFO - Loading ogg123
10:47:21.139 - mycroft.audio.main:load_services:112 - INFO - Loading vlc
10:47:21.268 - mycroft.audio.main:load_services:133 - ERROR - Failed to load service. NameError("no function 'libvlc_new'",)
10:47:21.273 - mycroft.audio.main:load_services_callback:180 - INFO - Finding default backend...
10:47:21.276 - mycroft.audio.main:load_services_callback:184 - INFO - Found local

In case it’s relevant, I’ve also followed these instructions to reconfigure locales (although I am in Britain).

I’d be grateful for any help getting this working.

Thanks,
Greg

Thanks for reporting these issues @gregrs.

To be honest I think the best thing to do here would be to try the Unstable Picroft image - that March image is 6 months old now and is quite out of date with where the Mycroft software is at.

https://mycroft.ai/to/picroft-unstable

Thanks @KathyReid. I’ve downloaded raspbian-stretch_Picroft_2018-08-01_preview.img linked from the Picroft documentation and got it working, with a few bumps along the way which I’ll describe in case it helps you improve the software.

I set up via the prompts on first boot. This is a nice touch but it would be good to have a list of possible wifi networks and to be able to see the password you’re typing, just typing it once. Also where it says WEP, this actually works for WPA networks too, which was a bit confusing.

I ran dev_setup.sh as asked without rebuilding Mimic, although you might want to hint to users that it’s in the mycroft-core directory.

start-mycroft.sh cli gave me repeating errors which were difficult to read and made it unusable:

> 08:14:29.961 - mycroft.messagebus.client.ws:on_error:75 - ERROR - === ConnectionRefusedError(111, 'Connection refused') ===
                                                                                                                             Traceback (most recent call last):
                    File "/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/websocket/_app.py", line 168, in run_forever
                                                                                                                                  host=host, origin=origin)
                File "/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/websocket/_core.py", line 266, in connect
                                                                                                                           self.sock, addrs = connect(url, self.sock_opt, proxy_info(**options))
                                                     File "/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/websocket/_http.py", line 63, in connect
                  sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)
                                                                                        File "/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/websocket/_http.py", line 116, in _open_socket
                                                           raise err
                                                                      File "/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/websocket/_http.py", line 105, in _open_socket
                                         sock.connect(address)
                                                              ConnectionRefusedError: [Errno 111] Connection refused
                                                                                                                    08:14:29.967 - mycroft.messagebus.client.ws:on_error:82 - ERROR - Exception closing websocket: Exception("Uncaught 'error' event.",)
                                                                                                           08:14:29.971 - mycroft.messagebus.client.ws:on_error:84 - WARNING - WS Client will reconnect in 5 seconds.

I tried an audio test:

(.venv) pi@picroft:~/mycroft-core $ ./start-mycroft.sh audiotest
/usr/lib/python3.5/runpy.py:125: RuntimeWarning: 'mycroft.util.audio_test' found in sys.modules after import of package 'mycroft.util', but prior to execution of 'mycroft.util.audio_test'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
 ===========================================================
 ==         STARTING TO RECORD, MAKE SOME NOISE!          ==
 ===========================================================
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.front.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown 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 confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
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,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
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,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
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,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
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
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2719
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2843
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pi/mycroft-core/mycroft/util/audio_test.py", line 62, in <module>
    main()
  File "/home/pi/mycroft-core/mycroft/util/audio_test.py", line 53, in main
    record(args.filename, args.duration)
  File "/home/pi/mycroft-core/mycroft/util/audio_test.py", line 33, in record
    with mic as source:
  File "/home/pi/mycroft-core/mycroft/client/speech/mic.py", line 122, in __enter__
    input=True,  # stream is an input stream
  File "/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/pyaudio.py", line 750, in open
    stream = Stream(self, *args, **kwargs)
  File "/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/pyaudio.py", line 441, in __init__
    self._stream = pa.open(**arguments)
OSError: [Errno -9997] Invalid sample rate

It looked like there was a problem here so I tried to troubleshoot and found that pulseaudio wasn’t installed so I did sudo apt install pulseaudio and rebooted.

On reboot… Yessss!! I got a mic level in the CLI client for the first time and when I said ‘Hey Mycroft’ I wasn’t met by absolute silence for what seemed like the millionth time using the stable Picroft image! I’m happy to be able to experiment with using Mycroft now.

1 Like

By the way, I’m happy to submit a PR for the ‘WEP’ thing I mentioned but couldn’t find where the code for the setup wizard lives on GitHub…

1 Like

This is super useful troubleshooting and diagnostics, THANK YOU!

The enclosure-picroft code is here but I don’t see the code that @steve.penrod has used to create the Beta image (I checked for forks too) - I know this was a “what can I do late one night” thing (seriously, Steve like waved his hands and by magic the new Beta appeared) so the code may not be up yet.

Got it… It was in the stretch branch. Pull request here

1 Like