[pulseaudio-discuss] "Speaker saver" module to notify when sound is needed and when not
Ben Bucksch
linux.news at bucksch.org
Mon Nov 7 03:31:36 PST 2011
On 07.11.2011 11:23, Colin Guthrie wrote:
> '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.
Ah. That's why I said "an application plays a sound" not "a source is
connected". I have apps connected constantly, e.g. an mplayer on pause.
This is normal in my usecases, the speakers *must* turn off anyway.
If the dbus trick doesn't provide that, I can't use that. Does
module-suspend-on-idle handle this case? Can I hook up a shell command
there?
> other people may have posted similar modules in the past
Do you have the URL of them, or at least remember some keywords to
search for?
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20111107/885cc73e/attachment-0001.htm>
More information about the pulseaudio-discuss
mailing list