From: Takashi Iwai <tiwai@suse.de>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [RFC] Channel mapping API
Date: Tue, 21 Aug 2012 14:15:19 +0200 [thread overview]
Message-ID: <s5hipcc30h4.wl%tiwai@suse.de> (raw)
In-Reply-To: <50337316.4080208@ladisch.de>
At Tue, 21 Aug 2012 13:37:58 +0200,
Clemens Ladisch wrote:
>
> Takashi Iwai wrote:
> > this is a progress report of my longstanding TODO, the channel map API
> > implementation. I'm going to cover this at Plumbers audio uconf, so
> > we can discuss details there, too.
>
> I won't be there, so ...
It's a pity.
> > The channel mapping API provides a method for user-space to query, get
> > and set the channel map of a PCM stream. It's required for assigning
> > channels properly for multi-channel streams.
>
> This doesn't handle devices with simply numbered outputs (such as many
> ICE1712-based devices), or cases where one PCM channel can be routed to
> multiple outputs. However, those devices typically have their own mixer
> applets, and generic applications aren't interested in configuring them.
For such devices, this is a bit hard, indeed. In theory, query should
return all possible channel maps the PCM stream covers. This can be
calculated somehow statically.
For getting the channel map, the driver could send a notification once
when routing is changed.
> > snd_pcm_get_chmap() returns the currently assigned channel map for the
> > given PCM stream. If the PCM is before prepared, it fills UNKNOWN.
>
> So channel maps are reset when a device is reopened?
The behavior isn't defined, so far, and I don't think it has to be
reset.
> > * WRITE OPERATION
> >
> > This operation is allowed only at PCM PREPARED state. When called in
> > other states, it shall return an error.
>
> This sounds like an hda-intel HDMI restriction; other chips allow
> rerouting at any time. (And the route plugin could allow that, too.)
The only reason get/set doesn't work before hw_params is that the
number of channels isn't set. In other words, before hw_params, the
hardware state is still undetermined. Thus the channel map should be
undetermined either.
Strictly speaking, the function can check whether hw_params channels
parameter is already set to single. But, from the practical POV, it
becomes easier by checking PREPARED state in the end.
thanks,
Takashi
next prev parent reply other threads:[~2012-08-21 12:15 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 10:31 [RFC] Channel mapping API Takashi Iwai
2012-08-21 11:24 ` David Henningsson
2012-08-21 11:44 ` Clemens Ladisch
2012-08-21 12:06 ` Takashi Iwai
2012-08-21 13:13 ` Takashi Iwai
2012-08-21 11:37 ` Clemens Ladisch
2012-08-21 12:15 ` Takashi Iwai [this message]
2012-08-21 12:31 ` Jaroslav Kysela
2012-08-21 12:35 ` Takashi Iwai
2012-08-21 13:14 ` Takashi Iwai
2012-08-21 14:00 ` David Henningsson
2012-08-21 14:06 ` Mark Brown
2012-08-21 14:13 ` David Henningsson
2012-08-21 14:18 ` Mark Brown
2012-08-21 14:49 ` Takashi Iwai
2012-08-21 15:38 ` Clemens Ladisch
2012-08-21 16:27 ` Mark Brown
2012-08-21 17:05 ` Takashi Iwai
2012-08-21 17:11 ` Mark Brown
2012-08-21 19:29 ` Takashi Iwai
2012-08-21 15:49 ` Mark Brown
2012-08-21 14:52 ` David Henningsson
2012-08-21 15:07 ` Mark Brown
2012-08-21 15:38 ` David Henningsson
2012-08-21 16:34 ` Mark Brown
2012-08-21 17:09 ` Takashi Iwai
2012-08-21 17:57 ` Mark Brown
2012-08-21 13:59 ` Mark Brown
2012-08-21 14:08 ` Takashi Iwai
2012-08-21 14:12 ` Mark Brown
2012-08-21 18:03 ` Pierre-Louis Bossart
2012-08-21 19:23 ` Takashi Iwai
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=s5hipcc30h4.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.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.