From: Tanu Kaskinen <tanuk@iki.fi>
To: Takashi Iwai <tiwai@suse.de>
Cc: Raymond Yau <superquad.vortex2@gmail.com>,
alsa-devel@alsa-project.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@ti.com>
Subject: Re: How to define card specific pcm devices?
Date: Sat, 08 Sep 2012 11:04:39 +0300 [thread overview]
Message-ID: <1347091479.3351.15.camel@laptop> (raw)
In-Reply-To: <s5hobliw4ys.wl%tiwai@suse.de>
On Fri, 2012-09-07 at 11:35 +0200, Takashi Iwai wrote:
> At Fri, 07 Sep 2012 12:03:34 +0300,
> Tanu Kaskinen wrote:
> > A question about the syntax: should the PHASE_INVERSE and DRIVER_SPEC
> > flags be supported also here, or is it enough to have just a simple list
> > of channels?
> >
> > I think the syntax will have to support the flags, because if
> > DRIVER_SPEC is set, then the channel position is effectively unknown to
> > PulseAudio. The channel map may potentially affect routing decisions,
> > which is the main reason why the channel map information is needed in
> > UCM in addition to the new channel map API. The channel map API can be
> > used only with an already opened pcm handle, which is not very useful
> > when doing routing decisions.
>
> Well, the kernel side API doesn't require that the PCM to be open.
> It's just a read of TLV from a control element.
>
> The problem is that the configuration is evaluated only at open in
> alsa-lib PCM abstraction. That's the only reason chmap query takes
> snd_pcm_t handle.
>
> In other words, it's pretty easy to provide a query function limited
> only for hw device, such as
>
> snd_pcm_chmap_query_t **snd_pcm_query_chmaps_from_hw(int card, int device,
> int substream);
>
> Ideally it should be a query from a PCM name string like
>
> snd_pcm_chmap_query_t **snd_pcm_query_chmaps_from_name(const char *name);
>
> But it's hard for now without opening a PCM because we need to parse
> down the definition of the given PCM and the underlying plugin
> expansions require the opens of their slave PCMs.
I now realized that even if we had snd_pcm_query_chmaps_from_name(), the
channel map information would still be needed in the UCM configuration.
For example on N900, all audio playback and capture is done through hw:0
with two channels (the pcm can't be opened in mono mode). In different
situations the channel map is different: sometimes only one channel of
the pcm is useful. Getting a list of channel maps from
snd_pcm_query_chmaps_from_hw() doesn't tell PulseAudio which channel map
is the right one, so this information needs to come from the UCM
configuration.
So, I was wrong when I said that the main reason for having the channel
map information in UCM is that the chmap API can only be used when the
pcm is open.
--
Tanu
prev parent reply other threads:[~2012-09-08 8:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-10 11:25 How to define card specific pcm devices? Tanu Kaskinen
2012-08-17 14:50 ` Tanu Kaskinen
[not found] ` <CAN8cciYX4krbJvb9PWQFswAKq0AqiC_oh20n+NB2Ak=BF8Zgxw@mail.gmail.com>
2012-08-18 1:26 ` Raymond Yau
2012-08-18 4:09 ` Tanu Kaskinen
2012-08-24 4:20 ` Raymond Yau
2012-08-29 1:44 ` Raymond Yau
2012-09-05 5:41 ` Tanu Kaskinen
[not found] ` <CABS+qY3kEPr3aknPvTU+iRyGxSo2G_iDawv+fr7WBJrJQUO+2w@mail.gmail.com>
2012-09-06 17:18 ` Liam Girdwood
2012-09-07 9:03 ` Tanu Kaskinen
2012-09-07 9:35 ` Takashi Iwai
2012-09-08 8:04 ` Tanu Kaskinen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347091479.3351.15.camel@laptop \
--to=tanuk@iki.fi \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@ti.com \
--cc=superquad.vortex2@gmail.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.