USB Microphone randomly freezes after saying something to the USB microphone, working before

I’m not sure if this is caused by a latest update, or the use of the power supply for the Raspberry Pi 3 B+ (5v 2.5A), but the USB microphone randomly freezes (as seen in the CLI).

The CLI works if you type something to it, but the microphone did not work after the skills have loaded or after the wake words have loaded. Sometimes the output audio gets muted, especially after restarting the Pi. This did not happen before.

This happens on both the stable and unstable images, and the speaker-test and the mic-test worked normally.

The other old posts that had this issue had some solutions like editing the /etc/pulse/default.pa file, but this did not work.

Could this be a PulseAudio issue?

EDIT: Just double-checked with alsamixer after restarting the pi, pulseaudio always mutes the output volume.

EDIT 2: Here is a link to the voice.log

Thanks for the log.

In terms of the mic freezing up, what type of usb mic are you using?

My first check would be switching back to “Hey Mycroft” as a wake word and see if this improves the behaviour at all. It looks like there is a problem with the “Hey Jarvis” precise model:

19:17:14.350 - mycroft.client.speech.hotword_factory:load_module:277 - INFO - Loading "hey jarvis" wake word via precise
19:17:18.846 - mycroft.client.speech.hotword_factory:initialize:292 - WARNING - Could not found find model for hey jarvis on precise.

It could also be related to pulse audio can you describe quickly what changes you made there?

For the audio being muted after reboot, what output device are you using? If changing this in alsamixer resolves the problem, then I’d try making those changes and saving that configuration state by running: sudo alsactl store

When you said these problems occurred on both stable and unstable does that mean you have tried installing Mycroft from both of these images, or did you switch using mycroft-use unstable?

I tried installing Mycroft from both images.

The output device is just a 3.5mm speaker that is USB-powered.

I happened to use this camera.

EDIT: sudo alsactl store did not save the changes. After rebooting the pi, the output volume went back to the zero state:

EDIT 2: Reflashed the stable image, the audio worked fine, but after the device is paired and the default settings synced to the pi, the freezing microphone bug happens again. Here are the logs after the fresh install.

For the output muting - there are two ways to go about this that I can see.

  1. Get Mycroft to set the audio level
    I see that the volume skill initially reports errors but then updates and should set the audio level after that. Try adding a default volume to your mycroft.conf file, so ~/.mycroft/mycroft.conf might look like:
{
  "VolumeSkill": {
    "default_level": 6
  }
}
  1. Set audio level on boot
    Given the previous command didn’t work, you could set the audio with a command like:
    amixer sset Master 75%
    and if that works, add it to your ~/.bashrc file to run on startup

Without specifying a device in this command it should just select the default card but if that doesn’t work, you can select a specific device using the -c or -D flags. -c specifies the card number, -D for device by name. So probably:
amixer -D pulse sset Master 75%
or
amixer -c 1 sset Master 75%

For the mic freezing, Ake just fixed a bug that I think could result in this. That commit will get merged to the dev branch in the next day or two so we can then test that.

The output audio muting disappeared after reflashing the stable image though, which is odd. And pulseaudio was not part of the stable image that I had, so it could be caused by that.

Can’t wait for the next commit – is the command sudo apt-get upgrade once the next commit is merged?

Hmmm odd, but glad it’s working :slight_smile:

on Picroft there is an update script at `/home/pi/update.sh

So after exiting the CLI you should be able to run:
bash update.sh

It worked for a short while until I SSH’d on it and it asks to “run ./dev_setup.sh” and the issue happens again, plus pulseaudio is installed with the same automatic low volume issue.

EDIT: Compiling own version of the stable image fixed the issue, however, a different issue with alsamixer (not sure if this deserves another thread) is that pressing other function keys (like F4 for playback controls) closes alsamixer via SSH, while the issue is not present if the keyboard and monitor are connected to the pi. But the volume for the mic might need to be set to maximum if the pi is rebooted.

I would guess the F4 key closing alsamixer must be your terminal sending the wrong key combination for some reason.

I saw this old thread on the Arch forums

What OS and terminal are you running?

Already fixed the F4 issue. It was the International keyboard setting in Windows. Changing it to ENG-US helped.

EDIT: I was using PuTTY

1 Like