Skip to content

Commit 5280001

Browse files
Akshu Agrawalgregkh
Akshu Agrawal
authored andcommitted
ASoC: soc-pcm: Use delay set in component pointer function
[ Upstream commit 9fb4c2b ] 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 <[email protected]> Reviewed-by: Takashi Iwai <[email protected]> Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9590fe0 commit 5280001

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sound/soc/soc-pcm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,9 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
11651165
snd_pcm_sframes_t codec_delay = 0;
11661166
int i;
11671167

1168+
/* clearing the previous total delay */
1169+
runtime->delay = 0;
1170+
11681171
for_each_rtdcom(rtd, rtdcom) {
11691172
component = rtdcom->component;
11701173

@@ -1176,6 +1179,8 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
11761179
offset = component->driver->ops->pointer(substream);
11771180
break;
11781181
}
1182+
/* base delay if assigned in pointer callback */
1183+
delay = runtime->delay;
11791184

11801185
if (cpu_dai->driver->ops->delay)
11811186
delay += cpu_dai->driver->ops->delay(substream, cpu_dai);

0 commit comments

Comments
 (0)