prupert
Posts: 29
Joined: Sun Dec 30, 2012 9:20 pm

Google Assistant / AIY Project Autostart Wierdness

Mon Aug 19, 2019 9:56 pm

Hi

I have a really odd Autostart issue with Google Assistant (GA).

I've had GA running fine for a few years on a minimal Rasbian install, installed via the github source: https://github.com/google/aiyprojects-raspbian. GA stopped working about a month ago, seemingly due to expired credentials as Google has changed the accounts and permissions you need to setup / enable to install your over version of GA.

I updated GA from github and followed the instructions to create the relevant account settings and authorisations and everything worked once again...APART from being able to autostart GA on boot.

I'm using systemd and below is my system file.

Code: Select all

[Unit]
Description=Google Assistant
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/python3 /home/pi/AIY-projects-python/src/examples/voice/main.py
Restart=always
User=pi
Group=pi
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=google_assistant

[Install]
WantedBy=multi-user.target
The odd thing is, if I manually run the systemd file, GA starts fine:

Code: Select all

 $ sudo systemctl restart google_assistant.service
$ sudo systemctl status google_assistant.service
● google_assistant.service - Google Assistant
   Loaded: loaded (/etc/systemd/system/google_assistant.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-08-19 21:48:11 UTC; 7s ago
 Main PID: 1277 (python3)
    Tasks: 28 (limit: 4915)
   CGroup: /system.slice/google_assistant.service
           ├─1277 /usr/bin/python3 /home/pi/AIY-projects-python/src/examples/voice/main.py
           └─1292 /usr/bin/pulseaudio --start --log-target=syslog

Aug 19 21:48:11 pi1 systemd[1]: Started Google Assistant.
Aug 19 21:48:14 pi1 pulseaudio[1292]: [pulseaudio] sink.c: Default and alternate sample rates are the same.
Aug 19 21:48:14 pi1 pulseaudio[1292]: [pulseaudio] source.c: Default and alternate sample rates are the same.
Aug 19 21:48:15 pi1 pulseaudio[1292]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to
Aug 19 21:48:15 pi1 pulseaudio[1292]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaun
Aug 19 21:48:15 pi1 google_assistant[1277]: INFO:root:ON_MUTED_CHANGED:
Aug 19 21:48:15 pi1 google_assistant[1277]:   {"is_muted": false}
But on reboot, whilst the system runs the service file, GA doesn't start and this is what I see in the logs, no error message and no forked pulseaudio:

Code: Select all

 $ sudo systemctl status google_assistant.service
● google_assistant.service - Google Assistant
   Loaded: loaded (/etc/systemd/system/google_assistant.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-08-19 21:18:24 UTC; 6min ago
 Main PID: 491 (python3)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/google_assistant.service
           └─491 /usr/bin/python3 /home/pi/AIY-projects-python/src/examples/voice/main.py

Aug 19 21:18:24 pi1 systemd[1]: Started Google Assistant.
I assume its either a permissions issue with the user that GA is autostarted at, or some timing issue with GA starting too soon.

Anyone any idea on the issue or how to fix?

Return to “Troubleshooting”