From patchwork Wed Aug 1 13:31:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 143288 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp878716ljj; Wed, 1 Aug 2018 06:31:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcccSUDM3LRK1dkE4HAstAVgViASAQjigjnl4MrrhduZ0zh3YvCbjERZEH27jctJDHDa0Eq X-Received: by 2002:a1c:c7cb:: with SMTP id x194-v6mr2882374wmf.117.1533130307867; Wed, 01 Aug 2018 06:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533130307; cv=none; d=google.com; s=arc-20160816; b=zEcTbKKcD9diitlx9+AKfOLLEyqzotyzksscWWKc/wvESpsITVbfEXtF3lIpvQAKZT GxIct/hgeWN0dbaZgi0nCNuavwSeGJdyaOs6MUG21PtA6RYloDqFVmX7mxmgL6cEGhnO SzF3SJ65syJC37AlDh3u2jb/rgWHz3kW9hVXFf6NgDfb3IgtJTzi54YfHUea1XJMb5YS 8l6l848kiluHsPFwfOmZ8Abaf7/eZE9hD8L4K4dT2FRcD41O4U0ngPvjLsjBaLmJ+rWQ GudYNucF4lwSyQ8F21d+l0nq1Qz7DIK0OHPCm5dixXRrzb2dR9QANOJ8Nq9fZEjVIpWR 80vw== 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=x9mAf2FPU76M2H/aay2Nj8KhQlUS9rmWkEZfCwbXuVc=; b=Y6TtQqG0ArsI17obBDglJyvvtUe/qvs045AELZf/NeUioPomJF1qqujr1DilZZ//AX +LXS1cAD3mPrlxXat5/wGv2nmYU8nRL9MPodzQzIlRgSUpX8gmAGvmEQTnJhzv4toS9T AlysTGdn5xnLXDw+AJTOIERNH7kShyDrCkWQXmSSzi5wMsna9QQ+jxuGMDEam20tjgUD Hui3X23xYo9DiQO5g4jm1yacICXRb+ppZoLqmoIYlTZKgMHGPCU65vmfQpvJ3Ds7zw51 1KaXO/2Dw+zJAq72Tv00KHqpYQlYs9ij9fw2LYkVDl9KqKrAkwWLajJtjSWZObj+g7GF IjTA== 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=Gb4w+Wxj; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id b134-v6si2927144wmg.89.2018.08.01.06.31.47; Wed, 01 Aug 2018 06:31:47 -0700 (PDT) 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=Gb4w+Wxj; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BBE722677C5; Wed, 1 Aug 2018 15:31:45 +0200 (CEST) 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 A92832677D3; Wed, 1 Aug 2018 15:31:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS 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 5B94C2676E2 for ; Wed, 1 Aug 2018 15:31:40 +0200 (CEST) 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=Bzso0yPFRXB0hjxnhCVX1tjkvI+kPGpWymFWfLLFVKY=; b=Gb4w+WxjRmkh shVuje3CYRHA9IPULLqEktcz8mIT0sufif0DUauhoeP/U+PwEcTuLHt6+QsiiuqZeYqvAxAUh4sMF /6tzdcyn56Ruz2QR96K1BFWnK3L03WzUvsfBcRksbgc+CIECE+8EWxh1ttqc5XXuHJxqNzICRGQQ0 e9ZfU=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1fkrE0-0000zC-KT; Wed, 01 Aug 2018 13:31:36 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 25CCB1124241; Wed, 1 Aug 2018 14:31:36 +0100 (BST) From: Mark Brown To: Akshu Agrawal In-Reply-To: <1533118054-14509-1-git-send-email-akshu.agrawal@amd.com> Message-Id: <20180801133136.25CCB1124241@debutante.sirena.org.uk> Date: Wed, 1 Aug 2018 14:31:36 +0100 (BST) Cc: , alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , djkurtz@chromium.org, open list , Mark Brown , Alexander.Deucher@amd.com, akshu.agrawal@amd.com Subject: [alsa-devel] Applied "ASoC: soc-pcm: Use delay set in component pointer function" 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: soc-pcm: Use delay set in component pointer function 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 9fb4c2bf130b922c77c16a8368732699799c40de Mon Sep 17 00:00:00 2001 From: Akshu Agrawal Date: Wed, 1 Aug 2018 15:37:33 +0530 Subject: [PATCH] ASoC: soc-pcm: Use delay set in component pointer function Take into account the base delay set in pointer callback. There are cases where a pointer function populates runtime->delay, such as: ./sound/pci/hda/hda_controller.c ./sound/soc/intel/atom/sst-mfld-platform-pcm.c This delay was getting lost and was overwritten by delays from codec or cpu dai delay function if exposed. Now, Total delay = base delay + cpu_dai delay + codec_dai delay Signed-off-by: Akshu Agrawal Reviewed-by: Takashi Iwai Signed-off-by: Mark Brown --- sound/soc/soc-pcm.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.18.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 4019bc10897c..9833e53754cb 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1179,6 +1179,9 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) snd_pcm_sframes_t codec_delay = 0; int i; + /* clearing the previous total delay */ + runtime->delay = 0; + for_each_rtdcom(rtd, rtdcom) { component = rtdcom->component; @@ -1190,6 +1193,8 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) offset = component->driver->ops->pointer(substream); break; } + /* base delay if assigned in pointer callback */ + delay = runtime->delay; if (cpu_dai->driver->ops->delay) delay += cpu_dai->driver->ops->delay(substream, cpu_dai);