I’m currently running the picroft enclosure/image, on a Raspberry Pi 3B+, using a Seeed studio 4-mic array hat.
Everything is working fairly well (early stages at the moment) except when rebooting the RPi.
After a reboot or after removing/reconnecting power, MyCroft will not wake up, even several minutes later after the boot. Connecting over SSH and running the mycroft-cli-client shows that the microphone is providing no input, as the mic level indicator does nothing.
Performing “mycroft-stop” followed by “mycroft-start all” fixes the issue. Mic indicator shows input, wake word and commands all work as expected.
I’m putting this down to services starting out of order during boot. I’m guessing the mycroft services are starting before the microphone is fully ready.
My question is how can I delay the startup of mycroft services following a system boot of the RPi? I’d like to add an extra ~30 second delay as a starting point
Is it some kind of systemd config? Or is there a scheduled task that calls a startup script?
I am a Microsoft refugee who has been slowly getting into more and more Linux/FOSS over the last 6 months, so please don’t be afraid to explain it like I’m five.
Relevant log info from voice.log at the end of this post.
I can confirm it’s only the voice service that needs to be restarted.
“mycroft-start voice restart” solves the issue just as well instead of
“mycroft-stop”
“mycroft-start all”
I’m not 100% but I think all of this log output was from after the restart. The line before this was timestamped yesterday, before I unplugged the RPi for a period.
2020-02-18 12:12:07.910 | INFO | 2117 | mycroft.messagebus.load_config:load_message_bus_config:33 | Loading message bus configs
2020-02-18 12:12:11.354 | INFO | 2117 | mycroft.util:find_input_device:250 | Searching for input device: seeed-4mic-voicecard
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c$
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c$
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c$
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c$
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c$
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib conf.c:5014:(snd_config_expand) Unknown parameters {AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c$
2020-02-18 12:12:11.708 | INFO | 2117 | mycroft.client.speech.listener:create_wake_word_recognizer:323 | Creating wake word engine
2020-02-18 12:12:11.711 | INFO | 2117 | mycroft.client.speech.listener:create_wake_word_recognizer:346 | Using hotword entry for hey mycr$
2020-02-18 12:12:11.717 | INFO | 2117 | mycroft.client.speech.hotword_factory:load_module:386 | Loading "hey mycroft" wake word via preci$
2020-02-18 12:12:17.106 | INFO | 2117 | mycroft.client.speech.listener:create_wakeup_recognizer:360 | creating stand up word engine
2020-02-18 12:12:17.109 | INFO | 2117 | mycroft.client.speech.hotword_factory:load_module:386 | Loading "wake up" wake word via pocketsph$
2020-02-18 12:12:17.717 | INFO | 2117 | mycroft.messagebus.client.client:on_open:67 | Connected
Returns nothing, so, it’s not a service at all? How is mycroft started at boot?
Best I can see is some entries in htop that indicate python is the owning process. But I understand next to nothing of python so can’t begin to figure it out.