linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Akshu Agrawal" <akshu.agrawal@amd.com>
Cc: "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>,
	"Mark Brown" <broonie@kernel.org>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] ASoC: soc-pcm: Use delay set in component pointer function
Date: Wed, 01 Aug 2018 14:03:06 +0200	[thread overview]
Message-ID: <s5h8t5qnvk5.wl-tiwai@suse.de> (raw)
In-Reply-To: <1533118054-14509-1-git-send-email-akshu.agrawal@amd.com>

On Wed, 01 Aug 2018 12:07:33 +0200,
Akshu Agrawal wrote:
> 
> 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 <akshu.agrawal@amd.com>

Reviewed-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi


> ---
>  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);
> -- 
> 1.9.1
> 
> 

  reply	other threads:[~2018-08-01 12:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01 10:07 [PATCH v2] ASoC: soc-pcm: Use delay set in component pointer function Akshu Agrawal
2018-08-01 12:03 ` Takashi Iwai [this message]
2018-08-01 13:31 ` Applied "ASoC: soc-pcm: Use delay set in component pointer function" to the asoc tree 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=s5h8t5qnvk5.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=Alexander.Deucher@amd.com \
    --cc=akshu.agrawal@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=perex@perex.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).