All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Agrawal, Akshu" <Akshu.Agrawal@amd.com>
Cc: Mark Brown <broonie@kernel.org>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	"moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER
	MANAGEM..."  <alsa-devel@alsa-project.org>,
	Alexander.Deucher@amd.com, djkurtz@chromium.org,
	Liam Girdwood <lgirdwood@gmail.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [alsa-devel] [PATCH] ASoC: soc-pcm: Use delay set in pointer function
Date: Tue, 31 Jul 2018 11:25:11 +0200	[thread overview]
Message-ID: <s5ha7q721vs.wl-tiwai@suse.de> (raw)
In-Reply-To: <5b3249cb-6212-6a14-b644-7548cf0ad00c@amd.com>

On Tue, 31 Jul 2018 11:06:59 +0200,
Agrawal, Akshu wrote:
> 
> 
> 
> On 7/31/2018 11:00 AM, Takashi Iwai wrote:
> > 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.
> > 
> 
> Not sure if all cpu dai can provide the base delay and thus require
> component pointer callback for it. For example, in case of AMD, it uses
> designware cpu dai which is a common code.

It's not necessary that all CPU dais provide the pointer callback.
My suggestion is that, if CPU dai *wants* to provide the base delay,
it must be tied with the position value, hence it should provide the
pointer callback.  If CPU dai has a pointer callback,
snd_soc_pcm_pointer() skips the component pointer callback but uses
CPU dai pointer callback instead.

OTOH, for most of existing implementations, the delay is just
additions, and this can be still given via the existing delay
callback.  In that case, the base delay is taken from the component
driver ops, and it'll be like your patch.


Takashi

  reply	other threads:[~2018-07-31  9:25 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 10:13 [PATCH] ASoC: soc-pcm: Use delay set in pointer function Akshu Agrawal
2018-07-27 10:13 ` Akshu Agrawal
2018-07-27 15:09 ` [alsa-devel] " Pierre-Louis Bossart
2018-07-27 15:09   ` Pierre-Louis Bossart
2018-07-28  4:28   ` Agrawal, Akshu
2018-07-28  4:28     ` Agrawal, Akshu
2018-07-30 15:15     ` [alsa-devel] " Pierre-Louis Bossart
2018-07-30 15:15       ` Pierre-Louis Bossart
2018-07-30 15:32       ` Takashi Iwai
2018-07-30 15:32         ` Takashi Iwai
2018-07-30 15:50         ` Mark Brown
2018-07-30 15:50           ` Mark Brown
2018-07-31  1:25           ` [alsa-devel] " Agrawal, Akshu
2018-07-31  1:25             ` Agrawal, Akshu
2018-07-31  5:30             ` [alsa-devel] " Takashi Iwai
2018-07-31  5:30               ` Takashi Iwai
2018-07-31  9:06               ` Agrawal, Akshu
2018-07-31  9:06                 ` Agrawal, Akshu
2018-07-31  9:25                 ` Takashi Iwai [this message]
2018-07-31  9:25                   ` [alsa-devel] " Takashi Iwai
2018-07-31 10:19                   ` Mark Brown
2018-07-31 10:19                     ` Mark Brown
2018-07-31 10:32                     ` [alsa-devel] " Takashi Iwai
2018-07-31 10:32                       ` Takashi Iwai
2018-07-31 13:12                       ` Mark Brown
2018-07-31 13:12                         ` Mark Brown
2018-07-31 13:29                         ` [alsa-devel] " Takashi Iwai
2018-07-31 13:29                           ` Takashi Iwai
2018-07-31 13:51                           ` Mark Brown
2018-07-31 13:51                             ` Mark Brown
2018-07-31 13:56                             ` [alsa-devel] " Takashi Iwai
2018-07-31 13:56                               ` Takashi Iwai
2018-07-31 14:40                               ` Mark Brown
2018-07-31 14:40                                 ` Mark Brown
2018-08-01  4:01                                 ` [alsa-devel] " Agrawal, Akshu
2018-08-01  4:01                                   ` Agrawal, Akshu
2018-07-31 10:03               ` [alsa-devel] " Mark Brown
2018-07-31 10:03                 ` Mark Brown
2018-07-30 10:54 ` Mark Brown
2018-07-30 10:54   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5ha7q721vs.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=Akshu.Agrawal@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.