Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Troy Kisky <troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
To: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org
Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	broonie-GFdadSzt00ze9xe1eoZjHA@public.gmane.org
Subject: [PATCH 2/5] ASoC: DaVinci: pcm, constrain buffer size to multiple of period
Date: Thu,  6 Aug 2009 16:55:32 -0700	[thread overview]
Message-ID: <1249602935-1267-2-git-send-email-troy.kisky@boundarydevices.com> (raw)
In-Reply-To: <1249602935-1267-1-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>

The dma setup code assumes that the buffer size is a multiple
of the period size.

Signed-off-by: Troy Kisky <troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
---
 sound/soc/davinci/davinci-pcm.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
index fbda8ef..a294711 100644
--- a/sound/soc/davinci/davinci-pcm.c
+++ b/sound/soc/davinci/davinci-pcm.c
@@ -244,6 +244,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream)
 	int ret = 0;
 
 	snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware);
+	/* ensure that buffer size is a multiple of period size */
+	ret = snd_pcm_hw_constraint_integer(runtime,
+						SNDRV_PCM_HW_PARAM_PERIODS);
+	if (ret < 0)
+		return ret;
 
 	prtd = kzalloc(sizeof(struct davinci_runtime_data), GFP_KERNEL);
 	if (prtd == NULL)
-- 
1.5.6.3

  parent reply	other threads:[~2009-08-06 23:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06 23:55 [PATCH 1/5] ASoC: DaVinci: i2s: don't bounce through rtd to get dai Troy Kisky
     [not found] ` <1249602935-1267-1-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2009-08-06 23:55   ` Troy Kisky [this message]
2009-08-06 23:55     ` [PATCH 3/5] ASoC: DaVinci: i2s, reduce underruns by combining into 1 element Troy Kisky
2009-08-06 23:55       ` [PATCH 4/5] ASoC: DaVinci: pcm, rename variables in prep for ping/pong Troy Kisky
2009-08-06 23:55         ` [PATCH 5/5] ASoC: DaVinci: pcm, fix underruns by using sram Troy Kisky
2009-08-07  2:05           ` Troy Kisky
2009-08-08  9:17             ` Mark Brown
2009-08-11  0:32               ` Troy Kisky
2009-08-11  9:59                 ` Mark Brown
2009-08-08  8:59       ` [PATCH 3/5] ASoC: DaVinci: i2s, reduce underruns by combining into 1 element Mark Brown
2009-08-08  9:07         ` Mark Brown
2009-08-07 10:41 ` [PATCH 1/5] ASoC: DaVinci: i2s: don't bounce through rtd to get dai Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1249602935-1267-2-git-send-email-troy.kisky@boundarydevices.com \
    --to=troy.kisky-q5rjgjkts06cy9shamctrueocmrvltnr@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=broonie-GFdadSzt00ze9xe1eoZjHA@public.gmane.org \
    --cc=davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox