[pulseaudio-discuss] [PATCH v0 09/16] bluetooth: Move streams during shutdown

Tanu Kaskinen tanuk at iki.fi
Wed Oct 17 06:29:36 PDT 2012

On Mon, 2012-10-15 at 04:28 +0200, Mikel Astiz wrote:
> Hi Tanu,
> On Sun, Oct 14, 2012 at 6:47 PM, Tanu Kaskinen <tanuk at iki.fi> wrote:
> > On Fri, 2012-09-28 at 17:45 +0200, Mikel Astiz wrote:
> >> From: Mikel Astiz <mikel.astiz at bmw-carit.de>
> >>
> >> If sink and sources exist during shutdown, the streams need to be moved
> >> exactly as when the profile is being set to off.
> >
> > Why? I thought that moving streams during profile change is done because
> > it's supposedly a good policy to keep the streams at the same device
> > before and after a profile switch. That doesn't apply during device
> > unload, so am I missing the real purpose for the moving, or is this
> > patch unnecessary?
> This might be a lack of knowledge from my side about stream moving.
> What I understood from the code (specially from the bluetooth module)
> is that the modules needed to report the core that something should be
> done with these streams, and then routing policies would apply
> (possibly implemented in some other policy module).

No, there's no need to report that something needs to be done with the
streams. That information is already available through the sink unlink
hook - when a sink is about to get unlinked, policy modules can react to
that in some way. An example of that is module-rescue-streams, which
moves the streams somewhere.

module-rescue-streams does not, however, implement the same policy as
what module-bluetooth-device does currently. The sink/source of the new
profile is not yet created when the sink/source of the old profile is
unlinked, and module-rescue-streams has no idea that the "right"
sink/source will appear soon, so it moves the streams away from the
bluetooth device.

If it's deemed necessary, module-bluetooth-policy could react to the
profile change events and do what module-bluetooth-device is currently
doing internally.


More information about the pulseaudio-discuss mailing list