linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: soc-pcm: Use delay set in pointer function
@ 2018-07-27 10:13 Akshu Agrawal
  2018-07-27 15:09 ` [alsa-devel] " Pierre-Louis Bossart
  2018-07-30 10:54 ` Mark Brown
  0 siblings, 2 replies; 20+ messages in thread
From: Akshu Agrawal @ 2018-07-27 10:13 UTC (permalink / raw)
  Cc: djkurtz, akshu.agrawal, Alexander.Deucher, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai,
	moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

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.

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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-08-01  4:05 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 10:13 [PATCH] ASoC: soc-pcm: Use delay set in pointer function Akshu Agrawal
2018-07-27 15:09 ` [alsa-devel] " Pierre-Louis Bossart
2018-07-28  4:28   ` Agrawal, Akshu
2018-07-30 15:15     ` Pierre-Louis Bossart
2018-07-30 15:32       ` Takashi Iwai
2018-07-30 15:50         ` Mark Brown
2018-07-31  1:25           ` Agrawal, Akshu
2018-07-31  5:30             ` Takashi Iwai
2018-07-31  9:06               ` Agrawal, Akshu
2018-07-31  9:25                 ` Takashi Iwai
2018-07-31 10:19                   ` Mark Brown
2018-07-31 10:32                     ` Takashi Iwai
2018-07-31 13:12                       ` Mark Brown
2018-07-31 13:29                         ` Takashi Iwai
2018-07-31 13:51                           ` Mark Brown
2018-07-31 13:56                             ` Takashi Iwai
2018-07-31 14:40                               ` Mark Brown
2018-08-01  4:01                                 ` Agrawal, Akshu
2018-07-31 10:03               ` Mark Brown
2018-07-30 10:54 ` Mark Brown

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).