[pulseaudio-discuss] Moving sources and sinks
Lennart Poettering
lennart at poettering.net
Mon May 5 18:26:07 PDT 2008
On Sat, 03.05.08 23:55, Tanu Kaskinen (tanuk at iki.fi) wrote:
> > Phew. Anyway the second question was not really answered fully. It
> > might be my imprecision in stating the problem so let me try to
> > distill it to the bare bones: For pulseaudio I'd like to know how or
> > if a virtual stream can be created in pulse allowing on the fly
> > redirection to an ALSA sink, that is the crux of the question that I'm
> > searching for an answer. I'd like in an alsa program (or set of
> > programs) to write to a virtual device and have pulse route all audio
> > on that device to a sink, and be able to switch sinks on the fly.
> > I've spent a couple weeks looking into this and I think I've made
> > quite a lot of progress but that part is not clear.
>
> It's not possible with current virtual devices. The virtual
> devices that you can create don't allow their streams (the
> ones from the virtual device to the destination sinks) to be
> moved.
This is an artificial limitation, btw. It's the respective module that
sets the PA_SINK_INPUT_DONTMOVE flag to tell the PA core not to allow
moving of the streams. I added this because it kind of contradicts the
explicit configuration the user gave before. But primarily the reason
is that I was to lazy to implement the code that makes sure that the
sink description follows the move. I.e. that "LADSPA sink on foobar"
changes to "LADSPA sink on waldo" if you move it's stream from foobar
to waldo. Also in the case of module-combine (especially in automatic
mode) moving those backend streams is really pointless.
Patches welcome. I guess I could be talked into dropping
PA_SINK_INPUT_DONTMOVE for the LADSPA and remap sinks if someone
supplies a patch that implements the "description fix" properly.
As I mentioned somewhere else: the right way to do this thing is
writing a small module that hooks into the stream creation and chooses
a device based on the role (or "class" or whatever you call it) of a
stream. A bit like module-match+module-volume-restore+some more
magic. And of course, we'd need to teach all apps to send PA the class
of their streams. A temporary fix is to set the environment var for
PULSE_PROP_media.role to "video", and so one before starting the
client in question. Like this:
PULSE_PROP_media.role="phone" pacat /dev/urandom
PULSE_PROP_media.role="music" pacat /dev/urandom
You get the idea.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss
mailing list