[pulseaudio-discuss] Audio routing policy

Janos Kovacs jankovac503 at gmail.com
Mon Oct 17 04:31:42 PDT 2011


Hi,

On Mon, Oct 17, 2011 at 1:35 PM, Mark Brown <broonie at sirena.org.uk> wrote:
> On Fri, Oct 14, 2011 at 03:27:58PM +0300, Janos Kovacs wrote:
>
>> So the idea is to use a modified device manager, David's jack
>> detection (with the port support for cards) and a stripped version of
>> Margarita's UCM patches.
>
> I think this sounds like an excellent approach and it's fantastic that
> you're working on this.  Feng Wei from Linaro has recently started
> looking at the UCM stuff as well, I've CCed him in here.

The first attempt is to map UCM verbs directly to alsa card profiles with the
combination with combination of certain UCM modifiers. We would have
profiles like "HiFi: Play Music", "HiFi Low Power: Play Music + Capture Music",
"Voice Call: Play Voice + Capture Voice", "Voice Call IP: Play Voice" etc. In
addition we would have PA ports derived from the availabe UCM devices and
some other modifiers like "Play Tone". In addition we could/should generate
the combination devices  (e..g. speaker+headset, etc.) since only one port
can be active at the time.

This is somewhat different that Margarita did, but I try to reuse bits and bolts
of her work where I can.

The device manager than could track all the streams (i.e sink-inputs and
source-outputs). Based on the media.role property we could priorize the streams.
It is quite easy to make a hardmapping between the media roles and proposed
profiles. For instance everything but phone would map to HiFi + "Play Music" or
"Capture Music" depending wheter the stream is sink-input or source-output.
We would merge those profiles in decreasing priority order (ruling out the
conflicting ones). The device manager would set this merged profiles
on each card.
The device manager would also figure out the ports to be used and then
assign the
streams to the the sinks/sources.

So I guess this current idea is also incorporating Tanu's proposal to
set the profiles
by device manager not by the policy directly.

This is just an idea and try to hack a prototype to see how it work, what sort
constraints we need to put up with and last but not least some ideas what
modifications PA or UCM would need.

I am optimistic but it is also possible that the whole thing cannot be done. :(


>
>> Challenges:
>> - A resonable mapping of profiles and ports to UCM verbs+devices+modifiers.
>
> I'd have expected profiles to correspond to verbs and devices to
> correspond to ports, though obviously the issue with multiple devices
> per port below does apply.
>
>> - Multiple accessories of same kind (e.g. simultaneous use of multiple
>> BT devices, like car-kit and headset)
>>   since we have just one 'bluetooth' UCM device
>
> These usually just get assigned per-function names - the same issue
> exists on most modern phones where you have a selection of microphones
> on the device used in different use cases.
>


br
-janos-


More information about the pulseaudio-discuss mailing list