[alsa-devel] RFC: support for 12 & 24Khz
tiwai at suse.de
Fri Jul 26 09:09:09 CEST 2013
At Fri, 26 Jul 2013 11:39:08 +0530,
Vinod Koul wrote:
> On Thu, Jul 25, 2013 at 06:31:33PM +0200, Takashi Iwai wrote:
> > At Thu, 25 Jul 2013 21:15:01 +0530,
> > Vinod Koul wrote:
> > >
> > > On Thu, Jul 25, 2013 at 08:50:40AM +0200, Clemens Ladisch wrote:
> > > > Vinod Koul wrote:
> > > > > For compressed audio we also need to support the PCM rates of 12 and 24KHz.
> > > > >
> > > > > Looking at pcm.h these are not defined
> > > >
> > > > You don't need such symbols to use a rate. These symbols are intended
> > > > for often-used rates. As long as only one or two drivers use a rate,
> > > > they can just set KNOT and install a constraint.
> > > okay so how exactly is the rate passed to driver and converted and sent to
> > > drivers?
> > Define the own hw_constraint. Usually it's implemented via
> > snd_pcm_hw_constraint_list().
> > > > > But am worried about wider impact of adding these rates.
> > > > >
> > > > > Can you let me know if more is required to be done or below is fine
> > > >
> > > > Grep for 176400 in sound/core/, include/, and in alsa-lib.
> > > SNDRV_PCM_RATE_176400?
> > Heh, this was an already added one. Rather take a look at
> > SNDRV_PCM_RATE_KNOT.
> Okay so the orignal problem is that we use SNDRV_PCM_RATE_XXX to send the sample
> rate to decoder.
Relying only on SNDRV_PCM_RATE_* bits doesn't scale.
What if more other rates are needed at the next time?
> Some decoders very commonly use 12 and 24Khz, so I would like
> them to be added.
> I think 12 and 24 are fairly common rates and should be added. Do you agree?
It's no solution. It makes things easier, though.
Better to fix the code to be able to handle uncommon rates, at first.
More information about the Alsa-devel