alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: jeeja.kp@intel.com
To: alsa-devel@alsa-project.org
Cc: patches.audio@intel.com, Jeeja KP <jeeja.kp@intel.com>,
	broonie@kernel.org, Vinod Koul <vinod.koul@intel.com>,
	liam.r.girdwood@intel.com
Subject: [PATCH 10/10] ASoC: Intel: Skylake: Report position in pointer query
Date: Fri,  3 Jun 2016 18:29:43 +0530	[thread overview]
Message-ID: <1464958783-19344-11-git-send-email-jeeja.kp@intel.com> (raw)
In-Reply-To: <1464958783-19344-1-git-send-email-jeeja.kp@intel.com>

From: Jeeja KP <jeeja.kp@intel.com>

Don't update the runtime_delay in pointer query, delay need to
reported as part of soc driver ops delay function. The delay
value overwritten by ASoC core so this is dummy code and hence
removing it.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-pcm.c | 64 +++------------------------------------
 1 file changed, 4 insertions(+), 60 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 1590bef..6e05bf8 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -1026,51 +1026,11 @@ static int skl_platform_pcm_trigger(struct snd_pcm_substream *substream,
 	return 0;
 }
 
-/* calculate runtime delay from LPIB */
-static int skl_get_delay_from_lpib(struct hdac_ext_bus *ebus,
-				struct hdac_ext_stream *sstream,
-				unsigned int pos)
-{
-	struct hdac_bus *bus = ebus_to_hbus(ebus);
-	struct hdac_stream *hstream = hdac_stream(sstream);
-	struct snd_pcm_substream *substream = hstream->substream;
-	int stream = substream->stream;
-	unsigned int lpib_pos = snd_hdac_stream_get_pos_lpib(hstream);
-	int delay;
-
-	if (stream == SNDRV_PCM_STREAM_PLAYBACK)
-		delay = pos - lpib_pos;
-	else
-		delay = lpib_pos - pos;
-
-	if (delay < 0) {
-		if (delay >= hstream->delay_negative_threshold)
-			delay = 0;
-		else
-			delay += hstream->bufsize;
-	}
-
-	if (hstream->bufsize == delay)
-		delay = 0;
-
-	if (delay >= hstream->period_bytes) {
-		dev_info(bus->dev,
-			 "Unstable LPIB (%d >= %d); disabling LPIB delay counting\n",
-			 delay, hstream->period_bytes);
-		delay = 0;
-	}
-
-	return bytes_to_frames(substream->runtime, delay);
-}
-
-static unsigned int skl_get_position(struct hdac_ext_stream *hstream,
-					int codec_delay)
+static snd_pcm_uframes_t skl_platform_pcm_pointer
+			(struct snd_pcm_substream *substream)
 {
-	struct hdac_stream *hstr = hdac_stream(hstream);
-	struct snd_pcm_substream *substream = hstr->substream;
-	struct hdac_ext_bus *ebus;
+	struct hdac_ext_stream *hstream = get_hdac_ext_stream(substream);
 	unsigned int pos;
-	int delay;
 
 	/* use the position buffer as default */
 	pos = snd_hdac_stream_get_pos_posbuf(hdac_stream(hstream));
@@ -1078,23 +1038,7 @@ static unsigned int skl_get_position(struct hdac_ext_stream *hstream,
 	if (pos >= hdac_stream(hstream)->bufsize)
 		pos = 0;
 
-	if (substream->runtime) {
-		ebus = get_bus_ctx(substream);
-		delay = skl_get_delay_from_lpib(ebus, hstream, pos)
-						 + codec_delay;
-		substream->runtime->delay += delay;
-	}
-
-	return pos;
-}
-
-static snd_pcm_uframes_t skl_platform_pcm_pointer
-			(struct snd_pcm_substream *substream)
-{
-	struct hdac_ext_stream *hstream = get_hdac_ext_stream(substream);
-
-	return bytes_to_frames(substream->runtime,
-			       skl_get_position(hstream, 0));
+	return bytes_to_frames(substream->runtime, pos);
 }
 
 static u64 skl_adjust_codec_delay(struct snd_pcm_substream *substream,
-- 
2.5.0

  parent reply	other threads:[~2016-06-03 12:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 12:59 [PATCH 00/10] ASoC: Intel: Skylake: Improvements in Skylake driver jeeja.kp
2016-06-03 12:59 ` [PATCH 01/10] ASoC: Intel: Skylake: Reset DSP pipe when host/link DMA is reset jeeja.kp
2016-06-07 13:27   ` Applied "ASoC: Intel: Skylake: Reset DSP pipe when host/link DMA is reset" to the asoc tree Mark Brown
2016-06-03 12:59 ` [PATCH 02/10] ASoC: Intel: Skylake: Set the pipe state to paused when paused jeeja.kp
2016-06-07 12:56   ` Mark Brown
2016-06-08  9:39     ` Jeeja KP
2016-06-07 13:27   ` Applied "ASoC: Intel: Skylake: Set the pipe state to paused when paused" to the asoc tree Mark Brown
2016-06-03 12:59 ` [PATCH 03/10] ASoC: Intel: Skylake: Don't pause stopped pipeline while deleting jeeja.kp
2016-06-07 13:27   ` Applied "ASoC: Intel: Skylake: Don't pause stopped pipeline while deleting" to the asoc tree Mark Brown
2016-06-03 12:59 ` [PATCH 04/10] ASoC: Intel: Skylake: Disable SRAM Retention before D3 jeeja.kp
2016-06-03 13:04   ` Takashi Iwai
2016-06-03 16:15     ` Ughreja, Rakesh A
2016-06-07 13:27   ` Applied "ASoC: Intel: Skylake: Disable SRAM Retention before D3" to the asoc tree Mark Brown
2016-06-03 12:59 ` [PATCH 05/10] ASoC: Intel: Skylake: Avoid freeing up of unallocated memory/mcps jeeja.kp
2016-06-07 13:27   ` Applied "ASoC: Intel: Skylake: Avoid freeing up of unallocated memory/mcps" to the asoc tree Mark Brown
2016-06-03 12:59 ` [PATCH 06/10] ASoC: Intel: Skylake: Clean up of driver resources in suspend jeeja.kp
2016-06-07 13:27   ` Applied "ASoC: Intel: Skylake: Clean up of driver resources in suspend" to the asoc tree Mark Brown
2016-06-03 12:59 ` [PATCH 07/10] ASoC: Intel: Skylake: Create Pipe to widget list in soc probe jeeja.kp
2016-06-07 13:27   ` Applied "ASoC: Intel: Skylake: Create Pipe to widget list in soc probe" to the asoc tree Mark Brown
2016-06-03 12:59 ` [PATCH 08/10] ASoC: Intel: Skylake: Set the DSP pipe type jeeja.kp
2016-06-07 13:27   ` Applied "ASoC: Intel: Skylake: Set the DSP pipe type" to the asoc tree Mark Brown
2016-06-03 12:59 ` [PATCH 09/10] ASoC: Intel: Skylake: Copy the pipe parameter by pipe type jeeja.kp
2016-06-07 13:27   ` Applied "ASoC: Intel: Skylake: Copy the pipe parameter by pipe type" to the asoc tree Mark Brown
2016-06-03 12:59 ` jeeja.kp [this message]
2016-06-07 13:27   ` Applied "ASoC: Intel: Skylake: Report position in pointer query" " 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=1464958783-19344-11-git-send-email-jeeja.kp@intel.com \
    --to=jeeja.kp@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@intel.com \
    --cc=patches.audio@intel.com \
    --cc=vinod.koul@intel.com \
    /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).