lkml.org 
[lkml]   [2018]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [alsa-devel] [PATCH] ASoC: soc-pcm: Use delay set in pointer function
From
Date
On 7/27/18 5:13 AM, Akshu Agrawal wrote:
> 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.

Humm, yes the runtime->delay set in the .pointer function would be lost
without this change, but the delay would still be provided in the
followup call to .delay.
With your change, the same delay will be accounted for twice?

>
> Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
> ---
> 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;
> }
>

\
 
 \ /
  Last update: 2018-07-27 17:10    [W:0.038 / U:3.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site