# Mic doesn't work on startup - only after running mycroft-mic-test

**URL:** https://community.openconversational.ai/t/mic-doesnt-work-on-startup-only-after-running-mycroft-mic-test/5236
**Category:** Picroft
**Created:** [November 27, 2018, 5:36pm UTC](https://community.openconversational.ai/t/mic-doesnt-work-on-startup-only-after-running-mycroft-mic-test/5236 "2018-11-27T17:36:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dodrian](https://community.openconversational.ai/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@dodrian](https://community.openconversational.ai/u/dodrian)
#### Post date: [November 27, 2018, 5:36pm UTC](https://community.openconversational.ai/t/mic-doesnt-work-on-startup-only-after-running-mycroft-mic-test/5236/1 "2018-11-27T17:36:41Z")

</div>

My Picroft doesn’t recognize the wake word on startup, nor after restarting the mycroft-cli-client. Audio outputs over HDMI if I type in a command (“what time is it”). However, if I run mycroft-mic-test, I can hear the test noise fine, and relaunching mycroft-cli-client I can now see the mic level meter, and it responds correctly to the wake word.

Installation details:

I was unable to connect my Picroft (3B+) to the internet from the picroft image (the enclosure-picroft one linked on github - sorry, new users can’t post many links) (I tried from mycroft-setup-wizard, in hindsight I should have tried raspi-config as well), so I followed the instructions and used the lastest raspbian lite stretch and update.sh as [described here](https://github.com/MycroftAI/enclosure-picroft/blob/stretch/image_recipe.md). I am using a seeed 2-mic respeaker pihat and installed the drivers as per [here](https://github.com/respeaker/seeed-voicecard).

1. Any idea what the mic-test is doing?
2. I actually want audio output via the respeaker card too - how can I change that?
3. The update.sh script didn’t appear to install pulseaudio. Should it have?

Thanks for any help!

System info:

Audio.log ERRORs {no errors in the other logs):

```
    09:22:32.485 - mplayer __init__ :<module>:20 - ERROR - install py_mplayer with pip install git+https://github.com/JarbasAl/py_mplayer
    09:22:32.490 - mycroft.audio.audioservice:load_services:108 - ERROR - Failed to import module mplayer
    09:22:32.638 - mycroft.audio.audioservice:load_services:123 - ERROR - Failed to load service. NameError("no function 'libvlc_new'",)
    09:27:21.497 - mplayer __init__ :<module>:20 - ERROR - install py_mplayer with pip install git+https://github.com/JarbasAl/py_mplayer
    09:27:21.502 - mycroft.audio.audioservice:load_services:108 - ERROR - Failed to import module mplayer
    09:27:21.798 - mycroft.audio.audioservice:load_services:123 - ERROR - Failed to load service. NameError("no function 'libvlc_new'",)

```

Config:

```
    pi@picroft:~ $ cat /etc/mycroft/mycroft.conf 
    {
       "play_wav_cmdline": "aplay -Dhw:0,0 %1",
       "play_mp3_cmdline": "mpg123 -a hw:0,0 %1",
       "enclosure": {
          "platform": "picroft"
       },
       "tts": {
          "mimic": {
             "path": "/home/pi/mycroft-core/mimic/bin/mimic"
          }
       },
       "ipc_path": "/ramdisk/mycroft/ipc/"
    }
    pi@picroft:~ $ cat .mycroft/mycroft.conf 
    { "max_allowed_core_version": 18.8 }

```

Audio card:

```
    pi@picroft:~ $ aplay -L
    null
        Discard all samples (playback) or generate zero samples (capture)
    default
    playback
    capture
    dmixed
    array
    sysdefault:CARD=ALSA
        bcm2835 ALSA, bcm2835 ALSA
        Default Audio Device
    dmix:CARD=ALSA,DEV=0
        bcm2835 ALSA, bcm2835 ALSA
        Direct sample mixing device
    dmix:CARD=ALSA,DEV=1
        bcm2835 ALSA, bcm2835 IEC958/HDMI
        Direct sample mixing device
    dsnoop:CARD=ALSA,DEV=0
        bcm2835 ALSA, bcm2835 ALSA
        Direct sample snooping device
    dsnoop:CARD=ALSA,DEV=1
        bcm2835 ALSA, bcm2835 IEC958/HDMI
        Direct sample snooping device
    hw:CARD=ALSA,DEV=0
        bcm2835 ALSA, bcm2835 ALSA
        Direct hardware device without any conversions
    hw:CARD=ALSA,DEV=1
        bcm2835 ALSA, bcm2835 IEC958/HDMI
        Direct hardware device without any conversions
    plughw:CARD=ALSA,DEV=0
        bcm2835 ALSA, bcm2835 ALSA
        Hardware device with all software conversions
    plughw:CARD=ALSA,DEV=1
        bcm2835 ALSA, bcm2835 IEC958/HDMI
        Hardware device with all software conversions
    sysdefault:CARD=seeed2micvoicec
        seeed-2mic-voicecard, 
        Default Audio Device
    dmix:CARD=seeed2micvoicec,DEV=0
        seeed-2mic-voicecard, 
        Direct sample mixing device
    dsnoop:CARD=seeed2micvoicec,DEV=0
        seeed-2mic-voicecard, 
        Direct sample snooping device
    hw:CARD=seeed2micvoicec,DEV=0
        seeed-2mic-voicecard, 
        Direct hardware device without any conversions
    plughw:CARD=seeed2micvoicec,DEV=0
        seeed-2mic-voicecard, 
        Hardware device with all software conversions
```

---

<div class="post-metadata">

### Author: ![dodrian](https://community.openconversational.ai/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@dodrian](https://community.openconversational.ai/u/dodrian)
#### Post date: [November 27, 2018, 10:42pm UTC](https://community.openconversational.ai/t/mic-doesnt-work-on-startup-only-after-running-mycroft-mic-test/5236/2 "2018-11-27T22:42:55Z")

</div>

OK, I’ve figured out how to get audio to work properly:

First I edited /etc/mycroft/mycroft.conf:

```
   "play_wav_cmdline": "aplay -Dhw:1 %1",
   "play_mp3_cmdline": "mpg123 -a hw:1 %1",
   "enclosure": {
      "platform": "picroft"
   },
   "tts": {
      "mimic": {
         "path": "/home/pi/mycroft-core/mimic/bin/mimic"
      }
   },
   "ipc_path": "/ramdisk/mycroft/ipc/"

```

For some reason thing fixed the “sing me a song” skill, but not regular talking. Then I followed the instructions from the ALSA Project [here](https://www.alsa-project.org/main/index.php/Setting_the_default_device) to add these lines to `/etc/asound.conf` set my default sound card:

```
defaults.pcm.card 1
defaults.ctl.card 1

```

That has fixed my audio output by setting the default soundcard system-wide, which is fine for my purposes, but I wonder if there’s a way to set it just for Mycroft?

I am still having the issue where I need to run `mycroft-mic-test` before the Picroft starts listening for my voice.

---

<div class="post-metadata">

### Author: ![baconator](https://community.openconversational.ai/letter_avatar_proxy/v4/letter/b/d07c76/32.png) [@baconator](https://community.openconversational.ai/u/baconator)
#### Post date: [November 28, 2018, 12:52am UTC](https://community.openconversational.ai/t/mic-doesnt-work-on-startup-only-after-running-mycroft-mic-test/5236/3 "2018-11-28T00:52:58Z")

</div>

I believe you can set some of this in the .asoundrc file:  
[https://www.alsa-project.org/main/index.php/Asoundrc](https://www.alsa-project.org/main/index.php/Asoundrc)

---

<div class="post-metadata">

### Author: ![dodrian](https://community.openconversational.ai/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@dodrian](https://community.openconversational.ai/u/dodrian)
#### Post date: [November 29, 2018, 2:15am UTC](https://community.openconversational.ai/t/mic-doesnt-work-on-startup-only-after-running-mycroft-mic-test/5236/4 "2018-11-29T02:15:59Z")

</div>

The command I need to get the mic working is this:

```
(.venv) pi@picroft:~ $ /home/pi/mycroft-core/start-mycroft.sh voice
Initializing...
Restarting: voice
Stopping speech...stopped.
(.venv) pi@picroft:~ $ 

```

From what I can tell reading the script, the `Restarting: voice` line implies that the service was already running. But the mic doesn’t work until restarting the service. I’m afraid I don’t have a USB mic to test if this is a problem with my soundcard or something more general.

---

<div class="post-metadata">

### Author: ![suisat](https://community.openconversational.ai/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@suisat](https://community.openconversational.ai/u/suisat)
#### Post date: [April 7, 2019, 9:14pm UTC](https://community.openconversational.ai/t/mic-doesnt-work-on-startup-only-after-running-mycroft-mic-test/5236/5 "2019-04-07T21:14:56Z")

</div>

I am havin the same issue or a one close to your issue.

I use a rpi-3b+ with picroft stable (doing raspi update+raspbian-upgrade) and install the git fpr my 4-mic-respeaker modul, like mentioned [here](http://wiki.seeedstudio.com/ReSpeaker_4_Mic_Array_for_Raspberry_Pi/).

After that I start alsamixer and choose as default mic the new seeed-4-array-mic. [See here](https://mycroft.ai/documentation/picroft/).

Now Mycroft is hearing me but only when I do some inputs. Then he can his keyword but after some test he did not listening anymore.

I dont know what to do know… ☹

Any idea?
