summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorVladislav Buzov <vbuzov@embeddedalley.com>2009-06-09 16:01:15 -0500
committerAlan Tull <r80115@freescale.com>2009-06-09 16:33:08 -0500
commit483d35b949685f473e9ce8e240d64c086efc04d9 (patch)
tree553aa662e2b931dddd4cd8c31b332f6e7744e489 /sound
parent12605cd379fb641efd44d7afaa1bac5d0becd015 (diff)
[Bug 77] ALSA sample rate is off for 22050Hz and 32KHz
Added a constraint for ALSA library to create buffers multiple of period size.
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/stmp3xxx/stmp3xxx_pcm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/stmp3xxx/stmp3xxx_pcm.c b/sound/soc/stmp3xxx/stmp3xxx_pcm.c
index 79fd5526fe6b..bbd6d753c409 100644
--- a/sound/soc/stmp3xxx/stmp3xxx_pcm.c
+++ b/sound/soc/stmp3xxx/stmp3xxx_pcm.c
@@ -324,6 +324,12 @@ static int stmp3xxx_pcm_open(struct snd_pcm_substream *substream)
struct stmp3xxx_runtime_data *prtd;
int ret;
+ /* Ensure that buffer size is a multiple of the period size */
+ ret = snd_pcm_hw_constraint_integer(runtime,
+ SNDRV_PCM_HW_PARAM_PERIODS);
+ if (ret < 0)
+ return ret;
+
snd_soc_set_runtime_hwparams(substream, &stmp3xxx_pcm_hardware);
prtd = kzalloc(sizeof(struct stmp3xxx_runtime_data), GFP_KERNEL);