All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Agrawal, Akshu" <Akshu.Agrawal@amd.com>
To: Takashi Iwai <tiwai@suse.de>
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 14:36:59 +0530	[thread overview]
Message-ID: <5b3249cb-6212-6a14-b644-7548cf0ad00c@amd.com> (raw)
In-Reply-To: <s5hwotc0y6v.wl-tiwai@suse.de>



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.

>> 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?
> 

Don't know, was looking who all might have been impacted by this.

Thanks,
Akshu

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



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.

>> 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?
> 

Don't know, was looking who all might have been impacted by this.

Thanks,
Akshu

  reply	other threads:[~2018-07-31  9:07 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 [this message]
2018-07-31  9:06                 ` Agrawal, Akshu
2018-07-31  9:25                 ` [alsa-devel] " Takashi Iwai
2018-07-31  9:25                   ` 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=5b3249cb-6212-6a14-b644-7548cf0ad00c@amd.com \
    --to=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 \
    --cc=tiwai@suse.de \
    /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.