From patchwork Fri Jan 5 12:42:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 123509 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp768785qgn; Fri, 5 Jan 2018 04:43:22 -0800 (PST) X-Google-Smtp-Source: ACJfBouISgaypapemLXo7UDcRTuB5SyD9Q5a+bGgrgboWs9jJ3On8ph0MCp+xSh60zbi3qi1hs7J X-Received: by 10.223.171.69 with SMTP id r5mr1360901wrc.160.1515156202610; Fri, 05 Jan 2018 04:43:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515156202; cv=none; d=google.com; s=arc-20160816; b=sQoLsP3MVb+vlJLLPh+yGw/ejvMMr4QJpZzIRpionhU3zMvSJiOq0IGroalaQbTege Cdz62EewO9kgPTWqOoJUXt/t6KK0Dw3qhqzIv6nMh37CAwtoRBDLW4q8Z4HZmKoSJGLm /QOW+RUE9uxMCNeclcOH2ouyRHtNn169wKTH99/thepzQZhcYiIpcKC0q7s16p+jixhv eTdtc/wgbar+QqkUbVrcB7LW4fXKCNEoORD9qEPAbUXoq/PGGSj+7VAL+J+dC76EfWq3 fwbnnGspsTpRfnmS8fZAwJzT21W0qW9vWU9EVHTF3xoTp3Fhane/UoTli8UJO2Xgqt+C 0/RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=olag+tzFgEl7TMW92hxVQEU27i/1GdnZNR9MasW44j8=; b=gfa1qEr2tMq7GcX/XStpwi5gE/KNG2w6ZBSL9eFFX7zs0X+5748Pgv1maS/n6B1+zf NCXLciCyZXigNhnaHAKL5D6gXnCyKQp/6nsmN4wX1d/jbB0fPkcRBa2dFRY1vOcBHi1W y+Vz0ngRVaWNNgImALY3rTVSpo0z1QiW+GjUKofxlszkPGWvXKZaTuQ/l+dElpCA1PLb 2F1+S/vzn3mG3RXkh5VajKhYsLuRlp0gtu74AEzhY8gOq39COj8/aWoZPmOB8o42/YwP jkEEaMAq7/32hWZ3Eu/Nla/y6h0RPtZ6L8Tzl5Pf3J2Iu+iCvcPAR6NZUfgdX8OfN+tT pZwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=OfSKgorM; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id d13si4229547wra.15.2018.01.05.04.43.22; Fri, 05 Jan 2018 04:43:22 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=OfSKgorM; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A8769267A43; Fri, 5 Jan 2018 13:42:52 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7C22F267A37; Fri, 5 Jan 2018 13:42:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id ACE41267A36 for ; Fri, 5 Jan 2018 13:42:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=BYj1rQjAtJDOU6NphnXURvI+dPDnh38c/Gw3ZQKmKGA=; b=OfSKgorMkv9T LfUcqTdQupQri8JoDcapXh3t0e13qI1ts1wHKsqTWgGowBU0wufk/HjNOJXcnA6zZ0dIVOxkNqRPg c/E4s436Ha81VZq6s3SWSwTMFv0ujj3H8u5ZbHd97SZmZiv82EXkxV7odegGjyg+28+StUIPz1lGk ELXio=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eXRKf-000286-KG; Fri, 05 Jan 2018 12:42:45 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1eXRKf-00054o-5J; Fri, 05 Jan 2018 12:42:45 +0000 From: Mark Brown To: Peter Ujfalusi In-Reply-To: <20180105101807.7360-1-peter.ujfalusi@ti.com> Message-Id: Date: Fri, 05 Jan 2018 12:42:45 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood , jsarha@ti.com Subject: [alsa-devel] Applied "ASoC: davinci-mcasp: Add rule to constrain the minimum period size" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: davinci-mcasp: Add rule to constrain the minimum period size has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From d43c17daf2771f703bd92a78b34c7b0f3dcc9576 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Fri, 5 Jan 2018 12:18:07 +0200 Subject: [PATCH] ASoC: davinci-mcasp: Add rule to constrain the minimum period size The minimum period size (in frames) must be not lower than the FIFO size of McASP and in general too small period size would easily result underrun in applications as eDMA - the most common DMA servicing McASP have support for limited number of periods. Signed-off-by: Peter Ujfalusi Signed-off-by: Mark Brown --- sound/soc/davinci/davinci-mcasp.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.15.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 804c6f2bcf21..03ba218160ca 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -1242,6 +1242,20 @@ static int davinci_mcasp_hw_rule_format(struct snd_pcm_hw_params *params, return snd_mask_refine(fmt, &nfmt); } +static int davinci_mcasp_hw_rule_min_periodsize( + struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule) +{ + struct snd_interval *period_size = hw_param_interval(params, + SNDRV_PCM_HW_PARAM_PERIOD_SIZE); + struct snd_interval frames; + + snd_interval_any(&frames); + frames.min = 64; + frames.integer = 1; + + return snd_interval_refine(period_size, &frames); +} + static int davinci_mcasp_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { @@ -1333,6 +1347,11 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream, return ret; } + snd_pcm_hw_rule_add(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_PERIOD_SIZE, + davinci_mcasp_hw_rule_min_periodsize, NULL, + SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1); + return 0; }