[alsa-devel] [RFC] Channel mapping API
Takashi Iwai
tiwai at suse.de
Tue Aug 21 16:49:56 CEST 2012
At Tue, 21 Aug 2012 15:18:00 +0100,
Mark Brown wrote:
>
> [1 <text/plain; us-ascii (7bit)>]
> On Tue, Aug 21, 2012 at 04:13:53PM +0200, David Henningsson wrote:
>
> > It reminds me of the discussion we had about jack labelling (for HDA
> > or everyone? I do not remember), where we ended up having
>
> > 1) physical location (left side, internal, docking station)
> > 2) type (headphone, speaker)
> > 3) channel map (front, rear, c/lfe)
>
> > Maybe that's where this discussion is heading as well? I like the
> > idea of having the same TLV description for jacks, mixer controls
> > and PCM channels, maybe that could work for all but the most exotic
> > cases?
>
> > (Where exotic means unusual hw on both the pro-audio and the embedded side)
>
> Or perhaps what we want to do here is define the channel mapping in
> terms of saying "I'm connecting to this input/output" and then use the
> jack interface to describe all inputs and outputs rather than just jacks
> (making sure it's easy to see which ones can change state)?
It's an interesting idea. But, in the case of HDMI, there are no
multiple jacks, so this won't fit.
What I had in my mind originally is to provide the definition of
values in TLV, and get/set points the value index.
For example,
val1 = front left
val2 = front right
...
then chmap would contain a list like {1,2}.
And the value can be a complex of location + type, such as
val1 = front left at speaker
val2 = front left at headphone
val3 = front right at speaker
val4 = front right at headphone
then chmap can be {1,3} or {1,2}.
So, we can provide one new TLV block of the channel value definitions:
TLV_CHMAP_VALUES
chval, position, type(hp/spk),
chval, position, type,
...
followed by the list of available maps. But I didn't take it as I
thought it might be too complex. If needed, this can be taken as an
optional TLV block.
However, this doesn't help much for multiple output cases like
ice1712. So far, I ignored that case intentionally. The primary goal
of this API is to provide a way for apps to decide the channel map for
multi-channel streams. If multiple positions are given, what they
should do? It'd be just confusing.
Of course, there might be more use cases. But I'm afraid that
supporting the multiple outputs per channel would end up with too deep
references and hard to manage.
At least, some fixed multiple outputs could be covered by the free
definition of the chmap value like above (e.g. by allowing multiple
assignments per channel in the definition block). But whether to
cover all flexible multiple outputs per channel, I hesitate to go
forward...
Takashi
More information about the Alsa-devel
mailing list