Build an open future with us.

Invest in Mycroft and become a community partner.

Picroft 2018-09-12 and the Google AIY Voice Hat


#1

Today I did download the Picroft 2018-09-12 image, because at


I have been told that
'Over the next few days, the Picroft image will incorporate support for the Google AIY Voice Kit array microphone. "

But there seems to be some “problems” autoconfiguring the Google AIY Voice Hat :frowning:

While installing there have been some dependencies problems with 2 aiy-packets (but the newest version is installed but are is something with the --configure)

At


I did found a info about
“sudo mkdir /usr/lib/systemd/system” and “sudo dpkg --configure aiy-io-mcu-firmware” but this didnt solved the problem.

So Microphone isnt working and I wonder why the speaker-part of the Google AIY Voice Hat isnt useable/selectable (only 3.5mm, HDMI or USB-Audio) like on the 0.9.14 PiCroft AIY Image from the 28th January 2018 at the thread

Maybe someone could show me the way to some informations? :slight_smile:


#2

Hi I have been working on this - If you are up to it, you can test my work. Easiest way is to do:

Install image in SD card and boot up
When booted up exit by Ctrl+C
Then ggra my auto_run.sh by
wget https://raw.githubusercontent.com/andlo/enclosure-picroft/stretch/home/pi/auto_run.sh
and my asound by
wget https://raw.githubusercontent.com/andlo/enclosure-picroft/stretch/home/pi/AIY-asound.conf
Then reboot by
sudo reboot
Follow the installation - as far as I have tested it should instal all the stuf an configure it - AND volume is working to.


#3

Hi Andreas - Thanks for the information, but I couldnt get it to work :frowning:

I flashed the MicroSD card newly with the actual image and did a
apt update && apt upgrade
as root

Then I did get your two files in /home/pi
Your auto_run.sh was saves as auto_run.sh.1 (Saving to: ‘auto_run.sh.1’)
so I had to
root@picroft:/home/pi# mv auto_run.sh auto_run.sh_org
root@picroft:/home/pi# mv auto_run.sh.1 auto_run.sh
root@picroft:/home/pi# chmod 666 auto_run.sh

After a reboot and selecting 4 for the AIY Hat the system did install much files and finally told me

Adding user pulse to group audio
Processing triggers for libc-bin (2.24-11+deb9u3) …
Processing triggers for dbus (1.10.26-0+deb9u1) …
-bash: /boot/config.txt: Permission denied
-bash: /boot/config.txt: Permission denied
-bash: mycroft-core/dev_setup: No such file or directory
Reboot is neded !

After reboot the speaker of the AIY Hat doesnt work :frowning:
Let’s test and adjust the volume:
1-9) Set volume level (1-quietest, 9=loudest)
T)est
R)eboot (needed if you just installed Google Voice Hat or plugged in a USB speaker)
D)one!
Level [1-9/T/D/R]: 7amixer: Unable to find simple control ‘PCM’,0

The Mic seems to record, but cant play back the file (couldnt hear it):

Starting audiotest

== STARTING TO RECORD, MAKE SOME NOISE! ==
== DONE RECORDING, PLAYING BACK… ==

Playing WAVE ‘/tmp/test.wav’ : Signed 16 bit Little Endian, Rate 16000 Hz, Mono

Did you hear the yourself in the audio?

  1. Yes!
  2. No, let’s repeat the test.
  3. No :frowning: Let’s move on and I’ll mess with the microphone later.

At the end mycroft wouldnt start because of errors:

Double requirement given: pip (already in pip==18.0.0, name=‘pip’)
Initializing…
Starting cli
Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.5/runpy.py”, line 109, in _get_module_details
import(pkg_name)
File “/home/pi/mycroft-core/mycroft/init.py”, line 17, in
from mycroft.api import Api
File “/home/pi/mycroft-core/mycroft/api/init.py”, line 26, in
from mycroft.identity import IdentityManager, identity_lock
File “/home/pi/mycroft-core/mycroft/identity/init.py”, line 21, in
from mycroft.util.combo_lock import ComboLock
File “/home/pi/mycroft-core/mycroft/util/combo_lock.py”, line 16, in
from fasteners.process_lock import InterProcessLock
ImportError: No module named ‘fasteners’

And aplay wouldnt find any soundcard, but your asound.conf is copied to /etc/asound.conf
Level [1-9/T/D/R]: 8(.venv) pi@picroft:~ $ aplay -l
aplay: device_list:270: no soundcards found…

(.venv) pi@picroft:~ $ more /etc/asound.conf
defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0

(.venv) pi@picroft:~ $ more AIY-asound.conf
defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0

I dont know whats wrong here - normally thing would go better :frowning:
My AIY Hat did work before with the January 2018 AIY Hat image - so I think I got a v1 AIY Hat.


#4

Hey - that is good information.

Later today I will flash a new install and try if the same as I described. But as I remembered my currently installed picrofts has I been dooing exactly the same.

As soon as I have tested I will let you know how that went.


#5

This is what could be the problem…The changes it wants to make in /boot/config.txt is what enables the AIY, so it makes sense if it dosnt work for you if auro_run.sh fails on changing these things.


#6

The double pip issue is a bug in the latest release of get-pip. There is aproposed fix and Hopefully it’ll be merged into our upstream within the next few hours. Otherwise we’ll do a workaround


#7

Yah have made changes to auto_run.sh so it can change config.txt, but now I got the dubble pip issue :frowning: So I cant test it right now.
Then I have to do house cleaning, dishes and washing close :frowning: I would prefear playing whith picroft :wink:


#8

Hi Team,

Please let us know what the work around could be if the setup issue isn’t fixed today.

Thanks,
Sarath.D


#9

I’ve pulled in a change fixing that particular issue into the dev branch. so if you’re on the dev/unstable branch on picroft it should be pulled in by the auto_update script (on next reboot maybe)


#10

Hi,

I got the dev_setup completed but when I start Mycroft I am not getting any audio responses back (even the sound that says Mycroft got my request/wake word).

Below is the log from audio.log and I did retry unstalling py_mplayer. Not sure what is wrong with my Pi and can you please take a look at your end and let me know if this is just my problem? (Please note I started flashing my Pi with a fresh OS and fresh copy of Mycroft after the above issue). Please note that my regular audio out via 3.5mm jack works (like I can hear audio from Youtube videos etc.

20:48:58.474 - mplayer__init__::20 - ERROR - install py_mplayer with pip install git+https://github.com/JarbasAl/py_mplayer
20:48:58.478 - mycroft.audio.audioservice:load_services:108 - ERROR - Failed to import module mplayer
ImportError(“No module named ‘Queue’”,)
20:48:58.482 - mycroft.audio.audioservice:load_services:102 - INFO - Loading simple


#11

I was able to clean install all the drivers (pulseaudio) and reinstall mycroft and py_mplayer and it finally responded aloud!

But Mycroft responds to my wake word only once (when I start it up in debug mode), Is that expected?


#12

Great to hear!

(sidenote py_mplayer shouldn’t technically be necessary, it’s just a backend for playing music/audio files)

it should respond any number of times. I think @andlo has most experience using the AIY voice hat. Are you running the code from his Pull request?


#13

I made som extra change, so the AYI installation can write to config.txt. I cant figure out how to PR that as i conflikts whit earlier PR. Im an not that good Githubber yet :wink:

I dont think installing Picroft is as smooth prosess as it should be….I think it should be split up so installation of Mycroft is done, update to latest version, and raspbian as well, and then installation og AIY or oher audio equitment. That should be done in other scripts, so adding other hardware should be easy whitout changing auto_run.sh.

But for now - I think my changes is working - trying to do a full install from scratch.


#14

Confirmed - i just made a new install using autorun (and AYIasound.conf) from https://github.com/andlo/enclosure-picroft

It took a long time as it updates raspbian as well and installs a lot of stuff related to AIY

After install it did though have problems starting up - but that were related to mycroft not AIY install.
I did a git pull in /home/pi/mycroft-core and an msm update and then he started up fine and AIY worked both mic and audio and volume skill working to.


#15

I got the code from your github (https://github.com/MycroftAI/mycroft-core).
Just to make sure I was clear, I am not using PiCroft but I am downloading the code and install the code using dev_setup.sh.

Dt# 10/07 Update:
I noticed I am seeing the below in the audio.log and I suspect that this is killing my ability to wake Mycroft after the first time.Still not sure what had to be done to stop this from happening. Any suggestions are greatly appreciated.

“15:50:54.738 - mycroft.audio.audioservice:_stop:252 - DEBUG - stopping all playing services
mpg123: death by SIGTERM”

Thanks for the help.


#16

Because I didnt found a (new) AYIasound.conf in


(and didnt found a stretch in https://github.com/andlo/enclosure-picroft/)
I reused the
wget https://raw.githubusercontent.com/andlo/enclosure-picroft/stretch/home/pi/auto_run.sh
wget https://raw.githubusercontent.com/andlo/enclosure-picroft/stretch/home/pi/AIY-asound.conf
then after reboot and using 4) for the Google Voice Hat
I did a cd in /home/pi/mycroft-core (as pi user) and did the commands
“git pull” and “msm update”

Now when I login I do get the startup-same errors like before:
Traceback (most recent call last):
File “”, line 1, in
File “/home/pi/mycroft-core/mycroft/init.py”, line 17, in
from mycroft.api import Api
File “/home/pi/mycroft-core/mycroft/api/init.py”, line 26, in
from mycroft.identity import IdentityManager, identity_lock
File “/home/pi/mycroft-core/mycroft/identity/init.py”, line 21, in
from mycroft.util.combo_lock import ComboLock
File “/home/pi/mycroft-core/mycroft/util/combo_lock.py”, line 16, in
from fasteners.process_lock import InterProcessLock
ImportError: No module named ‘fasteners’

and if I then select 4) in the setup for the Google Voice Hat the screen will “freeze” - and it seems that he is doing nothing :frowning:

Did I sometihing in the wrong order or are there the 2 (new) files anywhere in

I did only found
https://raw.githubusercontent.com/andlo/enclosure-picroft/master/home/pi/auto_run.sh
but thats seems to be a older cutdown version…

BTW: now there is a soundcard available:
(.venv) pi@picroft:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpigooglevoi [snd_rpi_googlevoicehat_soundcar], device 0: Google voiceHAT SoundCard HiFi voicehat-hifi-0 []
Subdevices: 0/1
Subdevice #0: subdevice #0

User pi cant use (no output) the installed espeak, but as root espeak “Hello” does give output.

(.venv) pi@picroft:~/mycroft-core $ ./start-mycroft.sh audiotest
Initializing…
Starting audiotest

**STARTING TO RECORD, MAKE SOME NOISE! **
DONE RECORDING, PLAYING BACK

Playing WAVE ‘/tmp/test.wav’ : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
aplay: set_params:1299: Sample format non available
Available formats:

  • S32_LE
    An error occured while playing back audio (1)

but mycroft didnt start up :frowning:

Please update dependencies by running ./dev_setup.sh again.
(.venv) pi@picroft:~ $ /home/pi/mycroft-core/dev_setup.sh

python-coveralls 2.9.1 has requirement coverage==4.0.3, but you’ll have coverage 4.5.1 which is incompatible.

After some playing pip was updates from 18.0 to 18.8, but mycroft also do start only with tracebacks…
Microhone does work and I do get a answer via the screen, but not via the speaker… :frowning:


#17

Tat is strange. I just did exactly the same

wget https://raw.githubusercontent.com/andlo/enclosure-picroft/stretch/home/pi/auto_run.sh
wget https://raw.githubusercontent.com/andlo/enclosure-picroft/stretch/home/pi/AIY-asound.conf

then after reboot and using 4) for the Google Voice Hat
I did a cd in /home/pi/mycroft-core (as pi user) and did the commands
“git pull” and “msm update”

And my pi got up and running perfectly.

You have to notise that my changes is in my stretch branch at GitHub

Check if rhere is three lines in /etc/asound.conf - the AIYasound.conf should be copied by the auto_run script. If not -tht is why Mycroft dosnt output any sound i guess.


#18

I did notice (by using the right stretch links) that the changes are in the stretch branch.
As I did check the three lines are right in /etc/asound.conf (the content of your AIY-asound.conf)

After the wget for the auto_run.sh you did also rename auto_run.sh.1 to auto_run.sh
(for getting the option 4) Google Voice hat)?

What did you after “git pull” and “msm update”?

I did a “sudo reboot” and had to select “(Y)es” for config" and then the 4) for Google Voice hat.

Or is there anything other to select when the Pi has been rebooted after the “git pull” and “msm update”?

BTW: Would it be a problem if a HDMI-Monitor is connected to the Pi? (second soundcard?)
I did try it without and with a monitor…

After updating I do allways get this after login:
Traceback (most recent call last):
File “”, line 1, in
File “/home/pi/mycroft-core/mycroft/init.py”, line 17, in
from mycroft.api import Api
File “/home/pi/mycroft-core/mycroft/api/init.py”, line 26, in
from mycroft.identity import IdentityManager, identity_lock
File “/home/pi/mycroft-core/mycroft/identity/init.py”, line 21, in
from mycroft.util.combo_lock import ComboLock
File “/home/pi/mycroft-core/mycroft/util/combo_lock.py”, line 16, in
from fasteners.process_lock import InterProcessLock
ImportError: No module named ‘fasteners’


#19

I dont know if having a HDMI monitor connected should do any good or bad…I ssh’ing to my picrofts.

I first delete auto_run.sh and then wget new one OR wget new one and rename as you do.

Yhen reboot and follow instructions -and reboot again when it sayes it is needed.

Then after reboot before i exiting out of CLI and did git pull and msm update and then reboot

Then i came up.

It isnt a easyly smooth install - i know it could be much better :slight_smile:


#20

So - I did get it working but had to do 3 additional steps! :slight_smile:

When I did try it with the guide above this ebening - I did get stuck the same way:
Traceback error and no reactions wihle selecting the 2nd time the 4) Google Voice hat.

But then after leaving to cli I did read a message to rerun
/home/pi/mycroft-core/dev_setup.sh

This installed/checked something and doenst like pip 18.0 but want to install pip 18.0 :slight_smile:

Some lines later it suggest to install/upgrade to pip 18.1 with
pip install --upgrade pip

After pip 18.1 was installed I did reboot and did exit via N to cli and my-/picroft did start.

But only the Mic does the job :frowning:
aplay -l shows correct
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpigooglevoi [snd_rpi_googlevoicehat_soundcar], device 0: Google voiceHAT SoundCard HiFi voicehat-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

and your 3 lines are also copied correct to /etc/asound.conf

So I checked with alsamixer the Pulseaudio-Ou-Device and it was at 0%
So I changed it to 50% and saved/exited with Escape (alsmixer in a differnt ssh-session).

After that I could ask picorft something and then he do beep and respond via the speaker :slight_smile:

BUT after reboot the volume is at 0% again…
I did try the following:
set volume via alsamixer ad user pi
and
sudo alsactl store

But also again 0% volume after reboot :frowning:

[EDIT] a
sudo -u pi amixer sset Master 75% (as root) or
amixer sset Master 75% (as pi)
in /etc/rc.local (before “exit 0”) could solve the problem
but it did only work from a SSH-shell - maybe I have to add a wait statement?