[pulseaudio-discuss] [PATCH 0/2] New module, allow-passthrough

Arun Raghavan arun at accosted.net
Sat May 31 21:22:28 PDT 2014

On Mon, 2014-05-19 at 15:59 +0200, Sjoerd Simons wrote:
> XBMC 13 has been release recently with a nice new revamped pulseaudio backend,
> allowing it to properly use passthrough with pulseaudio.. However one issue
> with passthrough remains, it absolutely needs exclusive access to the sink.
> The default policy in pulseaudio is to only allow exclusive access if nothing
> else is currently using the sink. The following patches add a module that
> essentially turns that up-side-down, if a new passthrough stream comes in
> everything else is moved out of the way. This policy is more suitable then the
> default in case passthrough streams typically correspond to higher priority
> audio, e.g. movie audio rather then events.
> Some point for discussion in this patchset, first of all we choose to use dummy
> (null sink) to redirect active streams to rather then corking. In my personal
> experience a lot of player application react badly to corking, while
> redirecting is mostly transparent to the applications.

Even when corking does work, you'll need to move the sinks away. The
passthrough routing logic requires that the sink have no sink inputs

That said, does this really need to be an either-or decision? I think it
would be nicer to have a cork-request sent along with moving to the null
sink, and an uncork-request to be sent after. There's a bit of
additional complexity here since you will need to keep track of whether
the sink input is already corked and not send an uncork-request while
moving it back. IMO this should help make this module more useful for
some desktop users who'd like similar behaviour.

> Futhermore a bit of pulseaudio core policy has to be duplicate by this module
> as there is no hook in place which is guaranteed to run after the sink
> selection & format negotiation has been done.

I see two possibilities to fix this better. The first is that we add a
ROUTED hook between NEW and FIXATE to let modules be informed when
routing is completed. The second is factor out that code into

> Maybe as a final note, for ease of development the module recognizes the
> media.role "fake-passthrough" and handles it like it would a real passthrough
> stream. (Guillaume doesn't even have a passthrough capable amplifier and mine
> is hooked into my HTPC setup rather then in my home office, so not very
> convenient for testing)

Might make more sense to add a set_formats() to null-sink so that we can
have actual fake passthrough sinks.

-- Arun

More information about the pulseaudio-discuss mailing list