mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
ASoC: soc-pcm: Use delay set in component pointer function
[ Upstream commit 9fb4c2bf13
]
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9590fe082a
commit
5280001325
1 changed files with 5 additions and 0 deletions
|
@ -1165,6 +1165,9 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
|
||||||
snd_pcm_sframes_t codec_delay = 0;
|
snd_pcm_sframes_t codec_delay = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/* clearing the previous total delay */
|
||||||
|
runtime->delay = 0;
|
||||||
|
|
||||||
for_each_rtdcom(rtd, rtdcom) {
|
for_each_rtdcom(rtd, rtdcom) {
|
||||||
component = rtdcom->component;
|
component = rtdcom->component;
|
||||||
|
|
||||||
|
@ -1176,6 +1179,8 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
|
||||||
offset = component->driver->ops->pointer(substream);
|
offset = component->driver->ops->pointer(substream);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* base delay if assigned in pointer callback */
|
||||||
|
delay = runtime->delay;
|
||||||
|
|
||||||
if (cpu_dai->driver->ops->delay)
|
if (cpu_dai->driver->ops->delay)
|
||||||
delay += cpu_dai->driver->ops->delay(substream, cpu_dai);
|
delay += cpu_dai->driver->ops->delay(substream, cpu_dai);
|
||||||
|
|
Loading…
Reference in a new issue