<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-text-flowed" style="font-size: 16px;"
lang="x-western">On 07.11.2011 11:23, Colin Guthrie wrote:
<br>
<blockquote type="cite" style="color: #000000;">'Twas brillig, and
Ben Bucksch at 07/11/11 02:55 did gyre and gimble:
<br>
<blockquote type="cite" style="color: #000000;">On 07.11.2011
03:34, Ben Bucksch wrote:
<br>
<blockquote type="cite" style="color: #000000;">Is there a
module that can run a (configurable) shell command when
<br>
<br>
* sound output is needed, i.e. an application plays a
sound, and
<br>
it's not muted
<br>
* no sound output is needed anymore, after a certain
configurable
<br>
timeout, e.g. no sound played in the last 120 minutes
<br>
<br>
? Effectively, this would work exactly like a screen saver,
just for
<br>
sound, not for the screen/input.
<br>
</blockquote>
FYI: Ford_Perfect pointed me to
<br>
<a class="moz-txt-link-freetext"
href="http://0pointer.de/blog/projects/device-reservation.html">http://0pointer.de/blog/projects/device-reservation.html</a>
<br>
<a class="moz-txt-link-freetext"
href="http://git.0pointer.de/?p=reserve.git;a=blob_plain;f=reserve.txt">http://git.0pointer.de/?p=reserve.git;a=blob_plain;f=reserve.txt</a>
<br>
<br>
(if anybody has better solutions, please let me know)
<br>
</blockquote>
Ahh interesting. Yeah you could use this to know when PA is
playing
<br>
sound. All you'd need is a simple dbus integration and you could
write
<br>
your app accordingly completely separate of PA.
<br>
<br>
The other option is to get your hands dirty, write a module in
PA and
<br>
use that.
<br>
<br>
I think other people may have posted similar modules in the
past, but it
<br>
won't be too difficult to do it either way -
module-suspend-on-idle will
<br>
have pretty much all the infrastructure you'd need.
<br>
<br>
Of course some apps misbehave (e.g. flash) and keep their
streams around
<br>
even when they are not playing and thus may need some kind of
special
<br>
handling here that you probably won't get via dbus or idle
status.
<br>
</blockquote>
<br>
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 <b
class="moz-txt-star"><span class="moz-txt-tag">*</span>must<span
class="moz-txt-tag">*</span></b> turn off anyway.
<br>
<br>
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?
<br>
<br>
<blockquote type="cite" style="color: #000000;">other people may
have posted similar modules in the past
<br>
</blockquote>
<br>
Do you have the URL of them, or at least remember some keywords to
search for?
<br>
<br>
<br>
Ben
<br>
</div>
</body>
</html>