[pulseaudio-discuss] Loading module-null-sink when no real sinks found.

Colin Guthrie gmane at colin.guthr.ie
Wed Mar 12 15:10:27 PDT 2008


Lennart Poettering wrote:
> Hmm, I thought of something like this before, however I am not sure if
> I really like the idea. It hides bugs and misconfiguration and might
> confuse people even more. (i.e. "mum, my music is playing, but I don't
> hear nothing, regardless how much I play around with the volume
> controls"!) They right place to fix those issues you mentioned is in
> the apps themselves -- i.e fix the bug where the bug is. The
> pavucontrol fix is trivial -- I just need to come around and actually
> do it ;-)

:) Yeah I don't disagree with your points there.


> However, OTOH this might indeed come handy in some situations. So I am
> not generally opposed to the idea as long as it is just another module
> that may be load -- but doesn't have to be.

Yeah that was my take too.

> Implementing this properly might be not as simple as it sounds. For
> the rescue module to work the null sink needs to exist already when
> the last real sink is dying. To make this work you thus need to hook
> into SINK_UNLINK, then load the null module there, and make sure your
> hook function is called before the rescue hook function is
> called. There might be some issues to fix first though, because
> loading modules and thus modifying the list of sinks from a hook is
> not necessarily working right now. Fix should be trivial but possibly
> hard to find.

I had a go at writing this... see my later message in this thread for
the code. This is pretty much what I did and it appears to load and
unload the null sink at the appropriate times.

I've written where my confusion is in the other mail so I wont bother
repeating it, but in summary the SINK_UNLINK bit seems to work but the
SINK_NEW_POST one, or rather the subsequent move of the streams by
module-rescue-streams when the null sink is removed and a real sink is
available is not working quite smoothly which is odd IMO as
rescue-streams and my module both hook to SINK_UNLINK (and it seems to
work fine) but only mine hooks to SINK_NEW_POST (which is the bit that
has issues). Hmmmmmmmm :s

Col




More information about the pulseaudio-discuss mailing list