alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: David Henningsson <david.henningsson@canonical.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [RFC] Channel mapping API (take 2)
Date: Wed, 05 Sep 2012 08:49:29 +0200	[thread overview]
Message-ID: <5046F5F9.7090002@canonical.com> (raw)
In-Reply-To: <s5hhard23jb.wl%tiwai@suse.de>

On 09/04/2012 05:47 PM, Takashi Iwai wrote:
> Hi,
>
> my proposal for channel mapping API seems accepted fairly well through
> discussions at Plumbers, so I continued to work on it and uploaded the
> updated version.
>
> The kernel part is found in sound-unstable tree topic/tlv-chmap branch
>    git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable.git
>
> and the alsa-lib part is found in github tree topic/chmap branch
>    git://git.github.com/tiwai/alsa-lib.git
>
> The updated parts are:
>
> - SNDRV_CHMAP_NA was newly added, indicating the channel is not
>    available or silent.
>
> - The channel position value is masked in lower 16bit.
>    The upper bits are used for more channel attributes as bit flags.
>
>    #define SNDRV_CHMAP_POSITION_MASK	0xffff
>
>    The phase inverted channel has this bit:
>    #define SNDRV_CHMAP_PHASE_INVERSE	(0x01 << 16)
>
>    And the driver-specific non-standard channel position has this:
>    #define SNDRV_CHMAP_DRIVER_SPEC	(0x02 << 16)

Just a comment here:

If this is meant to be used for those (mostly pro-audio) cards that just 
have their outputs in simple numbers, maybe we should call it

#define SNDRV_CHMAP_NUMBERED

instead?

>
> - The alsa-lib API functions use snd_pcm_chmap_query_t and
>    snd_pcm_chmap_t instead of ambiguous integer arrays.
>
> ================================================================
> /** the channel map header */
> typedef struct snd_pcm_chmap {
> 	unsigned int channels;
> 	unsigned int pos[0];
> } snd_pcm_chmap_t;
>
> /** the header of array items returned from snd_pcm_query_chmaps() */
> typedef struct snd_pcm_chmap_query {
> 	enum snd_pcm_chmap_type type;
> 	snd_pcm_chmap_t map;
> } snd_pcm_chmap_query_t;
>
>
> snd_pcm_chmap_query_t **snd_pcm_query_chmaps(snd_pcm_t *pcm);
> void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps);
> snd_pcm_chmap_t *snd_pcm_get_chmap(snd_pcm_t *pcm);
> int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map);
> ================================================================
>
> The rest aren't so much changed.  Only slight bug fixes.
>
> A big remaining question is whether the current kernel-side
> implementation is OK.  We may add some PCM ops pointer instead of the
> current style using the direct control tlv/read/write override.

That seems nicer, probably.

Also, if nothing is implemented on the kernel side for the specific 
driver (e g we have many older drivers that I suspect no one will write 
an implementation for), what will alsa-lib return in that case?


-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

  parent reply	other threads:[~2012-09-05  6:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04 15:47 [RFC] Channel mapping API (take 2) Takashi Iwai
2012-09-05  6:00 ` Tanu Kaskinen
2012-09-05  6:17   ` Takashi Iwai
2012-09-05  6:38     ` Tanu Kaskinen
2012-09-05  6:49 ` David Henningsson [this message]
2012-09-05  6:59   ` Takashi Iwai
2012-09-05  8:32 ` David Henningsson
2012-09-05 10:34   ` Takashi Iwai
2012-09-06 11:47 ` Raymond Yau
2012-09-06 11:56   ` Takashi Iwai
2012-09-07  9:16 ` Tanu Kaskinen
2012-09-07  9:43   ` 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=5046F5F9.7090002@canonical.com \
    --to=david.henningsson@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).