'Twas brillig, and Ben Bucksch at 07/11/11 02:55 did gyre and gimble: > On 07.11.2011 03:34, Ben Bucksch wrote: >> Is there a module that can run a (configurable) shell command when >> >> * sound output is needed, i.e. an application plays a sound, and >> it's not muted >> * no sound output is needed anymore, after a certain configurable >> timeout, e.g. no sound played in the last 120 minutes >> >> ? Effectively, this would work exactly like a screen saver, just for >> sound, not for the screen/input. > > FYI: Ford_Perfect pointed me to > http://0pointer.de/blog/projects/device-reservation.html > http://git.0pointer.de/?p=reserve.git;a=blob_plain;f=reserve.txt > > (if anybody has better solutions, please let me know) Ahh interesting. Yeah you could use this to know when PA is playing sound. All you'd need is a simple dbus integration and you could write your app accordingly completely separate of PA. The other option is to get your hands dirty, write a module in PA and use that. I think other people may have posted similar modules in the past, but it won't be too difficult to do it either way - module-suspend-on-idle will have pretty much all the infrastructure you'd need. Of course some apps misbehave (e.g. flash) and keep their streams around even when they are not playing and thus may need some kind of special handling here that you probably won't get via dbus or idle status. Col Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited http://www.tribalogic.net/ Open Source: Mageia Contributor http://www.mageia.org/ PulseAudio Hacker http://www.pulseaudio.org/ Trac Hacker http://trac.edgewall.org/