Raspberry Pi GPIO Audio Amp control with relays using squeezlite

I have had a project in the making for some time. We use a Raspberry Pi with a Squeezeplug image to run Squeezelight on it to do basic audio out in our bathroom. As an amp I use the Dayton DTA-1. The amp has to be manually turned on and off each time we use it. This is subobtimal, as the whole idea behind the Logitech Media Server is to be able to use an app to use it.

While researching I came across the Squeezelite RPI GPIO project. It is a drop in replacement for the squeezelight binary provided by the Squeezeplug guys. To get it to work you need to change the code in a few places.

First log into your Raspberry Pi as root.

Get the latest git version of Squeezelite RPI GPIO:git clone https://code.google.com/r/phermann2-squeezelite-rpi-gpio/
cd phermann2-squeezelite-rpi-gpio/