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 X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33F67C43142 for ; Tue, 31 Jul 2018 05:30:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB7DE208A2 for ; Tue, 31 Jul 2018 05:30:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB7DE208A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727306AbeGaHIr (ORCPT ); Tue, 31 Jul 2018 03:08:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:44288 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726404AbeGaHIr (ORCPT ); Tue, 31 Jul 2018 03:08:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 085E1AF31; Tue, 31 Jul 2018 05:30:18 +0000 (UTC) Date: Tue, 31 Jul 2018 07:30:16 +0200 Message-ID: From: Takashi Iwai To: "Agrawal, Akshu" Cc: Mark Brown , Pierre-Louis Bossart , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Alexander.Deucher@amd.com, djkurtz@chromium.org, Liam Girdwood , open list Subject: Re: [alsa-devel] [PATCH] ASoC: soc-pcm: Use delay set in pointer function In-Reply-To: <7a88c7b4-d31d-b044-bb8e-a866d49d1256@amd.com> References: <1532686422-1790-1-git-send-email-akshu.agrawal@amd.com> <66c8b8c4-bdd0-0129-5e5b-850890cfdb8d@linux.intel.com> <20180730155030.GP5789@sirena.org.uk> <7a88c7b4-d31d-b044-bb8e-a866d49d1256@amd.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/26 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 31 Jul 2018 03:25:06 +0200, Agrawal, Akshu wrote: > > > > On 7/30/2018 9:20 PM, Mark Brown wrote: > > On Mon, Jul 30, 2018 at 05:32:21PM +0200, Takashi Iwai wrote: > > > >> That said, if delay callback of CPU dai provides the additional delay, > >> the patch does correct thing. OTOH, if CPU dai provides the base > >> delay instead, we need to clarify that it's rather a must; the delay > >> calculation in pointer callback becomes bogus in this scenario. > > > > Part of the theory here is that every component might have a delay > > independently of the rest and we need to add them all together to figure > > out what the system as a whole will see. Personally I'd rather just > > have everything use a callack consistently to avoid confusion. > > > > For consistency we can add a delay callback in snd_pcm_ops and modify > the drivers which directly assigning runtime->delay to use the callback. No, ALSA PCM ops definition is fine. The delay calculation is basically tied with the position, hence it has to be set together, and that's the pointer callback. Judging from the call pattern, the current design of ASoC delay callback implies that the return value is more or less constant, which can be accumulated on top of the base value. So your patch is natural from that POV. OTOH, if the CPU dai can really provide a dynamic value that is strictly tied with pointer, CPU dai itself should provide the pointer callback that covers both the pointer and the base delay, and it should be used instead of component pointer callback. > Apart from the 2 drivers mentioned in commit message I also found > sound/usb to be doing the same and its delay getting lost. The USB driver hasn't been used in ASoC, no? thanks, Takashi