I am building a discrete amplifier which iwamtto combine with a raspi + dac + volumio…
I dont mind letting the pi run 24/7 andcontrol itfrom my smartphone…
But the amplifier i am building is a class A amplifier which iwould like to turn on when start some music and turn off if nothing has been pmayed for like 5 mnutes or so…
Hooking it up to a gpio pin shouldnt be too hard hardware wise but how to control it??
Even a basic on/off button on the user interface would be fine. Sadly i lack the programming skills…
You would need to create a script that looks at the play status, look and see if there is something playing or not. If there is nothing playing you could automatically cut the power to the amp.
I would also recommend to look at this thread: gpio-pins-control-volume-t2219.html
That thread currently has the best how-to on getting the GPIO’s to work.
Currently there is no way to control the GPIO’s via the web-page, you would DIY this if you want that.
I’ve made the request for user-definable buttons, you would be able to use a button to trigger your personal script. I hope this will be implemented, but i dont have influence on that (not a dev, just a mod )
Hi there im new to volumio and need some help. I have the same goal as the thread opener, i want to switch my amplifier on and off if an airplay signal comes in. I try to use a counter which counts to 10 and an add +1 to “count” if CPU usage is zero. If the count of “count” is greater than 8 the amp goes to sleep. My goal is to have script which can be used with any application PID such as MPD Squeezplayer Shairport etc. Thanks to johneff from raspberry forum i started with his code and modified it further.
#!/bin/bash
# Standby Script to switch an GPIO if an App is running is Playing.
trap "echo \"17\" >/sys/class/gpio/unexport" EXIT
echo "17" >/sys/class/gpio/export
echo "out" >/sys/class/gpio/gpio17/direction
while :; do
counter=0
for i in $(seq 1 10)
do
if ['(top -b -p $(pgrep shairport) -n1 | awk 'FNR==8{print $9}'$
then counter=$counter+1
fi
done
if [ $counter -le 8 ];
then
echo "1" >/sys/class/gpio/gpio17/value
sleep 1
counter=0
else
echo "0" >/sys/class/gpio/gpio17/value
sleep 1
counter=0
fi
done
I want to create simple daemon that will turn off my active speakers (by relay) if no music is played, thus, i need to check what volumio is doing.
How to check if music is currently played or user acts with volumio ? any way by tcp socket, shared mem, named pipes, any other interproc communication ?
how is volumio using mpd ? is mpd working all the time? or maybe run only during actual playback/decoding ?
is it just enough to check if mpd daemon is working ?