shivasiddharth / GassistPi

Google Assistant for Single Board Computers
Other
1.02k stars 303 forks source link

ReSpeaker 2 Mic HAT installation and Assistant auto start error #1112

Closed JahFyahh closed 3 years ago

JahFyahh commented 3 years ago

IMPORTANT NOTICE
If you do not complete the template below it is likely that your issue will not be addressed. When providing information about your issue please be as extensive as possible so that it can be solved by as little as possible responses.

FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED

Which branch of GassistPi are you using ?

Main Branch

Board and OS details:

Open a terminal and run

cat /proc/cpuinfo  
cat /etc/os-release  
cat /etc/rpi-issue
pi@pi-google-assist:~/GassistPi $ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2835
Revision        : 9000c1
Serial          : 00000000f7cdd58b
Model           : Raspberry Pi Zero W Rev 1.1
pi@pi-google-assist:~/GassistPi $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@pi-google-assist:~/GassistPi $ cat /etc/rpi-issue
Raspberry Pi reference 2021-01-11
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 21090519d85bdaa1615d5d5057d37b09368ea5d2, stage2
pi@pi-google-assist:~/GassistPi $

Describe the bug:

When starting I receive the following error

Mar 13 14:38:58 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 13 14:39:33 pi-google-assist python[2241]: Traceback (most recent call last):
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/protocol/shared.py", line 216, in perform
Mar 13 14:39:33 pi-google-assist python[2241]:     response.raise_for_status()
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/requests/models.py", line 943, in raise_for_status
Mar 13 14:39:33 pi-google-assist python[2241]:     raise HTTPError(http_error_msg, response=self)
Mar 13 14:39:33 pi-google-assist python[2241]: requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://mclients.googleapis.com/sj/v2.5/devicemanagementinfo?alt=json&hl=en_US&dv=0&tier=fr
Mar 13 14:39:33 pi-google-assist python[2241]: During handling of the above exception, another exception occurred:
Mar 13 14:39:33 pi-google-assist python[2241]: Traceback (most recent call last):
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/GassistPi/src/pushbutton.py", line 41, in <module>
Mar 13 14:39:33 pi-google-assist python[2241]:     from actions import say
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/GassistPi/src/actions.py", line 14, in <module>
Mar 13 14:39:33 pi-google-assist python[2241]:     from mediaplayer import api
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/GassistPi/src/mediaplayer.py", line 23, in <module>
Mar 13 14:39:33 pi-google-assist python[2241]:     for device in api.get_registered_devices():
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/clients/mobileclient.py", line 880, in get_registered_devices
Mar 13 14:39:33 pi-google-assist python[2241]:     res = self._make_call(mobileclient.GetDeviceManagementInfo)
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/clients/mobileclient.py", line 43, in _make_call
Mar 13 14:39:33 pi-google-assist python[2241]:     return super()._make_call(protocol, *args, **kwargs)
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/clients/shared.py", line 83, in _make_call
Mar 13 14:39:33 pi-google-assist python[2241]:     return protocol.perform(self.session, self.validate, *args, **kwargs)
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/protocol/shared.py", line 224, in perform
Mar 13 14:39:33 pi-google-assist python[2241]:     raise CallFailure(err_msg, call_name)
Mar 13 14:39:33 pi-google-assist python[2241]: gmusicapi.exceptions.CallFailure: GetDeviceManagementInfo: 404 Client Error: Not Found for url: https://mclients.googleapis.com/sj/v2.5/devicemanagementinfo?alt=json&hl=en_US&dv=0&tier=fr
Mar 13 14:39:33 pi-google-assist python[2241]: (requests kwargs: {'method': 'GET', 'url': 'https://mclients.googleapis.com/sj/v2.5/devicemanagementinfo', 'params': {'alt': 'json', 'hl': 'en_US', 'dv': 0, 'tier': 'fr'}, 'headers': {'Authorization': '<omitted>'}})
Mar 13 14:39:33 pi-google-assist python[2241]: (response was: '<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>Sorry...</title><style> body { font-family: verdana, arial, sans-serif; background-color: #fff; color: #000; }</style></head><body><div><table><tr><td><b><font face=sans-serif size=10><font color=#4285f4>G</font><font color=#ea4335>o</font><font color=#fbbc05>o</font><font color=#4285f4>g</font><font color=#34a853>l</font><font color=#ea4335>e</font></font></b></td><td style="text-align: left; vertical-align: bottom; padding-bottom: 15px; width: 50%"><div style="border-bottom: 1px solid #dfdfdf;">Sorry...</div></td></tr></table></div><div style="margin-left: 4em;"><h1>We\'re sorry...</h1><p>... but your computer or network may be sending automated queries. To protect our users, we can\'t process your request right now.</p></div><div style="margin-left: 4em;">See <a href="https://support.google.com/websearch/answer/86640">Google Help</a> for more information.<br/><br/></div><div style="text-align: center; border-top: 1px solid #dfdfdf;"><a href="https://www.google.com">Google Home</a></div></body></html>')
Mar 13 14:39:35 pi-google-assist systemd[1]: gassistpi.service: Main process exited, code=exited, status=1/FAILURE
Mar 13 14:39:35 pi-google-assist systemd[1]: gassistpi.service: Failed with result 'exit-code'.
Mar 13 14:39:35 pi-google-assist systemd[1]: gassistpi.service: Service RestartSec=100ms expired, scheduling restart.
Mar 13 14:39:35 pi-google-assist systemd[1]: gassistpi.service: Scheduled restart job, restart counter is at 219.
Mar 13 14:39:35 pi-google-assist systemd[1]: Stopped Google Assistant-Voice.

Did you go through or search the issues section to check if your issue was already discussed (either currently open issues or closed issues)?

Yes https://github.com/shivasiddharth/GassistPi/issues/925

2. Is the issue related to assistant installation ?

No

If answer to question 2 is Yes, then attach the contents of terminal as a file or paste it below.

If answer to question 2 is No, then proceed further.

3. Does the assistant service start normally?

No

4. Is the assistant service restarting automatically?

Yes

If answer to question 4 is Yes, then paste the contents of the terminal below.

Mar 13 14:38:58 pi-google-assist systemd[1]: gassistpi.service: Main process exited, code=exited, status=1/FAILURE
Mar 13 14:38:58 pi-google-assist systemd[1]: gassistpi.service: Failed with result 'exit-code'.
Mar 13 14:38:58 pi-google-assist systemd[1]: gassistpi.service: Service RestartSec=100ms expired, scheduling restart.
Mar 13 14:38:58 pi-google-assist systemd[1]: gassistpi.service: Scheduled restart job, restart counter is at 218.
Mar 13 14:38:58 pi-google-assist systemd[1]: Stopped Google Assistant-Voice.
Mar 13 14:38:58 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 13 14:39:33 pi-google-assist python[2241]: Traceback (most recent call last):
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/protocol/shared.py", line 216, in perform
Mar 13 14:39:33 pi-google-assist python[2241]:     response.raise_for_status()
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/requests/models.py", line 943, in raise_for_status
Mar 13 14:39:33 pi-google-assist python[2241]:     raise HTTPError(http_error_msg, response=self)
Mar 13 14:39:33 pi-google-assist python[2241]: requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://mclients.googleapis.com/sj/v2.5/devicemanagementinfo?alt=json&hl=en_US&dv=0&tier=fr
Mar 13 14:39:33 pi-google-assist python[2241]: During handling of the above exception, another exception occurred:
Mar 13 14:39:33 pi-google-assist python[2241]: Traceback (most recent call last):
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/GassistPi/src/pushbutton.py", line 41, in <module>
Mar 13 14:39:33 pi-google-assist python[2241]:     from actions import say
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/GassistPi/src/actions.py", line 14, in <module>
Mar 13 14:39:33 pi-google-assist python[2241]:     from mediaplayer import api
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/GassistPi/src/mediaplayer.py", line 23, in <module>
Mar 13 14:39:33 pi-google-assist python[2241]:     for device in api.get_registered_devices():
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/clients/mobileclient.py", line 880, in get_registered_devices
Mar 13 14:39:33 pi-google-assist python[2241]:     res = self._make_call(mobileclient.GetDeviceManagementInfo)
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/clients/mobileclient.py", line 43, in _make_call
Mar 13 14:39:33 pi-google-assist python[2241]:     return super()._make_call(protocol, *args, **kwargs)
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/clients/shared.py", line 83, in _make_call
Mar 13 14:39:33 pi-google-assist python[2241]:     return protocol.perform(self.session, self.validate, *args, **kwargs)
Mar 13 14:39:33 pi-google-assist python[2241]:   File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/protocol/shared.py", line 224, in perform
Mar 13 14:39:33 pi-google-assist python[2241]:     raise CallFailure(err_msg, call_name)
Mar 13 14:39:33 pi-google-assist python[2241]: gmusicapi.exceptions.CallFailure: GetDeviceManagementInfo: 404 Client Error: Not Found for url: https://mclients.googleapis.com/sj/v2.5/devicemanagementinfo?alt=json&hl=en_US&dv=0&tier=fr
Mar 13 14:39:33 pi-google-assist python[2241]: (requests kwargs: {'method': 'GET', 'url': 'https://mclients.googleapis.com/sj/v2.5/devicemanagementinfo', 'params': {'alt': 'json', 'hl': 'en_US', 'dv': 0, 'tier': 'fr'}, 'headers': {'Authorization': '<omitted>'}})
Mar 13 14:39:33 pi-google-assist python[2241]: (response was: '<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>Sorry...</title><style> body { font-family: verdana, arial, sans-serif; background-color: #fff; color: #000; }</style></head><body><div><table><tr><td><b><font face=sans-serif size=10><font color=#4285f4>G</font><font color=#ea4335>o</font><font color=#fbbc05>o</font><font color=#4285f4>g</font><font color=#34a853>l</font><font color=#ea4335>e</font></font></b></td><td style="text-align: left; vertical-align: bottom; padding-bottom: 15px; width: 50%"><div style="border-bottom: 1px solid #dfdfdf;">Sorry...</div></td></tr></table></div><div style="margin-left: 4em;"><h1>We\'re sorry...</h1><p>... but your computer or network may be sending automated queries. To protect our users, we can\'t process your request right now.</p></div><div style="margin-left: 4em;">See <a href="https://support.google.com/websearch/answer/86640">Google Help</a> for more information.<br/><br/></div><div style="text-align: center; border-top: 1px solid #dfdfdf;"><a href="https://www.google.com">Google Home</a></div></body></html>')
Mar 13 14:39:35 pi-google-assist systemd[1]: gassistpi.service: Main process exited, code=exited, status=1/FAILURE
Mar 13 14:39:35 pi-google-assist systemd[1]: gassistpi.service: Failed with result 'exit-code'.
Mar 13 14:39:35 pi-google-assist systemd[1]: gassistpi.service: Service RestartSec=100ms expired, scheduling restart.
Mar 13 14:39:35 pi-google-assist systemd[1]: gassistpi.service: Scheduled restart job, restart counter is at 219.
Mar 13 14:39:35 pi-google-assist systemd[1]: Stopped Google Assistant-Voice.
Mar 13 14:39:35 pi-google-assist systemd[1]: Started Google Assistant-Voice.

If answer to question 4 is No, then proceed further.

Manually start the assistant. For guidelines to start the assistant manually refer this

Paste the command below, that crashed the assistant

Paste the contents of the terminal below

Traceback (most recent call last):
  File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/protocol/shared.py", line 216, in perform
    response.raise_for_status()
  File "/home/pi/env/lib/python3.7/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://mclients.googleapis.com/sj/v2.5/devicemanagementinfo?alt=json&hl=en_US&dv=0&tier=fr

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/GassistPi/src/pushbutton.py", line 41, in <module>
    from actions import say
  File "/home/pi/GassistPi/src/actions.py", line 14, in <module>
    from mediaplayer import api
  File "/home/pi/GassistPi/src/mediaplayer.py", line 23, in <module>
    for device in api.get_registered_devices():
  File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/clients/mobileclient.py", line 880, in get_registered_devices
    res = self._make_call(mobileclient.GetDeviceManagementInfo)
  File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/clients/mobileclient.py", line 43, in _make_call
    return super()._make_call(protocol, *args, **kwargs)
  File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/clients/shared.py", line 83, in _make_call
    return protocol.perform(self.session, self.validate, *args, **kwargs)
  File "/home/pi/env/lib/python3.7/site-packages/gmusicapi/protocol/shared.py", line 224, in perform
    raise CallFailure(err_msg, call_name)
gmusicapi.exceptions.CallFailure: GetDeviceManagementInfo: 404 Client Error: Not Found for url: https://mclients.googleapis.com/sj/v2.5/devicemanagementinfo?alt=json&hl=en_US&dv=0&tier=fr
(requests kwargs: {'method': 'GET', 'url': 'https://mclients.googleapis.com/sj/v2.5/devicemanagementinfo', 'params': {'alt': 'json', 'hl': 'en_US', 'dv': 0, 'tier': 'fr'}, 'headers': {'Authorization': '<omitted>'}})
(response was: '<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>Sorry...</title><style> body { font-family: verdana, arial, sans-serif; background-color: #fff; color: #000; }</style></head><body><div><table><tr><td><b><font face=sans-serif size=10><font color=#4285f4>G</font><font color=#ea4335>o</font><font color=#fbbc05>o</font><font color=#4285f4>g</font><font color=#34a853>l</font><font color=#ea4335>e</font></font></b></td><td style="text-align: left; vertical-align: bottom; padding-bottom: 15px; width: 50%"><div style="border-bottom: 1px solid #dfdfdf;">Sorry...</div></td></tr></table></div><div style="margin-left: 4em;"><h1>We\'re sorry...</h1><p>... but your computer or network may be sending automated queries. To protect our users, we can\'t process your request right now.</p></div><div style="margin-left: 4em;">See <a href="https://support.google.com/websearch/answer/86640">Google Help</a> for more information.<br/><br/></div><div style="text-align: center; border-top: 1px solid #dfdfdf;"><a href="https://www.google.com">Google Home</a></div></body></html>')

I tried setting gmusicapi to Disabled in the config.yaml file, but this changes nothing.

shivasiddharth commented 3 years ago

Hold on, gmusicapi needs to be removed as Google have brought down the Google Music Service. I will remove or comment the Google Music parts of the codes and post and update here.

JahFyahh commented 3 years ago

@shivasiddharth That would be great, thank you. I'll await your update.

shivasiddharth commented 3 years ago

I have commented out the gmusic parts. Delete or rename the existing GassistPi folder and re-clone the project and try it out.

JahFyahh commented 3 years ago

@shivasiddharth Thanks for the quick work.

I renamed the folder and ran the manual command (without reboot), but i am now receiving this error:

[01b95b80] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[01bcc680] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Traceback (most recent call last):
  File "/home/pi/GassistPi/src/pushbutton.py", line 57, in <module>
    from actions import refreshlists
ImportError: cannot import name 'refreshlists' from 'actions' (/home/pi/GassistPi/src/actions.py)
shivasiddharth commented 3 years ago

I have fixed it in the master. You need not clone it again. Open the pushbutton.py file and at the top, you should have a line that says from actions import refreshlists just add a # at the start of the line and save the file.

JahFyahh commented 3 years ago

Done. But here comes the next one.

[011b39c8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[011ea4c8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Traceback (most recent call last):
  File "/home/pi/GassistPi/src/pushbutton.py", line 67, in <module>
    import snowboydecoder
  File "/home/pi/GassistPi/src/snowboydecoder.py", line 5, in <module>
    import snowboydetect
ModuleNotFoundError: No module named 'snowboydetect'

I tried pip install snowboydetect but no dice

pi@pi-google-assist:~ $ pip install snowboydetect Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting snowboydetect Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/snowboydetect/

pi@pi-google-assist:~ $ source /env/bin/activate
-bash: /env/bin/activate: No such file or directory
pi@pi-google-assist:~ $ source env/bin/activate
(env) pi@pi-google-assist:~ $ pip install snowboydetect
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement snowboydetect
ERROR: No matching distribution found for snowboydetect
shivasiddharth commented 3 years ago

Please do not try any random installations. God knows what breaks what and troubleshooting becomes even more difficult. Open the src folder in the GassistPi directory, within that you should find resources and within resources a folder called Buster-Wrapper. Copy those files and paste it in the src folder where you have all the other files/scripts. The installer script does this copying automatically. But as the original folder was deleted, this has to be done manually now.

JahFyahh commented 3 years ago

oeps, sorry, though I was being smart and helpful. I copied the files as instructed and I got the following. It also keeps restarting

[01924a38] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[01934460] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Respeaker-2-Mic
python: src/hostapi/alsa/pa_linux_alsa.c:3641: PaAlsaStreamComponent_BeginPolling: Assertion `ret == self->nfds' failed.
Aborted

I did a reboot and the service is giving the following error:

Mar 13 19:09:26 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 13 19:09:52 pi-google-assist python[1211]: [0251c388] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Mar 13 19:09:53 pi-google-assist python[1211]: [02552e30] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Mar 13 19:09:53 pi-google-assist python[1211]: Respeaker-2-Mic
Mar 13 19:10:03 pi-google-assist python[1211]: INFO:snowboy:Keyword 1 detected at time: 2021-03-13 19:10:03
Mar 13 19:10:04 pi-google-assist python[1211]: python: src/hostapi/alsa/pa_linux_alsa.c:3641: PaAlsaStreamComponent_BeginPolling: Assertion `ret == self->nfds' failed.
Mar 13 19:10:04 pi-google-assist systemd[1]: gassistpi.service: Main process exited, code=killed, status=6/ABRT
Mar 13 19:10:04 pi-google-assist systemd[1]: gassistpi.service: Failed with result 'signal'.
Mar 13 19:10:04 pi-google-assist systemd[1]: gassistpi.service: Service RestartSec=100ms expired, scheduling restart.
Mar 13 19:10:04 pi-google-assist systemd[1]: gassistpi.service: Scheduled restart job, restart counter is at 14.
Mar 13 19:10:04 pi-google-assist systemd[1]: Stopped Google Assistant-Voice.
shivasiddharth commented 3 years ago

This is an old issue and was solved with the Dec release of the Raspberry Pi OS. What kernel version are you on ?

JahFyahh commented 3 years ago

I had to run the respeaker installation with the compat switch due to it failing during the installation. initially i used HinTak's driver version, but ran it with yours to see if that prevented the errors

I'm running the following:

pi@pi-google-assist:~ $ uname -a
Linux pi-google-assist 5.4.51+ #1333 Mon Aug 10 16:38:02 BST 2020 armv6l GNU/Linux
pi@pi-google-assist:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

If need be I can start from scratch with HinTak's version...

shivasiddharth commented 3 years ago

If you see these release notes https://downloads.raspberrypi.org/raspios_armhf/release_notes.txt you can see that so many audio related issues were fixed with the Dec and Jan release. Rolling down negates all those stuff. I need some time to look into things. In the meanwhile you could try this. Uninstall Respeaker drivers, delete the old seeed-voicecard folder, restart and clone this branch https://github.com/HinTak/seeed-voicecard/tree/v5.5 using git clone https://github.com/HinTak/seeed-voicecard -b v5.5 and then go through the installation process.

JahFyahh commented 3 years ago

I started from scratch and reinstalled everything according, but now I am getting the following error, Gassist keeps restarting itself as well.

Mar 14 15:52:19 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 14 15:52:45 pi-google-assist python[715]: [0262fd28] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Mar 14 15:52:45 pi-google-assist python[715]: [0263b5e8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Mar 14 15:52:46 pi-google-assist python[715]: Initializing GPIOs 5 and 6 for assistant activity indication
Mar 14 15:52:56 pi-google-assist python[715]: INFO:snowboy:Keyword 1 detected at time: 2021-03-14 15:52:56
Mar 14 15:52:56 pi-google-assist python[715]: python: src/hostapi/alsa/pa_linux_alsa.c:3641: PaAlsaStreamComponent_BeginPolling: Assertion `ret == self->nfds' failed.
Mar 14 15:52:57 pi-google-assist systemd[1]: gassistpi.service: Main process exited, code=killed, status=6/ABRT
Mar 14 15:52:57 pi-google-assist systemd[1]: gassistpi.service: Failed with result 'signal'.
Mar 14 15:52:57 pi-google-assist systemd[1]: gassistpi.service: Service RestartSec=100ms expired, scheduling restart.
Mar 14 15:52:57 pi-google-assist systemd[1]: gassistpi.service: Scheduled restart job, restart counter is at 3.
Mar 14 15:52:57 pi-google-assist systemd[1]: Stopped Google Assistant-Voice.

Kernel info

pi@pi-google-assist:~ $ uname -a
Linux pi-google-assist 5.10.17+ #1403 Mon Feb 22 11:26:13 GMT 2021 armv6l GNU/Linux
pi@pi-google-assist:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
shivasiddharth commented 3 years ago

Th Respeaker drivers are a mess right now. Did you go through the updation process via the startup menu that you get on first boot ? Which branch of HinTak's drivers did you use now ?

shivasiddharth commented 3 years ago

I would suggest you to try the following. Uninstall the seeed-voicecard drivers and then do a reboot. Try if this works https://github.com/waveshare/WM8960-Audio-HAT the card is very much identical to the Respeaker 2 Mic HAT. The waveshare HAT misses out on the APA102 LEDs but the codec is all the same.

JahFyahh commented 3 years ago

I did the routine installation of the seeed drivers, because the v5.5 branch also failed, i went with the drivers from HinTak's master branch, with that the speaker-test worked. I didn't get any startup menu on first boot. I did no manual update as your instructions described.

I removed the seeed drivers, installed the waveshare drivers and rebooted. The drivers work if i do a speaker-test, and Gassist does not seam to be restarting, but its also not responding to Ok, Google or Hey, Google. The journal says the following:

-- Logs begin at Mon 2021-03-15 08:50:58 CET. --
Mar 15 08:51:28 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 15 08:52:23 pi-google-assist python[481]: [00e04d28] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Mar 15 08:52:24 pi-google-assist python[481]: [00e105e8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Mar 15 08:52:25 pi-google-assist python[481]: Initializing GPIOs 5 and 6 for assistant activity indication
shivasiddharth commented 3 years ago

The journal is truncated can you post the full journal output using journalctl -u gassistpi.service -f

JahFyahh commented 3 years ago

That is the full journal, I used the same command as you posted. After the previous output nothing else happens, no matter how hard I scream at google. When I restarted the service, I still get the same output, only that time it did restart itself a couple of times.

At one point I also got the following msg in the error:

Mar 15 09:04:21 pi-google-assist python[485]: python: src/hostapi/alsa/pa_linux_alsa.c:3641: PaAlsaStreamComponent_BeginPolling: Assertion `ret == self->nfds' failed. 
shivasiddharth commented 3 years ago

Check the config.yaml. By default, I have set the wakewords to Alexa and Snowboy. Hey Google or Ok Google is not the default wakeword. If you want, you can change the wakeword in the config.yaml file. Just make sure to check that you provide the paths to the models that are there in the resources directory.

JahFyahh commented 3 years ago

I tried it with snowboy as wake word and it does react, but it restarts again, below the journal after 2 tries.

Could al this be related to the fact that I am using Raspian Buster Lite? I also tried on the full desktop version, but that gave me issues with ReSpeaker as the headphone volume is 0% at boot.

Which Raspbian version do you recommend?

Mar 15 10:02:15 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 15 19:53:25 pi-google-assist python[479]: [00d79d28] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Mar 15 19:53:26 pi-google-assist python[479]: [00d855e8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Mar 15 19:53:27 pi-google-assist python[479]: Initializing GPIOs 5 and 6 for assistant activity indication
Mar 15 19:53:52 pi-google-assist python[479]: INFO:snowboy:Keyword 2 detected at time: 2021-03-15 19:53:52
Mar 15 19:53:53 pi-google-assist python[479]: python: src/hostapi/alsa/pa_linux_alsa.c:3641: PaAlsaStreamComponent_BeginPolling: Assertion `ret == self->nfds' failed.
Mar 15 19:53:53 pi-google-assist systemd[1]: gassistpi.service: Main process exited, code=killed, status=6/ABRT
Mar 15 19:53:53 pi-google-assist systemd[1]: gassistpi.service: Failed with result 'signal'.
Mar 15 19:53:54 pi-google-assist systemd[1]: gassistpi.service: Service RestartSec=100ms expired, scheduling restart.
Mar 15 19:53:54 pi-google-assist systemd[1]: gassistpi.service: Scheduled restart job, restart counter is at 1.
Mar 15 19:53:54 pi-google-assist systemd[1]: Stopped Google Assistant-Voice.
Mar 15 19:53:54 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 15 19:54:19 pi-google-assist python[587]: [01f42d28] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Mar 15 19:54:19 pi-google-assist python[587]: [01f4e5e8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Mar 15 19:54:20 pi-google-assist python[587]: Initializing GPIOs 5 and 6 for assistant activity indication
Mar 15 19:55:53 pi-google-assist python[587]: INFO:snowboy:Keyword 2 detected at time: 2021-03-15 19:55:53
Mar 15 19:55:54 pi-google-assist python[587]: python: src/hostapi/alsa/pa_linux_alsa.c:3641: PaAlsaStreamComponent_BeginPolling: Assertion `ret == self->nfds' failed.
Mar 15 19:55:54 pi-google-assist systemd[1]: gassistpi.service: Main process exited, code=killed, status=6/ABRT
Mar 15 19:55:54 pi-google-assist systemd[1]: gassistpi.service: Failed with result 'signal'.
Mar 15 19:55:54 pi-google-assist systemd[1]: gassistpi.service: Service RestartSec=100ms expired, scheduling restart.
Mar 15 19:55:54 pi-google-assist systemd[1]: gassistpi.service: Scheduled restart job, restart counter is at 2.
Mar 15 19:55:54 pi-google-assist systemd[1]: Stopped Google Assistant-Voice.
Mar 15 19:55:54 pi-google-assist systemd[1]: Started Google Assistant-Voice.
shivasiddharth commented 3 years ago

Can you check if pulseaudio is installed and up to date ?

JahFyahh commented 3 years ago

PulseAdio was not installed. at the moment I am following these instructions as it seams to be the same type of problem from this point: https://github.com/shivasiddharth/GassistPi/issues/1014#issuecomment-635077153

Edit: It does seam to work now, Snowboy hears me but I get no reply. Its journal:

Mar 16 20:05:49 pi-google-assist pulseaudio[611]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.
Mar 16 20:05:50 pi-google-assist systemd[1]: gassistpi.service: Main process exited, code=killed, status=15/TERM
Mar 16 20:05:50 pi-google-assist systemd[1]: gassistpi.service: Succeeded.
Mar 16 20:05:50 pi-google-assist systemd[1]: Stopped Google Assistant-Voice.
Mar 16 20:06:18 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 16 20:06:51 pi-google-assist pulseaudio[736]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Mar 16 20:06:51 pi-google-assist pulseaudio[736]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Mar 16 20:06:52 pi-google-assist python[706]: Initializing GPIOs 5 and 6 for assistant activity indication
Mar 16 20:07:01 pi-google-assist python[706]: INFO:snowboy:Keyword 2 detected at time: 2021-03-16 20:07:01
Mar 16 20:07:05 pi-google-assist python[706]: what time is it
Mar 16 20:07:52 pi-google-assist python[706]: INFO:snowboy:Keyword 2 detected at time: 2021-03-16 20:07:52
Mar 16 20:07:55 pi-google-assist python[706]: what time is it
shivasiddharth commented 3 years ago

Does speaker-test work ?

JahFyahh commented 3 years ago

Yes that works, after I manually increase the volume of the ReSpeaker headphones (this resets on every boot)

JahFyahh commented 3 years ago

My steps from scratch with the latest Raspbian destop image

  1. raspi-config: Change password, hostname, timezone, WLAN zone, expand card
  2. apt install: git tmux
  3. git clone and install https://github.com/waveshare/WM8960-Audio-HAT

that failed

DKMS: add completed.
Error! echo
Your kernel headers for kernel 5.4.83+ cannot be found at
/lib/modules/5.4.83+/build or /lib/modules/5.4.83+/source.
  1. reboot now
  2. uninstall https://github.com/waveshare/WM8960-Audio-HAT
  3. reboot now
  4. install https://github.com/waveshare/WM8960-Audio-HAT (worked this time)
  5. sudo rm /etc/xdg/autostart/piwiz.desktop (running headless, this stops the screenreader msg)
  6. reboot now
  7. speaker-test works (white noise)
  8. git clone and install https://github.com/shivasiddharth/GassistPi
  9. Forgot the move the client secret, ran the installer again with success
  10. reboot now
  11. Ran the headless scripts

journalctl -u gassistpi.service -f

-- Logs begin at Wed 2021-03-17 10:53:08 CET. --
Mar 17 11:17:37 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 17 11:18:13 pi-google-assist pulseaudio[892]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Mar 17 11:18:13 pi-google-assist pulseaudio[892]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Mar 17 11:18:13 pi-google-assist pulseaudio[892]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
Mar 17 11:18:14 pi-google-assist python[879]: Initializing GPIOs 5 and 6 for assistant activity indication
Mar 17 11:18:16 pi-google-assist python[879]: WARNING:root:Device config not found: [Errno 2] No such file or directory: '/home/pi/.config/googlesamples-assistant/device_config.json'
Mar 17 11:20:45 pi-google-assist python[879]: INFO:snowboy:Keyword 2 detected at time: 2021-03-17 11:20:45
Mar 17 11:20:46 pi-google-assist pulseaudio[892]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.

The last line keeps repeating itself until I restart the service. After restart I see the following journal, untill i say snowboy then it loops the line again: pi-google-assist pulseaudio[892]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.

Mar 17 11:22:58 pi-google-assist systemd[1]: Stopping Google Assistant-Voice...
Mar 17 11:22:58 pi-google-assist pulseaudio[963]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.
Mar 17 11:22:58 pi-google-assist pulseaudio[963]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.
Mar 17 11:22:58 pi-google-assist systemd[1]: gassistpi.service: Main process exited, code=killed, status=15/TERM
Mar 17 11:22:58 pi-google-assist systemd[1]: gassistpi.service: Succeeded.
Mar 17 11:22:58 pi-google-assist systemd[1]: Stopped Google Assistant-Voice.
Mar 17 11:22:58 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 17 11:23:29 pi-google-assist pulseaudio[1022]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Mar 17 11:23:29 pi-google-assist pulseaudio[1022]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Mar 17 11:23:29 pi-google-assist pulseaudio[1022]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
Mar 17 11:23:30 pi-google-assist python[1010]: Initializing GPIOs 5 and 6 for assistant activity indication
shivasiddharth commented 3 years ago

Does the manual start work ?

JahFyahh commented 3 years ago

I'm afraid not, running manually gives me this:

pi@pi-google-assist:~ $ /home/pi/env/bin/python -u /home/${USER}/GassistPi/src/main.py --project_id 'pi--assist-67406' --device_model_id 'pi--assist-67406-pi-google-assist-pandze'
Traceback (most recent call last):
  File "/home/pi/GassistPi/src/main.py", line 51, in <module>
    from google.assistant.library import Assistant
ModuleNotFoundError: No module named 'google.assistant.library'
shivasiddharth commented 3 years ago

You need to start the pushbutton manually not the main.py. https://gassistpi-documentation.readthedocs.io/en/latest/headless.html#steps-to-manually-start-the-assistant

JahFyahh commented 3 years ago

ohh right, I ran, i get no errors. When i call out Snowboy it triggers and gets my command, but then silence.... This is the output:

pi@pi-google-assist:~ $ /home/${USER}/env/bin/python -u /home/${USER}/GassistPi/src/pushbutton.py --project-id 'pi--assist-67406' --device-model-id 'pi--assist-67406-pi-google-assist-pandze'
Initializing GPIOs 5 and 6 for assistant activity indication
INFO:snowboy:Keyword 2 detected at time: 2021-03-17 16:17:21
what time is it
shivasiddharth commented 3 years ago

Can you check if the audio out is actually set to DAC ? Pi for some reason automatically changes audio to HDMI sometimes on boot.

JahFyahh commented 3 years ago

I did sudo raspi-config > System options > Audio and this is set to the WM8960 drivers (this is the only option there by the way)

is there another way to check and change this?

shivasiddharth commented 3 years ago

Move you mouse over the audio icon on the taskbar. It should give Audio Out and Audio In devices list. Select the HAT as the Audio Out Device. Also at the first instance of Google Assistant running, the audio volume should be low. Give "Set volume to Maximum" command. This situation is similar to the one posted by one of the users before. Sometimes, the audio will be muted on start (only in case of WM8960 based devices). You need to install pulseaudio control using sudo apt-get install pavucontrol. Open pavucontrol from the menubar. It should be under Audio Configuration.. etc. Check if the audio is muted.

After triggering the assistant you should hear a "bleep" audio. Let me know if you hear that. These are some of my thoughts.

Once you get the manual start working, we can work on the service (autostart).

JahFyahh commented 3 years ago

I run it in headless mode, but I connected a monitor just to check this. When I hover the mouse over the audio icon is see 'volume control 100' when I right click on it u get 'No audio devices found', but when it started I did hear the assistant chime and 'hi' message.

According to pavucontrol, all sounds are at 100%. In the playback and Recording tab I see python3.7 ALSA Capture/Playback both on 100% The output devices tab only shows Built-in Audio Input Devices and Configuration tabs show no available devices

After starting Gassist manually I see that python is using the audio as well (2 capture & 1 playback). But it does not respond to Snowboy anymore.

shivasiddharth commented 3 years ago

Check this video that was shared by another user. https://www.youtube.com/watch?v=d0FDop-fuJY In that, when the python audio starts playing, you can clearly see a red cross. You are in the same boat as #1109 .

JahFyahh commented 3 years ago

Did you ever get those cards to test with?

shivasiddharth commented 3 years ago

Its been held up at customs for well over 2 weeks. Not cleared yet.

JahFyahh commented 3 years ago

I just put the autologin to desktop via raspi-config and now it seams to be working when I run manually. It's still a bit buggy but this could be due to the low specs of the pi ZeroW, On boot I have to set the headphones volume manually.

pi@pi-google-assist:~ $ /home/${USER}/env/bin/python -u /home/${USER}/GassistPi/src/pushbutton.py --project-id 'pi--assist-67406' --device-model-id 'pi--assist-67406-pi-google-assist-pandze'
Initializing GPIOs 5 and 6 for assistant activity indication
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 14:49:42
what time
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 14:50:02
what are you doing
ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred
WARNING:root:SoundDeviceStream write underflow (size: 1600)
Continuing conversation
what time is it
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 14:58:59
show me
Continuing conversation
i want to know the time
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 14:59:26
play some music
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 15:00:57
play some music on spotify
stopping vlc
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.25.10; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes

Directory: /tmp/

Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: female-say.mp3 ...

MPEG 2.0 L III cbr32 24000 mono

[0:01] Decoding of female-say.mp3 finished.
some music on spotif
Traceback (most recent call last):
  File "/home/pi/GassistPi/src/pushbutton.py", line 959, in <module>
    main()
  File "/home/pi/env/lib/python3.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/env/lib/python3.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/pi/env/lib/python3.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pi/env/lib/python3.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/GassistPi/src/pushbutton.py", line 938, in main
    start_detector()
  File "/home/pi/GassistPi/src/pushbutton.py", line 927, in start_detector
    sleep_time=0.03)
  File "/home/pi/GassistPi/src/snowboydecoder.py", line 172, in start
    callback()
  File "/home/pi/GassistPi/src/pushbutton.py", line 915, in detected
    continue_conversation=assistant.assist()
  File "/home/pi/env/lib/python3.7/site-packages/tenacity/__init__.py", line 241, in wrapped_f
    return self.call(f, *args, **kw)
  File "/home/pi/env/lib/python3.7/site-packages/tenacity/__init__.py", line 330, in call
    start_time=start_time)
  File "/home/pi/env/lib/python3.7/site-packages/tenacity/__init__.py", line 279, in iter
    return fut.result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/home/pi/env/lib/python3.7/site-packages/tenacity/__init__.py", line 333, in call
    result = fn(*args, **kwargs)
  File "/home/pi/GassistPi/src/pushbutton.py", line 559, in assist
    spotify_playlist_select(str(usrcmd).lower())
  File "/home/pi/GassistPi/src/actions.py", line 1532, in spotify_playlist_select
    playlists,num=scan_spotify_playlists()
  File "/home/pi/GassistPi/src/actions.py", line 1481, in scan_spotify_playlists
    if spotify_token:
NameError: name 'spotify_token' is not defined
shivasiddharth commented 3 years ago

Glad we are making progress. Custom commands have specific command syntax. Only with that it will work. Please check the documentation for using the custom commands.

JahFyahh commented 3 years ago

Ohh yeah or course, forgot about that one.

unfortunately, when using the automated start it throws errors at me when I call snowboy

pi@pi-google-assist:~ $ journalctl -u gassistpi.service -f                                                           -- Logs begin at Thu 2021-03-18 15:59:20 CET. --
Mar 18 15:59:47 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 18 16:01:40 pi-google-assist pulseaudio[839]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Mar 18 16:01:40 pi-google-assist pulseaudio[839]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Mar 18 16:01:40 pi-google-assist pulseaudio[839]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
Mar 18 16:01:43 pi-google-assist python[374]: Initializing GPIOs 5 and 6 for assistant activity indication
Mar 18 16:02:39 pi-google-assist python[374]: INFO:snowboy:Keyword 2 detected at time: 2021-03-18 16:02:39
Mar 18 16:02:39 pi-google-assist pulseaudio[839]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.
Mar 18 16:02:39 pi-google-assist pulseaudio[839]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.
Mar 18 16:02:40 pi-google-assist pulseaudio[839]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.
Mar 18 16:02:42 pi-google-assist python[374]: what is the time
Mar 18 16:02:43 pi-google-assist pulseaudio[839]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.
JahFyahh commented 3 years ago

I just added the api key to the config.yaml and ran Gassist manually and tried the bellow but no sound/music and snowboy is not listening to me anymore (got his headphones on listening to my music choice):

pi@pi-google-assist:~ $ /home/${USER}/env/bin/python -u /home/${USER}/GassistPi/src/pushbutton.py --project-id 'pi--assist-67406' --device-model-id 'pi--assist-67406-pi-google-assist-pandze'
Initializing GPIOs 5 and 6 for assistant activity indication
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 16:20:28
play happy from youtube
stopping vlc
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.25.10; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes

Directory: /tmp/

Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: female-say.mp3 ...

MPEG 2.0 L III cbr32 24000 mono
shivasiddharth commented 3 years ago

You should hear some audio messages like getting music links etc. Do you get them ? There are lot more comments from youtube feature that should be printed which are missing.

JahFyahh commented 3 years ago

No I am not hearing anything, After a reboot it stopped working, I also disabled the service from starting.

pi@pi-google-assist:~ $ /home/${USER}/env/bin/python -u /home/${USER}/GassistPi/src/pushbutton.py --project-id 'pi--assist-67406' --device-model-id 'pi--assist-67406-pi-google-assist-pandze'
Initializing GPIOs 5 and 6 for assistant activity indication
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 17:42:21
tell me something
JahFyahh commented 3 years ago

When I enable the service restart and stop the service and run Gassist manually it works again. When trying to play youtube it gets the link (about a minute), returns the link but playback really dodgy

pi@pi-google-assist:~ $ /home/${USER}/env/bin/python -u /home/${USER}/GassistPi/src/pushbutton.py --project-id 'pi--assist-67406' --device-model-id 'pi--assist-67406-pi-google-assist-pandze'
Initializing GPIOs 5 and 6 for assistant activity indication
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 17:53:05
what time is it
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 17:53:19
tell me a joke
ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred
WARNING:root:SoundDeviceStream write underflow (size: 2732)
ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred
WARNING:root:SoundDeviceStream write underflow (size: 1600)
ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred
WARNING:root:SoundDeviceStream write underflow (size: 2732)
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 17:53:39
play happy from youtube
stopping vlc
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.25.10; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes

Directory: /tmp/

Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: female-say.mp3 ...

MPEG 2.0 L III cbr32 24000 mono

[0:01] Decoding of female-say.mp3 finished.
happy
https://r5---sn-5hnekn7z.googlevideo.com/videoplayback?expire=1616108068&ei=xIVTYMnuBcjB1gLyp7GAAg&ip=94.157.204.121&id=o-AJjfry-d8LGfIuF3ook7-N2EU-9of5nN2Y6tzkep79tA&itag=140&source=youtube&requiressl=yes&mh=4s&mm=31%2C29&mn=sn-5hnekn7z%2Csn-5hne6nzs&ms=au%2Crdu&mv=m&mvi=5&pl=16&gcr=nl&initcwndbps=1993750&vprv=1&mime=audio%2Fmp4&ns=ybOQRRm47WaYm_d5hmyC_msF&gir=yes&clen=3895821&dur=240.674&lmt=1584647994407070&mt=1616086373&fvip=5&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=5431432&n=EvFJPzUhQKvwLMk2wa&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgRfeGvp5rnC-bHDnOfx_Yu2CFO-M3eizP90heLZ-tfRoCIFD4BIQkHmY019vtMdUOFATZWJusj9hd6_udkvZyFwUU&sig=AOq0QJ8wRAIgHmtModyoNrbbUPpsryO_SXr3bMPlAfDgmRH_6q4y97UCIFLJ33XXRsz-kKBJ1sMM9Qb5GQicngb7IjJOtwzJpWcP
[85533bc8] mp4 demux: Fragment sequence discontinuity detected 1 != 0

Do I have to wait for the song to end before being able to call on snowboy again?

JahFyahh commented 3 years ago

at the moment its working but it keeps on "listening", after every command the listening sound goes off even in silence. How to stop it? Can I stop it midsentence?

shivasiddharth commented 3 years ago

From my understanding, you mean that Assistant automatically expects a second query after your first? If that's the case, then probably you have continued conversation enabled in the Google Home app.

Open Google Home app, press on the account photo or pic at the top right corner, select Assistant Settings, then scroll down untill you reach Continued Conversation. Select that and disable that.

shivasiddharth commented 3 years ago

Pi Zero is not ideal for music or advanced features. So please do not have high expectations.

JahFyahh commented 3 years ago

Understood, what is the minimal recommended pi? Pi2B?

Now need to see how to get it working headless from boot. The service still fails

pi@pi-google-assist:~ $ journalctl -u gassistpi.service -f                                                           -- Logs begin at Thu 2021-03-18 17:46:00 CET. --
Mar 18 17:50:26 pi-google-assist pulseaudio[882]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.
Mar 18 17:50:26 pi-google-assist pulseaudio[882]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.
Mar 18 17:50:30 pi-google-assist python[399]: tell me a joke
Mar 18 17:50:31 pi-google-assist pulseaudio[882]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.
Mar 18 17:52:01 pi-google-assist systemd[1]: Stopping Google Assistant-Voice...
Mar 18 17:52:01 pi-google-assist pulseaudio[882]: [alsa-sink-bcm2835-i2s-wm8960-hifi wm8960-hifi-0] alsa-sink.c: Error opening PCM device hw:0,0: Device or resource busy
Mar 18 17:52:01 pi-google-assist systemd[1]: gassistpi.service: Main process exited, code=killed, status=15/TERM
Mar 18 17:52:01 pi-google-assist systemd[1]: gassistpi.service: Succeeded.
Mar 18 17:52:01 pi-google-assist systemd[1]: Stopped Google Assistant-Voice.
Mar 18 18:47:27 pi-google-assist systemd[1]: Started Google Assistant-Voice.
Mar 18 18:48:02 pi-google-assist pulseaudio[1834]: [pulseaudio] module.c: Failed to load module "module-alsa-sink" (argument: "device=hw:0,0"): initialization failed.
Mar 18 18:48:02 pi-google-assist pulseaudio[1834]: [pulseaudio] module.c: Failed to load module "module-alsa-source" (argument: "device=hw:0,0"): initialization failed.
Mar 18 18:48:02 pi-google-assist pulseaudio[1834]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Mar 18 18:48:02 pi-google-assist pulseaudio[1834]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Mar 18 18:48:02 pi-google-assist pulseaudio[1834]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
Mar 18 18:48:03 pi-google-assist python[1815]: Initializing GPIOs 5 and 6 for assistant activity indication

And the manual command does not know when to stop, it this a setting somewhere I could tweak?

JahFyahh commented 3 years ago

After a series of reboots it stopped working again, after calling snowboy and the first request is does nothing any more. Will try again tomorrow to see why its not responding

pi@pi-google-assist:~ $ /home/pi/env/bin/python -u /home/pi/GassistPi/src/pushbutton.py --project-id pi--assist-67406 --device-model-id pi--assist-67406-pi-google-assist-pandze
Initializing GPIOs 5 and 6 for assistant activity indication
INFO:snowboy:Keyword 2 detected at time: 2021-03-18 21:06:03
snowboy
shivasiddharth commented 3 years ago

I would recommend nothing below Pi 3B, which itself is almost a 4 year old board. To fix autostart try this:

Do: sudo nano /boot/config.txt

There should be a line dtparam=audio=on add a # at the start. Save the file and reboot. Check what happens.

JahFyahh commented 3 years ago

I already took those steps based on your comment You are in the same boat as #1109 .

shivasiddharth commented 3 years ago

Can you post the outpus of:

aplay -l
arecord -l
sudo nano /etc/asound.conf
sudo nano ./.asoundrc