[alsa-devel] [topic/asoc][RFC 0/1] ASoC: OMAP: Add support for mono link configuration to McBSP DAI

Jarkko Nikula jarkko.nikula at nokia.com
Mon Nov 24 14:45:33 CET 2008


On Mon, 24 Nov 2008 13:28:57 +0000
"ext Mark Brown" <broonie at sirena.org.uk> wrote:

> > +struct snd_soc_dai omap_mcbsp_dai_mono[] = {
> > +	OMAP_MCBSP_DAI_BUILDER(0, 1, 1),
> > +	OMAP_MCBSP_DAI_BUILDER(1, 1, 1),
> 
> Is it not possible to have the DAI switch between mono and stereo at
> runtime rather than having a DAI for each?  That's the normal approach.
> The core should constrain things based on the capabilities of the
> connected device.
>
OMAP McBSP DAI can do almost anything :-)

My problem was this kind of switching correct to do in machine driver?

	cpu_dai->playback.channels_min = 1;
	cpu_dai->playback.channels_max = 1;
	cpu_dai->capture.channels_min = 1;
	cpu_dai->capture.channels_max = 1;

Defining channels_min = 1 in omap_mcbsp_dai initializer would cause that
link is then switching between mono/stereo depending what user space is
asking.

Like "aplay -c 1 /dev/urandom" causes that all machines having codec
with "channels_min = 1" and "channels_max = 2" would cause incorrect
mono link configuration where alsalib should do the mono->stereo
conversion instead and vice versa for pure mono link.


Jarkko


More information about the Alsa-devel mailing list