googlesamples / assistant-sdk-python

Samples and bindings for the Google Assistant API
http://developer.google.com/assistant/sdk
Apache License 2.0
916 stars 321 forks source link

Assistant not responding to hotword #47

Closed sondresorbye closed 6 years ago

sondresorbye commented 7 years ago

I have installed the Google assistant on my raspberry pi 3.I have followed the documentation for the google assistant sdk, but it does not work. The assistant is not responding when I say "Ok, Google"

The output when I try to start the assistant is:

(env) pi@raspberrypi:~ $ google-assistant-demo

ON_MUTED_CHANGED:
  {'is_muted': False}
ON_START_FINISHED  

When I test the recording, the recording is being played too fast. Can this be the problem that the Google assistant is not responsing?

I am also getting an error in the google cloud console: Method google.internal.speech.S3OnePlatform.Assistant

proppy commented 7 years ago

Can you share the full error log that you're getting and your .asoundrc configuration?

sondresorbye commented 7 years ago

The .asounrc file:

pcm.!default {
  type asym
  capture.pcm "mic"
  playback.pcm "speaker"
}
pcm.mic {
  type plug
  slave {
    pcm "hw:1,0"
  }
}
pcm.speaker {
  type plug
  slave {
    pcm "hw:0,1"
  }
}

Here are to links of pictures of the error I receive in the cloud console: (https://drive.google.com/open?id=0B92FVcqvLD_YaHNQbEZSMlJuZUk ), (https://drive.google.com/open?id=0B92FVcqvLD_YSGlpajl1U3djN3c )

WellyHong commented 7 years ago

I encountered this same problem and below is my .asoundrc file.

pcm.!default {  
  type asym  
  capture.pcm "mic"  
  playback.pcm "speaker"  
}  
pcm.mic {  
  type plug  
  slave {  
    pcm "hw:1,0"  
  }  
}  
pcm.speaker {  
  type plug  
  slave {  
    pcm "hw:0,1"  
  }  
}

I also tried googlesamples-assistant-audiotest --record-time 10 and googlesamples-assistant-pushtotalk. It performed well. But google-assistant-demo and googlesamples-assistant-hotword didn't work. BTW, pre-testing for mic/speaker are all good.

chris-gunawardena commented 7 years ago

Same issue, the response code is 499 and the method is google.internal.speech.S3OnePlatform.Assistant

shaunakg commented 7 years ago

I also had the same issue, but for some reason it worked when I restarted. EDIT: Is this happening only to people who have edited the .asoundrc file?

chris-gunawardena commented 7 years ago

No luck after restarting and I don't have a .asoundrc file.

shaunakg commented 7 years ago

Try this page, that Google made. If you don't have an .asoundrc file, you can make one and put this code in it (courtesy of google):

pcm.!default {
  type asym
  capture.pcm "mic"
  playback.pcm "speaker"
}
pcm.mic {
  type plug
  slave {
    pcm "hw:<card number>,<device number>"
  }
}
pcm.speaker {
  type plug
  slave {
    pcm "hw:<card number>,<device number>"
  }
}

EDIT: Also, edit the code in \<pointy brackets> with your own device and card numbers.

chris-gunawardena commented 7 years ago

Thanks @jacksonsevendelta, still not working. I'm getting the following error [496:523:ERROR:mic_failure_detector.cc(120)] Channel 1 has failed. Powers -inf and -inf now.

ghost commented 7 years ago

Just got the same issue. It started after the Google Assistant crashed and I tried to restart it. A reboot fixes this issue, though. (I'm also unable to kill it witch CTRL + C)

shaunakg commented 7 years ago

Yes! I know I'm hijacking, but why can't you kill it with CTRL-C? It should be implemented. I managed to do so by making a start-up script (you can find it here), but the timeframe to press it is small.

Also, @chris-gunawardena, I can't really help after that, sorry. What Pi do you have? It's recommended for the Pi 3, so Assistant may have problems with your device.

vixriihi commented 7 years ago

I've got this issue as well. google-assistant-demo hangs with ON_START_FINISHED status and doesn't continue from there. Cloud console is showing 100% error google.internal.speech.S3OnePlatform.Assistant

Recording and playback is working just fine when I test using the "Configure and Test the Audio"-page. I'm using PI 3.

proppy commented 7 years ago

@vixriihi can you confirm that the hotword "Ok, Google" or "Hey, Google" are not recognized?

Also did you try to raise the microphone sensibility according to the troubleshooting instructions

vixriihi commented 7 years ago

@proppy Nice it's working. I thought that the status text would change to something else, but indeed it's now working just fine. Thanks

capitalfuse commented 7 years ago

From #70, After activating alsa plug-ins dmix and dsnoop, works well on orange pi pc on both of hotword and demo sample code, but under these activating conditions, pushtotalk sample code is stuck.

proppy commented 7 years ago

@capitalfuse can you share your .asoundrc with dsnoop and dmix enabled that you're trying with the pushtotalk sample?

capitalfuse commented 7 years ago

@proppy .asoundrc in the case of

  1. gRPC pushtotalk sample code ---------->

    pcm.!default {
    type asym
    capture.pcm "mic"
    playback.pcm "speaker"
    }
    pcm.mic {
    type plug
    slave {
    pcm "hw:0,0"
    }
    }
    pcm.speaker {
    type plug
    slave {
    pcm "hw:0,0"
    }
    }
  2. demo or hotword sample code, as I need to use vol control with remote, added softvol plugin. ---------->

    pcm.!default {
    type asym
    playback.pcm "plug:softvol"
    capture.pcm "plug:dsnooper"
    }
    pcm.dmixer {
      type dmix
      ipc_key 321456 #any unique value
      ipc_key_add_uid true
      slave {
        pcm "hw:0,0"
        rate 44100
      }
      bindings {
          0 0
          1 1
      }
    }
    pcm.dsnooper {
      type dsnoop
      ipc_key 821456
      slave {
        pcm "hw:0,0"
        channels 2
        rate 44100
      }
    }
    pcm.softvol {
      type softvol
      slave { pcm "dmixer" }
      control {
          name "Master"
          card 0
      }
    }
    ctl.softvol {
    type hw
    card 0
    }
capitalfuse commented 7 years ago

After deleting rate 44100 from dmix and dsnoop, works well in all sample commands. Finally fixed .asoundrc like the following,

 pcm.!default {
   type asym
   playback.pcm "plug:softvol"
   capture.pcm "plug:dsnooper"
 }
 pcm.dmixer {
      type dmix
      ipc_key 321456 #any unique value
      ipc_key_add_uid true
      slave {
        pcm "hw:0,0"
      }
      bindings {
          0 0
          1 1
      }
 }
 pcm.dsnooper {
      type dsnoop
      ipc_key 821456
      slave {
        pcm "hw:0,0"
        channels 2
      }
      bindings { # for output mono sound to 2ch right and left speaker, need this item.
              0 0
              1 1
      }
 }
 pcm.softvol {
      type softvol
      slave { pcm "dmixer" }
      control {
          name "Master"
          card 0
      }
 }
 ctl.softvol {
   type hw
   card 0
 }
 ctl.!default {
   type hw
   card 0
 }
sondresorbye commented 7 years ago

I made it work by buying a new mic. My previous one was very old.

capitalfuse commented 7 years ago

fixed pcm.dsnooper in .asoundrc. please see the above.

 pcm.dsnooper {
      type dsnoop
      ipc_key 821456
      slave {
        pcm "hw:0,0"
        channels 2
      }
      bindings { # for output mono sound to 2ch right and left speaker, need this item.
              0 0
              1 1
      }
rkstrach commented 7 years ago

Chris - how did you solve your issue?

I'm having the same problem:

(env) pi@raspberrypi:~ $ googlesamples-assistant-hotword ON_MUTED_CHANGED: {'is_muted': False} ON_START_FINISHED [3128:3145:ERROR:mic_failure_detector.cc(120)] Channel 1 has failed. Powers -inf and -inf

chris-gunawardena commented 7 years ago

@rkstrach I got it working by following the instructions here on a fresh 4.4 and using the config posted here. Watch out for smart quotes and double quotes when cutting and pasting.

tkamaal commented 7 years ago

@vixriihi Can you please explain what helped you to fix it? or what steps you specifically followed to fix it?

I had google assistant sdk working on raspberry pi 3 by following the instructions provided here . I tested it few times and it was working fine. I'm using new MIC and speaker. I turned off the Pi for few days and wanted to demo it again but I started running into the below issues

(env) pi@raspberrypi:~ $ google-assistant-demo

ON_MUTED_CHANGED: {'is_muted': False} ON_START_FINISHED

I am also getting an error in the google cloud console: Method google.internal.speech.S3OnePlatform.Assistant

Please provide some inputs to help me fix this issue.

tkamaal commented 7 years ago

Just shutdown Pi and turned on again, fixed it. I wonder what changed. Please provide some information if anyone of you know what actually happened.

I'm a bit confused about what actually fixed it.

Fleker commented 6 years ago

Can you try with the latest version of the library?

google-assistant-library 0.1.0

ndmax commented 6 years ago

I'm getting the same error. I've tried the Assistant SDK (Python), the AIY Projects Raspbian repository, as well as the AIY Voice Kit image and instructions. Nothing works. After two days and a lot of frustration, I haven't managed to get a response from "Okay Google."

The AIY Projects page estimates you'll be up and running in an hour and a half, while the Assistant SDK calls it a "turnkey solution," and the Rasbian Project promises an "easy-to-use API." I'm sorry, but no.

Fleker commented 6 years ago

Since the initial issue, we've updated the Python library multiple times. Any bugs with audio configurations may have been resolved. If you are still having issues, please make a new issue.

Antonzlo commented 5 years ago

Hello, have same problem. Mic test is good, but google can't recognize me. -audiotest result is confusing. image .asoundrc is here:

pcm.!default { type asym capture.pcm "mic" playback.pcm "speaker" } pcm.mic { type plug slave { pcm "hw:1,0" } } pcm.speaker { type plug slave { pcm "hw:0,0" } }