[alsa-devel] [RFC PATCH] ASoC: omap-mcbsp: Add support for highter rate up to 384000

Michael Trimarchi michael at amarulasolutions.com
Thu Aug 8 13:04:10 CEST 2013


Hi

On Thu, Aug 08, 2013 at 01:51:25PM +0300, Peter Ujfalusi wrote:
> On 08/07/2013 09:28 PM, Michael Trimarchi wrote:
> > Add support for highter rate up to 384000Khz. There are codecs in the
> > market that can play up to this frequency.
> > Test was done just with:
> > 
> > #define OMAP_MCBSP_RATES	(SNDRV_PCM_RATE_8000_192000)
> > 
> > playing wav file 32bit/192000Khz stereo. Some glitch has observed
> > but this should depend on the selected min buffer bytes that was
> > left untouched in aplay and in the omap-pcm driver.
> > 
> > Signed-off-by: Michael Trimarchi <michael at amarulasolutions.com>
> > ---
> >  sound/soc/omap/omap-mcbsp.c |    8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
> > index 7483efb..1e95f6a 100644
> > --- a/sound/soc/omap/omap-mcbsp.c
> > +++ b/sound/soc/omap/omap-mcbsp.c
> > @@ -39,7 +39,9 @@
> >  #include "mcbsp.h"
> >  #include "omap-mcbsp.h"
> >  
> > -#define OMAP_MCBSP_RATES	(SNDRV_PCM_RATE_8000_96000)
> > +#define OMAP_MCBSP_RATES	(SNDRV_PCM_RATE_8000_192000 |		\
> 
> I think only this change is enough for what you want to achieve.
> 
> > +				 SNDRV_PCM_RATE_CONTINUOUS |		\
> > +				 SNDRV_PCM_RATE_KNOT)
> 
> The _KNOT is for sure not needed and I would not set the CONTINUOUS either.

pcm5102pw is a codec that support 384000 rate so I think that PCM_RATE_KNOT
is requested for such rate. Correct?

> 
> >  
> >  #define OMAP_MCBSP_SOC_SINGLE_S16_EXT(xname, xmin, xmax, \
> >  	xhandler_get, xhandler_put) \
> > @@ -574,11 +576,15 @@ static struct snd_soc_dai_driver omap_mcbsp_dai = {
> >  		.channels_max = 16,
> >  		.rates = OMAP_MCBSP_RATES,
> >  		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
> > +		.rate_min = 8000,
> > +		.rate_max = 384000,
> 
> Why you want to limit the rates here?
> 

I didn't find in the market somenthing up to 384000.

Michael

> >  	},
> >  	.capture = {
> >  		.channels_min = 1,
> >  		.channels_max = 16,
> >  		.rates = OMAP_MCBSP_RATES,
> > +		.rate_min = 8000,
> > +		.rate_max = 384000,
> 
> Same here, do not set these.
> 
> >  		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
> >  	},
> >  	.ops = &mcbsp_dai_ops,
> > 
> 
> 
> -- 
> Péter



More information about the Alsa-devel mailing list