MycroftAI / mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform.
https://mycroft.ai
Apache License 2.0
6.51k stars 1.27k forks source link

Mic Level drops to 0 when MyCroft is transcribing. But fine during audio streamings. (cannot "Barge-in") #3005

Closed iointerrupt closed 2 years ago

iointerrupt commented 2 years ago

I spent some time tweaking mycroft and pulseaudo echo cancellation to be able to hear my audio (to some degree) so that I can issue commands like "hey mycroft... stop" while listening to music "Play Pandora" or listen to the news "play the news". However any command that gets issued to MyCroft where mycroft TTS itself is speaking (utterance), I cannot barge in. I use the mycroft-cli-client to monitor the mic levels, its working fine as it goes up and down depending on the volume during streaming. However during utterance where mycroft is transcribing, mic level is 0 so I am unable to barge in.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Launch mycroft-cli-client'
  2. Say 'who is Tom Hanks' (long enough text)
  3. Mic-Level is 0 while MyCroft is transcribing

Expected behavior The mic level should continue to work

Environment (please complete the following information):

forslund commented 2 years ago

Just checking, have you set the mute_during_output listener config to false?

if you haven't you can add a section to your user config

mycroft-config edit user

and then add a section for the listener (or extend an existing one)

  "listener": {
    "mute_during_output": false
  }
iointerrupt commented 2 years ago

Before I set listener.mute_during_output to "false", I checked thru all the configs and noticed that it was set to "true" only on the "default" config profile. So by default mycroft would mute the mic. I set it to false for the user config and even after restarting mycroft and then rebooting, mic level is 0 when speaking. I double-checked to make sure mycroft-config get listener.mute_during_output reports "false"

Is is my user config:

{
  "max_allowed_core_version": 21.2,
  "listener": {
    "device_name": "pulse",
    "mute_during_output": "false"
  },
  "tts": {
    "module": "google"
  },
  "play_wav_cmdline": "paplay %1 --stream-name=mycroft-voice",
  "play_mp3_cmdline": "mpg123 %1"
}
iointerrupt commented 2 years ago

I think I figured out the issue:

The boolean should be w/o quotes. The problem appears to be that when you usemycroft-config set it will wrap boolean values in quotes. I used mycroft-config with mycroft-config set listener.mute_during_output false which automatically wrapped the value in quotes.

As I noted in a previous Issue #2991 , the mycroft-config setis currently broken as its referencing the old myconf file location. I applied a fix for it on my local instance of picroft. This might be something to watch out for when utilizing mycroft-config script to set boolean values.