Google Assistant SDK on Raspberry Pi 3: Audio setup does not work

强颜欢笑 提交于 2019-12-01 12:45:15

That happens if your .asoundrc doesn't have the correct structure. Warning: If you use the rpi gui (desktop) volume control to change inputs it will modify the .asoundrc for you, breaking ALSA for google assistant. You'll have to go and fix it up. The instructions on google's website are correct.

To fix it delete the new entries created. Then, at the top, look for the line 'type hw'. It has been sneakily modified... you'll have to change it back to 'type asym' to match the config google specify.

I leave the input/output for the gui (desktop) volume set to analogue and don't touch it once I start using google assistant so it won't go and mess with .asoundrc again.

I am using a Logitech USB headset and which has both mic & speaker (I don't use external speaker) So, given my audio input and output goes to the headset, my .asoundrc looks like this:

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:1,0"
  }
}

Lastly, if you reboot your Pi, you'll have to reset the source path for the assistant binary, otherwise it won't be able to find the command that starts the assistant demo. Do this by typing "source env/bin/activate" Then you can run it again by typing "google-assistant-demo"

Good luck!

Yes I was seeing this error -- weirdly after I had everything working fine, i never thought that the .asoundrc file would have been corrupted.

Invalid value card arecord: main:722: audio open error: no such file or directory

I confirm that Xeneck Stoher says about the Rasbian gui volume/audio in/out selection messing up your ~.asoundrc file, replacing it fixed this issue and the recording / playback now works fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!