Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755404AbYCQNV0 (ORCPT ); Mon, 17 Mar 2008 09:21:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753164AbYCQNVT (ORCPT ); Mon, 17 Mar 2008 09:21:19 -0400 Received: from ns2.suse.de ([195.135.220.15]:39061 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753140AbYCQNVS (ORCPT ); Mon, 17 Mar 2008 09:21:18 -0400 Date: Mon, 17 Mar 2008 14:21:16 +0100 Message-ID: From: Takashi Iwai To: Atsushi Nemoto Cc: haavard.skinnemoen@atmel.com, linux-kernel@vger.kernel.org, hcegtvedt@atmel.com, avictor.za@gmail.com Subject: Re: [PATCH] at73c213: Fix DMA size at the end of DMA buffer In-Reply-To: <20080317.220027.01917573.anemo@mba.ocn.ne.jp> References: <20080314104445.32f4da40@hskinnemo-gx620.norway.atmel.com> <20080314.222932.74752532.anemo@mba.ocn.ne.jp> <20080317.220027.01917573.anemo@mba.ocn.ne.jp> User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta28) (fuki) (+CVS-20070806) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2081 Lines: 60 At Mon, 17 Mar 2008 22:00:27 +0900 (JST), Atsushi Nemoto wrote: > > On Fri, 14 Mar 2008 14:39:42 +0100, Takashi Iwai wrote: > > Add the following constraint in the open callback: > > > > err = snd_pcm_hw_constraint_integer(runtime, > > SNDRV_PCM_HW_PARAM_PERIODS); > > if (err < 0) > > return err; > > > > This will guarantee that the period size fits with the buffer size. > > Thank you! It works fine. Here is a new patch. Thanks for the patch. So, I should revert your last patch, right? It's already on ALSA tree... Takashi > > ------------------------------------------------------ > Subject: [PATCH] at73c213: Add constraints for periods value > From: Atsushi Nemoto > > The interrupt handler always provide runtime->period_size data, so it > works correctly only if buffer_size was a multiple of period_size. > > This patch fixes periodic click noise. > > Signed-off-by: Atsushi Nemoto > --- > This patch obsoletes a patch titled "at73c213: fix DMA size at the end > of DMA buffer" in git-alsa-tiwai.patch in mm tree. > > diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c > index 7c077c6..9a5c118 100644 > --- a/sound/spi/at73c213.c > +++ b/sound/spi/at73c213.c > @@ -210,7 +210,13 @@ static int snd_at73c213_pcm_open(struct snd_pcm_substream *substream) > { > struct snd_at73c213 *chip = snd_pcm_substream_chip(substream); > struct snd_pcm_runtime *runtime = substream->runtime; > + int err; > > + /* ensure buffer_size is a multiple of period_size */ > + err = snd_pcm_hw_constraint_integer(runtime, > + SNDRV_PCM_HW_PARAM_PERIODS); > + if (err < 0) > + return err; > snd_at73c213_playback_hw.rate_min = chip->bitrate; > snd_at73c213_playback_hw.rate_max = chip->bitrate; > runtime->hw = snd_at73c213_playback_hw; > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/