Skip to content

Latest commit

 

History

History
91 lines (60 loc) · 2.67 KB

hardware-setup.md

File metadata and controls

91 lines (60 loc) · 2.67 KB

AIY Voice Kit Driver Setup

Overview

There are two ways to get the sound card and button set up on the Raspberry Pi inside the AIY kit box. One is to use the prebuilt AIY disk image. If you go this route there is nothing more to do here - just boot off that disk image, and maybe run a regular sudo apt update && sudo apt upgrade, then go back to the rest of the setup instructions in the SETUP page.

The other approach is to start with a stock release of Raspberry Pi OS and then follow the rest of this guide to set up the sound card and LED button drivers.

From stock Raspbian to playing a sound

This is largely lifted from Google's AIY Projects guide. It assumes you're starting with an assembled Voice Kit - specifically the V2, with Voice Bonnet - and that you've got the Buster release of Raspbian running on the Pi inside it and have keyboard or SSH access set up.

NOTE: I also tried this with the the bullseye release (from Oct/Nov 2021), but for mysterious reasons was not able to get any sound to come out of the raspberry pi speaker. You should probably stick with buster (from before 2021).

1. Add the AIY Debian packages repo

echo "deb https://packages.cloud.google.com/apt aiyprojects-stable main" | sudo tee /etc/apt/sources.list.d/aiyprojects.list

Add Google package keys:

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

Update and install the latest system updates (including kernel):

sudo apt update
sudo apt upgrade

Reboot after update:

sudo reboot

2. RGB Button Driver

sudo apt install leds-ktd202x-dkms

3. Install Voice Bonnet packages

Voice Bonnet requires driver installation:

sudo apt install aiy-voicebonnet-soundcard-dkms

Disable built-in audio:

sudo sed -i -e "s/^dtparam=audio=on/#\0/" /boot/config.txt

Install PulseAudio:

sudo apt install pulseaudio
sudo mkdir -p /etc/pulse/daemon.conf.d/
echo "default-sample-rate = 48000" | sudo tee /etc/pulse/daemon.conf.d/aiy.conf

Reboot:

sudo reboot

4. Verify that you can record audio:

arecord -f cd test.wav

...and play a sound:

aplay test.wav

5. Install vlc

We'll be using cvlc to play ogg audio files from the command line (the version of oggdec available in the buster repository is too old).

sudo apt install vlc