All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: support for 12 & 24Khz
@ 2013-07-24 17:26 Vinod Koul
  2013-07-25  6:45 ` David Henningsson
  2013-07-25  6:50 ` Clemens Ladisch
  0 siblings, 2 replies; 12+ messages in thread
From: Vinod Koul @ 2013-07-24 17:26 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, pierre-louis.bossart

Hey Takashi,

For compressed audio we also need to support the PCM rates of 12 and 24KHz.

Looking at pcm.h these are not defined so we can simply add them at the end.
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

diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 84b10f9..e418d8d 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -126,6 +126,8 @@ struct snd_pcm_ops {
 #define SNDRV_PCM_RATE_96000           (1<<10)         /* 96000Hz */
 #define SNDRV_PCM_RATE_176400          (1<<11)         /* 176400Hz */
 #define SNDRV_PCM_RATE_192000          (1<<12)         /* 192000Hz */
+#define SNDRV_PCM_RATE_12000           <1<<13>         /* 12000Hz */
+#define SNDRV_PCM_RATE_24000           <1<<14>         /* 24000Hz */

 #define SNDRV_PCM_RATE_CONTINUOUS      (1<<30)         /* continuous range */
 #define SNDRV_PCM_RATE_KNOT            (1<<31)         /* supports more
non-continuos rates */
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index a68d4c6..42600b0 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1779,12 +1779,13 @@ static int snd_pcm_hw_rule_sample_bits(struct
snd_pcm_hw_params *params,
        return snd_interval_refine(hw_param_interval(params, rule->var), &t);
 }

-#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_192000 != 1 << 12
+#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_24000 != 1 << 14
 #error "Change this table"
 #endif

 static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100,
-                                 48000, 64000, 88200, 96000, 176400, 192000 };
+                                 48000, 64000, 88200, 96000, 176400, 192000,
+                                 12000, 24000 };

 const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = {
        .count = ARRAY_SIZE(rates),

~Vinod
-- 

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

end of thread, other threads:[~2013-07-28 13:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-24 17:26 RFC: support for 12 & 24Khz Vinod Koul
2013-07-25  6:45 ` David Henningsson
2013-07-25 15:32   ` Vinod Koul
2013-07-25  6:50 ` Clemens Ladisch
2013-07-25 15:45   ` Vinod Koul
2013-07-25 16:31     ` Takashi Iwai
2013-07-26  6:09       ` Vinod Koul
2013-07-26  7:09         ` Takashi Iwai
2013-07-28 12:24           ` Vinod Koul
2013-07-25 19:36     ` Mark Brown
2013-07-26  6:11       ` Vinod Koul
2013-07-26  7:10         ` Takashi Iwai

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.