neophyte I'm using a Rpi3 with HifiBerry DAC+ I have a relay, that turns on and off my amplifier, connected to GPIO pin. I have a script running in the background that takes care of turning off and on the amplifier, whit this line: mpc status | grep playing > /dev/null However, when I use airplay, the music player daemon is not used, and therefore the amp is turned off by the script. Is there a similar command line interface to the airplay like the one above for mpc? So it would something like this: if [ mpc status | grep playing > /dev/null ] || [ airplay status | grep active ]; then #set GPIO high
hondagx35 Hi neophyte, i would use cat /proc/asound/card*/pcm*/sub*/status | grep state: because this will work with all playback sources (mpd, airplay, UPnP and Spotify). Frank
fboe hondagx35 wroteHi neophyte, i would use cat /proc/asound/card*/pcm*/sub*/status | grep state: because this will work with all playback sources (mpd, airplay, UPnP and Spotify). Frank Hi neophyte and Frank Will anyone of you share the script to control a relay? Cheers
rern fboe wrote Will anyone of you share the script to control a relay? How about this [Addon] RuneUI GPIO for power on / off audio equipments.