Provide USB sound output for Alexa Voice Services (useful for the Raspberry Pi Zero) + headless restart
Running AVS on a Raspberry Pi zero doesn’t work out of the box. The reason is that the installation script provides no output via USB is because this is not available in the script. In my opinion this is something that is just overlooked as making the changes manually is not hard at all:
Put the following text to the .asoundrc file in your home directory (/home/pi/.asoundrc)
1 2 3 4 5 6 7 8 9 10 11 |
pcm.!default { type plug slave { pcm "plughw:1,0" } } ctl.!default { type hw card 1 } |
This will allow usb input and output from AVS.
Autostart
Create a file using nano .config/autostart/AlexaPi.desktop with following content:
1 2 3 4 5 6 |
[Desktop Entry] Name=AlexaPi Comment= Exec=/home/pi/Desktop/alexaStart.sh Terminal=false Type=Application |
The AlexaStart script contains the following (requires TMUX):
1 2 3 4 5 6 7 |
export DISPLAY=localhost:1.0 #To make it show on my VNC session tmux kill-session -t wakeWord tmux kill-session -t javaClient tmux new -d -s companionService "cd /home/pi/Desktop/alexa-avs-sample-app/samples/companionService && npm start" tmux new -d -s javaClient "cd /home/pi/Desktop/alexa-avs-sample-app/samples/javaclient && mvn exec:exec" tmux new -d -s wakeWord "cd /home/pi/Desktop/alexa-avs-sample-app/samples/wakeWordAgent/src && ./wakeWordAgent -e kitt_ai" |