[alsa-devel] [PATCH] add channel order setting interface in asoc core

Mark Brown broonie at opensource.wolfsonmicro.com
Fri Sep 11 12:25:56 CEST 2009

On Fri, Sep 11, 2009 at 05:03:42PM +0800, Barry Song wrote:

> As discussed, I am adding a patch to add an interface to set the
> relationship between audio channel No. and slot No.
> The interface should be really useful because nobody can ensure
> audio channel n always uses slot n in all platforms. And for some
> devices, the relationship even can change with sound mode switch
> in 2.1,3.1,4.1,5.1,6.1,7.1.
> After the patch is applied, I can change bfin stuff based on it.

This is the right idea but some updates would be nice:

>  /**
> + * snd_soc_dai_set_channel_order - configure DAI audio channel order

Please rename to snd_soc_dai_set_channel_map.

> + * @dai: DAI
> + * @num: how many channels
> + * @slot: pointer to an array which imply the slot number channel 0~num-1 uses
> + *
> + * configure the relationship between channel number and TDM slot number.

I'd say something line

   'Pointer to an array of data sources.  Each element specifies the
    data slot in the source data which will be used for that slot index
    in the output data.'

It'd also be better if the API separate transmit and receive mappings -
having separate tx_num, tx_slot and rx_num, rx_slot should do the trick.

More information about the Alsa-devel mailing list