All of lore.kernel.org
 help / color / mirror / Atom feed
* Why no Marco definitions for rate 24000 and 12000?
@ 2008-11-14  8:32 cocala
  2008-11-14  8:39 ` Takashi Iwai
  2008-11-14  9:01 ` cocala
  0 siblings, 2 replies; 5+ messages in thread
From: cocala @ 2008-11-14  8:32 UTC (permalink / raw)
  To: alsa-devel

Who can tell me why not define add SNDRV_PCM_RATE_24000 and
SNDRV_PCM_RATE_12000?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why no Marco definitions for rate 24000 and 12000?
  2008-11-14  8:32 Why no Marco definitions for rate 24000 and 12000? cocala
@ 2008-11-14  8:39 ` Takashi Iwai
  2008-11-14  9:01 ` cocala
  1 sibling, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2008-11-14  8:39 UTC (permalink / raw)
  To: cocala; +Cc: alsa-devel

At Fri, 14 Nov 2008 16:32:42 +0800,
cocala wrote:
> 
> Who can tell me why not define add SNDRV_PCM_RATE_24000 and
> SNDRV_PCM_RATE_12000?

Just because they are rarely used.
You can add a list of supported sample rates explicitly via
snd_pcm_hw_hw_constraint_list() even if they are not defined in
SNDRV_PCM_RATE_* bits.


Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why no Marco definitions for rate 24000 and 12000?
  2008-11-14  8:32 Why no Marco definitions for rate 24000 and 12000? cocala
  2008-11-14  8:39 ` Takashi Iwai
@ 2008-11-14  9:01 ` cocala
  2008-11-14  9:54   ` Takashi Iwai
  1 sibling, 1 reply; 5+ messages in thread
From: cocala @ 2008-11-14  9:01 UTC (permalink / raw)
  To: alsa-devel

Yes, that can add supported sample rates.

but the macro definitions are still needed, actually 12000 and 24000 are
supported by most audio codecs.

in soc-core.c

runtime->hw.rates =
   codec_dai->capture->rates & cpu_dai->capture->rates;

in wm8350.c
#define WM8350_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | \
  SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \
        SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_32000 | \
        SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | \
        SNDRV_PCM_RATE_96000)

static const struct snd_soc_pcm_stream wm8350_hifi_dai_playback = {
 .stream_name = "Playback",
 .channels_min = 2,
 .channels_max = 2,
 .rates  = WM8350_RATES,
 .formats = WM8350_FORMATS,
};
Without the mcaro defintions, it is hard to handle the 12000 and 24000
sample rates.


2008/11/14 cocala <syy.wxd@gmail.com>

> Who can tell me why not define add SNDRV_PCM_RATE_24000 and
> SNDRV_PCM_RATE_12000?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why no Marco definitions for rate 24000 and 12000?
  2008-11-14  9:01 ` cocala
@ 2008-11-14  9:54   ` Takashi Iwai
  2008-11-14 10:14     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2008-11-14  9:54 UTC (permalink / raw)
  To: cocala; +Cc: alsa-devel

At Fri, 14 Nov 2008 17:01:08 +0800,
cocala wrote:
> 
> Yes, that can add supported sample rates.
> 
> but the macro definitions are still needed, actually 12000 and 24000 are
> supported by most audio codecs.

Simply pass SNDRV_PCM_RATE_KNOT instead of explicit rate bits.


Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why no Marco definitions for rate 24000 and 12000?
  2008-11-14  9:54   ` Takashi Iwai
@ 2008-11-14 10:14     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2008-11-14 10:14 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: cocala, alsa-devel

On Fri, Nov 14, 2008 at 10:54:15AM +0100, Takashi Iwai wrote:
> cocala wrote:

> > but the macro definitions are still needed, actually 12000 and 24000 are
> > supported by most audio codecs.

> Simply pass SNDRV_PCM_RATE_KNOT instead of explicit rate bits.

This is with ASoC - due to the way the core does rate matching it'll
also require the platform side to support SNDDRV_PCM_RATE_KNOT (but
should work otherwise, both drivers will get the chance to define extra
constraints).

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-14 10:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-14  8:32 Why no Marco definitions for rate 24000 and 12000? cocala
2008-11-14  8:39 ` Takashi Iwai
2008-11-14  9:01 ` cocala
2008-11-14  9:54   ` Takashi Iwai
2008-11-14 10:14     ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.