From patchwork Fri Jul 27 10:13:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10546883 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 89CCD112E for ; Fri, 27 Jul 2018 10:14:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7831E2B187 for ; Fri, 27 Jul 2018 10:14:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BBD72B65B; Fri, 27 Jul 2018 10:14:38 +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 142082B2BA for ; Fri, 27 Jul 2018 10:14:35 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 419432677B5; Fri, 27 Jul 2018 12:14:32 +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 3EC912677B8; Fri, 27 Jul 2018 12:14:30 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0045.outbound.protection.outlook.com [104.47.36.45]) by alsa0.perex.cz (Postfix) with ESMTP id 5B38A2677B0 for ; Fri, 27 Jul 2018 12:14:24 +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=qS62/xwdbZGAwJmNCs+6BkZejaVP1fIhJ4i8EIee9Dw=; b=k7jrCa1BaYlHdsUVBPRUNwR31Mxkrnq3BbLSR+dWJCis/CuxJvt8CB/kF3W7cqOw6TWXwO9peuIkDHco0cLvOOVp1HW8J5Epjqe6c0jk7oklwZvJZ2egMCWTVxWwLeqpOSe3+x45KGJLSzx5R16eyvkKrcJicrvclPmXluqEpl0= 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 MW2PR12MB2361.namprd12.prod.outlook.com (2603:10b6:907:7::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.22; Fri, 27 Jul 2018 10:14:18 +0000 From: Akshu Agrawal To: Date: Fri, 27 Jul 2018 18:13:42 +0800 Message-Id: <1532686422-1790-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: MA1PR0101CA0035.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::21) To MW2PR12MB2361.namprd12.prod.outlook.com (2603:10b6:907:7::32) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 660b226e-8597-479f-24b9-08d5f3a9b85a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:MW2PR12MB2361; X-Microsoft-Exchange-Diagnostics: 1; MW2PR12MB2361; 3:QiQg8kRd6bP6CwCrcz3BJOf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OI96GVxQPKg61hRfUERPZbzmHqjvc5TBNbzlEEgPiSdM2TCxVmxRN6gIZw6zGP8E/ViLXgFxtIHcIahI15p5yHgq8VmS5kaYEoOqiMz0fy+gobhB5pMCrUZtIHw8KYivTFBcimUVA1yYJkmcbxmoSlXYIuapWu/H2E7erJk3ccLerO0N+/FDTz4csjBJV93+HFlzT9hvx+aCUG1EQrxDEsAikIMqtw/cL9lIkSJXO9Xrq44albLYphUZEHZR4TyLlcQsEctjlnB/zYLaaNR1HUztE2Eo+BuMrwdwvAmylxVe+MThd3pA4e5QA7Dn9mHPsuT; 4:F8ieYGGjdsn3CVTJ2hhenljs9uW9kd49v7gnMqYRXIY0gAjJrQwpZjvJaUuoKgn/yXY44xEnQiyS9SsB6ZhrypiKJHvWJ6+n0KMBUnnRIsXSAK/9YtJJWHrRnpZUFJGEe9S2BI0vE32ShPlTk6m+AKW8ae8Fp7tOUVbXOVfp4Fg2GYxCJcEhDQDbgKTbCWHhiALZWWphFun6CCwv8ubuIYcVP04PALNl5OoLMS0IieMQFJLkaZ4U07MPlNYsOD16h6zP52qqRVDOGxVk5VPTTkrKZspH+lEzAhqUg8oTCDrvj4x/Zr7hVt9eSxulo1EO 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)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:MW2PR12MB2361; BCL:0; PCL:0; RULEID:; SRVR:MW2PR12MB2361; X-Forefront-PRVS: 07467C4D33 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(366004)(136003)(346002)(396003)(199004)(189003)(1857600001)(16526019)(8676002)(3846002)(6116002)(26005)(72206003)(186003)(478600001)(66066001)(44832011)(52116002)(305945005)(476003)(7736002)(47776003)(105586002)(2616005)(106356001)(956004)(54906003)(7696005)(97736004)(486006)(81156014)(81166006)(316002)(16586007)(6486002)(14444005)(53416004)(386003)(2906002)(6666003)(8936002)(68736007)(86362001)(109986005)(39060400002)(36756003)(25786009)(50466002)(5660300001)(48376002)(1671002)(53936002)(4326008)(50226002)(51416003)(266003); DIR:OUT; SFP:1101; SCL:1; SRVR:MW2PR12MB2361; 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; MW2PR12MB2361; 23:R27qpSXBgAyoXpanTVHXkTy496Qhtioh77hZknie8?= OHpUvtpan6BdkqQ6vhbjm+tjLvErY1B1v7q77cnEhTrdwTBanH8No2nb6dlht4bZKT21a0rKJddOH2xsG/w5CN6sjS2APhBVlU2xqm5Jh825e3a8Uh0QocU6Dhg3AFrttJn4TyXVIwOtVAXjfp4dshcIFFbPuCtB9jcHqYiJZuyUlHY6xKVjKnRZecCavMm0EyiEN4JFn0qgQIVBb5OWb5j+QoTdASSIjkZG/LBywDHi3Xuceloryak6eS3p2TbItC8m73CbROQCKC2W8DD6zWdN04bv/8DIGRj58Iv2fvmwQUXPCBlWXIz+8QTa3OXPZe4WuLtgZKanCSSYwaWskg5CVAPZk63dhAmj47cuObc5truyxp+oVn/d5LO4oZ+DNJcOV30ywx868lylkMu9HJ7XgcqlCdi0KJN/OBkgU+8I/5vu/DdhKa4KR0c8NNWWqy3HJ9p/x31XuOmQ3muXUqAafQG7tEySCAF9lZlfW3fwpeV88dxtVWHEkJCBfg6PheUSMUXSnChwJiYDVTerXimPUD5z3S36+VSaxbWtMwJDTFF7/Ro0jsSl2Xgf0kyG33QWFE3RhhSHQr2BPch+HzV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12MB2361; 6:XET1uZCXtBgpBn7VHfydKNQ7dfRLPEqkue2LiIlt08Fu8uU4R6bWDDBHzwyr661oFJBbrX8MQdIdmmAfXfvmd+jIKod775lsCTbk1uwMOJuHi+y89NeLsBXOyhGPDjZondK5W1M8zeDbqtHTklJtykhXPlrKM+OmihRRamudBndyPuCUpMCiEdi73Gn+RaaNEomTOKSewZARKRq7daeiVd4j0fpSz0s9J/Mel1Vyi9VMJNh24YExHG1rNkMIOWPjw+V/RxwCRuGu9KknOShk7KdT3VSWQP80DLkh8Oc3qEGTtcPnKmMocIoCjnJzU483sv3d9cLQBK1Dih5s9hICCOJ+ZezS0ijXQRIYUu041iMdB+0cwZXRo3A0qPOPJw46fgr41qEWkdmqux1H7GbmaOuhaCnAyvvbBT6lY/kvsdz2RcTlOBRmG0p8tb4nL7xDWB1TPKFn4nWYULy9AuAqFw==; 5:KcyN00Ma9BlprAn6luFDq9ZUMfh+TWJl7lCoafGrY95JNNhE1tHORevvtHaVsFkaSoeHiXgPmzR22+qVPYcgxYVfGKjFM4yxYakXfNZLXd/NGv/7db4rf30M3xfHV+dalJwzmAO/IBW68sBPHX8F/ZnjCPBrbPx5AT2MUO4wcRs=; 7:JmXUFU6DQOv82mvOzQSuXDo5bwrw1O/iaA93+HALi27FmCOMNcdQPPBHcFqfyFWzTXYdmB4CU6V5guIIvj+Ss/dPqBnAtqRqnj3dSoktuBuFNOBGMxjVpsXBcWtiFjDJRyzHxVCJAFYEwlqloZS60D7YPGsyTKPCqv7QwDM4Kff/n8cV9cUnKSx1Ddx99x1CXA/jBRIOPIDYH0otPefjotbOREGXb9VqKYnHmb/EQKSWsIqQRXznNCQLRrQfGBrZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MW2PR12MB2361; 20:d73SCxtNp3UOvD+jT5pANqXUrRNuvYIY+WjYGOBO+ROypFlEUG3giXfEiZDWvmLp56XA3DmTTQl52T8twjbtgG5lbhw6IAREL+K1tK//51gooKkaO7p7YPAYhyuEqldTV2RocdcrEPKeDy0NFwzVMtXh/rUGj5bhxD8QVlf0qfCCaiGlXGGmh1+C2afKUjHJ6qz8fSRwKiS8h8AwnGRytt7fPoOIb+4bYl9chsPbVB1xq9hBjsFuGud7ZNNl7p2J X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2018 10:14:18.7762 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 660b226e-8597-479f-24b9-08d5f3a9b85a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2361 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] ASoC: soc-pcm: Use delay set in 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 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 Also, in some cases cpu dai used is generic and the pcm driver needs to set delay. This delay was getting lost and was overwritten by delays from codec or cpu dai delay function if exposed. Signed-off-by: Akshu Agrawal --- sound/soc/soc-pcm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 98be04b..b1a2bc2 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 delay */ + runtime->delay = 0; + for_each_rtdcom(rtd, rtdcom) { component = rtdcom->component; @@ -1203,7 +1206,7 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) } delay += codec_delay; - runtime->delay = delay; + runtime->delay += delay; return offset; }