From patchwork Wed Aug 1 10:07:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10552041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00008174A for ; Wed, 1 Aug 2018 10:08:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E44922AC6B for ; Wed, 1 Aug 2018 10:08:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D869A2AD83; Wed, 1 Aug 2018 10:08:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18EC32AC6B for ; Wed, 1 Aug 2018 10:08:52 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7B50A267803; Wed, 1 Aug 2018 12:08:50 +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 4EB7726780C; Wed, 1 Aug 2018 12:08:48 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0058.outbound.protection.outlook.com [104.47.36.58]) by alsa0.perex.cz (Postfix) with ESMTP id C9F4C2676E2 for ; Wed, 1 Aug 2018 12:08:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C3Dyww0pDYQCS8gCHnOY/K5l59jj9j6xMJlbGfGYCpo=; b=3MAM9WV2XNLFKxKWh5aKnQUrx5rNxRSG2blTDBErS92tnrqfYTGnygv0IRdyCpTBgeHlywNYjsfVkDYpwjsj0QX6RrbjKPRZ4Sx6dS5iRAqEuhwEAFTiNe9BJf8/SJdasdrzp2dkZsapHjULReJwHIsjk6yTIGQRFJ6RvZms+Ig= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Akshu.Agrawal@amd.com; Received: from akshu-HP-EliteBook-745-G2.amd.com (202.56.249.162) by MW2PR12MB2364.namprd12.prod.outlook.com (2603:10b6:907:8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.17; Wed, 1 Aug 2018 10:08:37 +0000 From: Akshu Agrawal To: Date: Wed, 1 Aug 2018 15:37:33 +0530 Message-Id: <1533118054-14509-1-git-send-email-akshu.agrawal@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00::11) To MW2PR12MB2364.namprd12.prod.outlook.com (2603:10b6:907:8::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c1cd8452-4006-4516-5f2e-08d5f796c101 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:MW2PR12MB2364; X-Microsoft-Exchange-Diagnostics: 1; MW2PR12MB2364; 3:1DnOUQhaq89HaXdaT4+n2Q1Hg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dNtMiv8Yc4SEJ25njyfWnbTTJ97BIIKLYxvVffp9+2RBpc2RuuyQKK9/LvI5FKGxI5W/JeCteWUokPlyMWml3KpJDFoz8+uM73A5ibNYka6/k6rTZwUUemao0x39HAOAJuP6cyeM6+xxXgM+R+5g+3CN5qKY9u+HJqMjwBeDlFD4OGrvEz/+LW49vqB2uUKXX0358/tThUbzxz/FAFNqm0tQN/qM43Tyf16z529JL/cKKDNp3wgTCufhXL+thPn8adJl268o2akjYKB+Fb5epJcIbtVKFBs6C4WJSL5HcS+aGPaqPu5Y+KWR99t; 4:Ls812Dti9qjHBUeaA8Lrt0QGUxoZ8r6fHgN+CpBjHlk7DgWttnMNH53lkw5B17jja9jD/eK0tT76IVyIwh1ZYxABQxrrg/bgsBcznJbQCgSNF5+BBTz1I5+NaBbATraO3T+L8IQ4Sdw0gNKtlaCjdb7eBSOZgV5sp+Y2g/XAgF0JzKvMRpScbOMVfPYzLthY6sF79gFQzgsdV+BdJQD5DdrNaSjQADRTyMEKmMVT2lu3oXvvAm462Fh3kPEs0UK48HzOjoCh2Y86dSTIyYVs3IDDUR3HFwDA5QLZcm3n2w8TmdQWkAqhpXXuFQ0qT2C2 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:MW2PR12MB2364; BCL:0; PCL:0; RULEID:; SRVR:MW2PR12MB2364; X-Forefront-PRVS: 0751474A44 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(366004)(346002)(396003)(376002)(199004)(189003)(97736004)(105586002)(106356001)(305945005)(47776003)(25786009)(386003)(109986005)(39060400002)(86362001)(4326008)(66066001)(6486002)(53936002)(7696005)(2906002)(36756003)(3846002)(6116002)(53416004)(72206003)(478600001)(50466002)(48376002)(54906003)(68736007)(1671002)(14444005)(26005)(956004)(16526019)(476003)(486006)(44832011)(6666003)(8676002)(51416003)(52116002)(7736002)(2616005)(186003)(8936002)(16586007)(81156014)(316002)(81166006)(5660300001)(50226002)(266003); DIR:OUT; SFP:1101; SCL:1; SRVR:MW2PR12MB2364; H:akshu-HP-EliteBook-745-G2.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MW2PR12MB2364; 23:n+JmsVqKNRTWM9s2Es1WZdZuQ0nnPrLA8d5YB58J9?= vMuqzQkBCdtbDEUAYIvCB9jECS1gqWF53TWmx2I9f1Z8COwjMuqwmnIheYxWhRztD+S5lAdLSboykEWr1w7zgGR3LJ+5zdR/d5mk82xsFg+109OKWzncmnrIdywHxut7c4bVeKi8MHhBtbEYr663vlTaXAQd0GdgaeqoCVg6ZFWhpmAR0qervdryGSCValWqCKf8Eo+vkzAe8jG1O7wSwXXONfv/yHJT8NdlehwldmLt1xYz0WMWAT9lfnx7/frTbNWzjSd7hgRFI8hYpvABudX+jZWtYh9YC5k8nQkdbPgnGwUVzcAAAO6BtBJTL1R+QTLJxS8XMmnpROlqkXyy1TT8lBm96VzuYDlsX6tvy24VEvgBrg+qjmaWxXrd4MT8kB2T77yTBs+bdvUnmYTyQ9jxR+qmxG4mOf8vfODMGoirfOgmo56JLbCoi+dIfMfZJXOxv0rtt+1nnNn88LRZaLZbymsMGJZo+3u0iGtVshBD7A7UHdQZxsoU5mTtBgVXoMJllDSW/H3egS0iHuBP0lEQYoO2IZy03+qE+WxJoAzObluj0F+kWgPzpSkntWxljerD5hp8OVDdkuDi1P1CKyI72XqpMe/99Vb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PduHdc8xuH9VN7eIkAb+zvQkEwMIDV1FYDrN6leB4NxW5hEEgXqrk3ri8Fe+Umw7TjYdcSZq6viAGmIJ/n/NI1+rrPo+26l3XwmJQ6PhXbICQJOw4HAn1QQRQ5LNbIT+9JpwM9YY+ZjUqjTun X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 10:08:37.4694 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1cd8452-4006-4516-5f2e-08d5f796c101 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2364 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list , Takashi Iwai , Liam Girdwood , djkurtz@chromium.org, Mark Brown , Alexander.Deucher@amd.com, akshu.agrawal@amd.com Subject: [alsa-devel] [PATCH v2] ASoC: soc-pcm: Use delay set in component pointer function 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- sound/soc/soc-pcm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 98be04b..e8b98bfd 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);