From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3DEBBC27C55 for ; Mon, 10 Jun 2024 14:44:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2DDAD844; Mon, 10 Jun 2024 16:44:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2DDAD844 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718030687; bh=l/Grbzei5fBRjJCWKEoGR/gpM9K22wBlsaDZreuU82w=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lzP4euhxoAr2bQakMGpsnVeqbktE3O0mJDSzGyVihRrbH3fAroKKDJpGtkqBiLyU/ yTeIKG0E9+PkAHdqGfR1rTtE2GYL0Wbl/0LbvXe39afISY6mCnEn2NT9xs6wLJ+SpM ilK4E59Jzi29v+pqHeQU4SuvmSBpXtAMCqhl5JC4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A7FDFF80587; Mon, 10 Jun 2024 16:44:11 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 409EFF805BF; Mon, 10 Jun 2024 16:44:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59128F80580; Mon, 10 Jun 2024 16:44:07 +0200 (CEST) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 59E57F80578 for ; Mon, 10 Jun 2024 16:44:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 59E57F80578 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Bm9h+R/o Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ebd421a931so23096851fa.1 for ; Mon, 10 Jun 2024 07:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718030640; x=1718635440; darn=alsa-project.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+X8rAX9jRAKaOSNNc0p/ItKQWY3t87U4LU5WMC+wGlk=; b=Bm9h+R/omW5vjCH/HQXzL75mA3kchKgz0roVeHDWpzEHoxHS+SIXcuLS4alZNIDOi7 Y+XrI1X2M3Y45yvXvg/6ImDDLl6Tty1GeO55CtvH01+mD8HKEekwwBj+2MvddWn7Ji3j TEQWIyBV4Q2WXK6urh87U4Jyu0X0X6Y6fkyYJPFQfligyERAU/je61eBljGsv6X2n/gD gwlyOds+DpTAdJvzaRN2G6FBdZlNE22oS/TGxzo8Fka/7KXgC8Jmx2uH2wgi7tbUkDG/ bGErhktewb8UNMuQmDMzJj6v0w7w5QcctgRwEMhq9D3rJWT4mG7DY1n/zPowtIsWNUx5 rkqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718030640; x=1718635440; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+X8rAX9jRAKaOSNNc0p/ItKQWY3t87U4LU5WMC+wGlk=; b=OZHFOK43x2FDjkfV1DLCg4gd7W5dfrK/56rqRl/Mq0kZhS/Nd69baGklLHd93A/22r eKwNreBfB5YDkZmJGGnCIW7RL6q5qu3Ipx00psd9dAZN7o9S7iRBVmqwYk/+VG+0VCL9 u+2JKgkJQxB0O4VQ29KxrhFKGio9BIJDWmNfUAGSJS2Vii4+e4mr9V/u0owoLtTxAXKX nzroOl0ThYDuGldxxTzQ5jSF0cqqzn3S02J+uWTeVx7FDhfocBtHove0arZc3RKW4Ic4 1+ylJsJeFnRUs6sZVFlUMJ28uv8w1oG41DcmLkTxjFGajyfsKxGhw4/8I85aJdZmGnMr eq2w== X-Forwarded-Encrypted: i=1; AJvYcCWelTUKZpdQ+Kn59g6iuL6TTr7OboaGnCkrHC0O4sj8JrhWjUivhVxzBgu6AaqM2ayVm47s2Bgxb+4hbiZLuUooZX0bb1EKGZQgZtY= X-Gm-Message-State: AOJu0Yykwko19Rs7M3H7p6eQNb/wPAPEi0d+VUoKX9QEJTNjkfaMCnz1 gyQj1NGUMzj0MgZJoPjfqHxOdGJ7ZsIX5ABfvBD/bD6AQeOMfbF7e3ZNDdvfiOo= X-Google-Smtp-Source: AGHT+IEqPiXMp7uVz35JdOOGzlUzWqUmfOqh8p/wjktqliXLyYoDdm4rNv+eqVWsaDjHEEKy7jCsbg== X-Received: by 2002:a2e:6e16:0:b0:2eb:da38:971f with SMTP id 38308e7fff4ca-2ebda38989cmr30649031fa.44.1718030638594; Mon, 10 Jun 2024 07:43:58 -0700 (PDT) Received: from [10.0.0.42] (host-85-29-124-88.kaisa-laajakaista.fi. [85.29.124.88]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2eaec3ba8d7sm13372621fa.1.2024.06.10.07.43.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jun 2024 07:43:58 -0700 (PDT) Message-ID: Date: Mon, 10 Jun 2024 17:47:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] ASoC: ti: davinci-mcasp: Set min period size using FIFO config To: Jai Luthra , Lars-Peter Clausen , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Devarsh Thakkar , Vignesh Raghavendra , Jayesh Choudhary References: <20240610-asoc_next-v2-0-b52aaf5d67c4@ti.com> <20240610-asoc_next-v2-2-b52aaf5d67c4@ti.com> Content-Language: en-US From: =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= In-Reply-To: <20240610-asoc_next-v2-2-b52aaf5d67c4@ti.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID-Hash: X5LDA2WSYU3G7JKNU4VZGDSDVTHWPSGE X-Message-ID-Hash: X5LDA2WSYU3G7JKNU4VZGDSDVTHWPSGE X-MailFrom: peter.ujfalusi@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi, On 6/10/24 1:56 PM, Jai Luthra wrote: > The minimum period size was enforced to 64 as older devices integrating > McASP with EDMA used an internal FIFO of 64 samples. > > With UDMA based platforms this internal McASP FIFO is optional, as the > DMA engine internally does some buffering which is already accounted for > when registering the platform. So we should read the actual FIFO > configuration (txnumevt/rxnumevt) instead of hardcoding frames.min to > 64. Thank you the patch and the fix, Acked-by: Peter Ujfalusi > > Signed-off-by: Jai Luthra > --- > sound/soc/ti/davinci-mcasp.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c > index 1e760c315521..2b1ed91a736c 100644 > --- a/sound/soc/ti/davinci-mcasp.c > +++ b/sound/soc/ti/davinci-mcasp.c > @@ -1472,10 +1472,11 @@ static int davinci_mcasp_hw_rule_min_periodsize( > { > struct snd_interval *period_size = hw_param_interval(params, > SNDRV_PCM_HW_PARAM_PERIOD_SIZE); > + u8 numevt = *((u8 *)rule->private); > struct snd_interval frames; > > snd_interval_any(&frames); > - frames.min = 64; > + frames.min = numevt; > frames.integer = 1; > > return snd_interval_refine(period_size, &frames); > @@ -1490,6 +1491,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream, > u32 max_channels = 0; > int i, dir, ret; > int tdm_slots = mcasp->tdm_slots; > + u8 *numevt; > > /* Do not allow more then one stream per direction */ > if (mcasp->substreams[substream->stream]) > @@ -1589,9 +1591,12 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream, > return ret; > } > > + numevt = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? > + &mcasp->txnumevt : > + &mcasp->rxnumevt; > snd_pcm_hw_rule_add(substream->runtime, 0, > SNDRV_PCM_HW_PARAM_PERIOD_SIZE, > - davinci_mcasp_hw_rule_min_periodsize, NULL, > + davinci_mcasp_hw_rule_min_periodsize, numevt, > SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1); > > return 0; > -- Péter