Homebrew Airplay speaker

I’m new to the RPi, but have done Arduino projects before. I’d like to make a set of home brew Airplay speakers and Volumio looks like an excellent way to do it in conjunction with a RPi, DAC, ClassD amp and a speaker box. One thing I’d like some advice on is power management. I’d like to reduce power when the speaker is not in use by switching power to the amp via one of the GPIO pins on the RPi. I’d like it to power on when an Airplay signal is present and switch off after a programmable timeout.

I’m not familiar with Volumio yet, so I’d like some advice from someone with a bit more experience. Would I need to get into the Volumio source code or is there an easy way of activating a script when Airplay is working? Is it difficult to access to the GPIO pins?


I’ve done something very similar all in one 2.1 amp. If your using class d amp the power useage is so minimal i wouldn’t worry about saving 1 watt per hour…
Actually in my case i can switch the amp off anyway as the board has a switch that i used - that could be an easy option

Even if the power of an idle class d amp is low, you can with a python script detect the state of airplay and in function command via the gpio a switch to power the amp.


Take a look at this post maybe it will help you to turnm your amp on/off!



shairport (airplay software used in volumio) can be called so that it runs a command/script at the beginning of playback and at the end of playback.

    -B, --on-start=COMMAND  run a shell command when playback begins
    -E, --on-stop=COMMAND   run a shell command when playback ends

if all you are going to do is use it for airplay you could use this to toggle a IO pin on the raspi to then turn on/off your amp.

you just need to insert the command into the init start up script here

you would edit this line. They are currently using the -B command to tell the mpd client to stop playing when airplay starts.

    /usr/local/bin/shairport -d -a "$NAME" -w -B "mpc stop"