Hi all, I'm trying to come up with a way to detect when the soundcard is outputting anything so that I can use that to trigger turning on my attached speakers (via GPIO).
I can monitor /proc/asound/card0/pcm0p/sub0/status but there is no asynchronous solution as procfs doesn't appear to generate any inotify events (not surprising but I thought it was worth trying...).
I tested busylooping using watch 'head -n1 /proc/asound/card0/pcm0p/sub0/status'. With this set to refresh every 0.25-0.5s I'm using around 5% CPU. Presumably if I write it in C this will come down. But this solution sucks!
Hoping someone here can point me to a better way. I see reference to "callbacks" all over the ALSA docs, but I don't think it's what I want.
