alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"R, Dharageswari" <dharageswari.r@intel.com>,
	Patches Audio <patches.audio@intel.com>,
	"Shah, Hardik T" <hardik.t.shah@intel.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"Ughreja, Rakesh A" <rakesh.a.ughreja@intel.com>,
	"Girdwood, Liam R" <liam.r.girdwood@intel.com>,
	"Kp, Jeeja" <jeeja.kp@intel.com>
Subject: Re: [PATCH v2 09/11] ASoC: Intel: Skylake:	Fix DMA position reporting for capture stream
Date: Tue, 28 Mar 2017 14:15:29 +0530	[thread overview]
Message-ID: <20170328084529.GR9308@localhost> (raw)
In-Reply-To: <s5hefxiood9.wl-tiwai@suse.de>

On Mon, Mar 27, 2017 at 03:12:02PM +0200, Takashi Iwai wrote:
> On Mon, 27 Mar 2017 12:29:54 +0200,
> Vinod Koul wrote:
> > 
> > On Sat, Mar 25, 2017 at 02:21:13AM +0530, Ughreja, Rakesh A wrote:
> > > >> >Are these workarounds needed for the legacy driver?
> > > >> >If yes, which chips require it?
> > > >> >
> > > >>
> > > >> Yes, these are needed in legacy driver as well.
> > > >> From SKL and BXT onwards, it is needed.
> > > >
> > > >OK, thanks for confirmation.
> > > >
> > > >Now, from what I read in the above, is the workaround required *only*
> > > >after the interrupt is generated?  20us delay isn't so cheap, and we
> > > >tend to inquire PCM positions often.  If the workaround is needed only
> > > >after the PCM period elapse, we can set some flag in the irq handler
> > > >and apply the workaround only when necessary.
> > > >
> > > 
> > > Yes, Takashi the workaround is required only in the period elapsed
> > > interrupt. In some cases the DMA Position updates are delayed and so
> > > when the period elapsed interrupt occurs the wait_for_avail thinks that
> > > one period worth of data is not available and so returns only on the 
> > > next period elapsed interrupt. This creates problem for 2 periods
> > > playback/capture streams.
> > > 
> > > So even in the period elapsed interrupt the wait is required only if the
> > > position is less than the period boundary.
> > 
> > Hi Takashi,
> > 
> > So we need this for 2 periods when the device is in irq mode. Not for other
> > cases. ie SKL_PLUS..
> 
> Yeah, thanks.  I'd cook a couple of patches to do that for the legacy
> driver.  But I still wonder whether the wait is always needed.
> 
> Judging from the description, does the discrepancy of posbuf read
> happen *only* when the DMA position goes across the BD boundary?
> Or does it happen at any time?

I think it can happen anytime, but the impact is not felt unless we have a 2
period case. The update is in-flight, so read returns a value lesser than
period boundary. We will sleep till next period ie next wake, which results
in overrun. For more than 2 periods it doesn't impact much as the overrun
case should not happen

> When you trace, you can see that the apps frequently inquires the
> position.  So, an unconditional wait should be really avoided.

If they enquire after a while then we should be okay, but if they are
written nicely with good power behaviour then we may have issue, as writes
are typically done after period boundaries.

> 
> > But have you seen any user reports on this till now.
> 
> I've seen some bug reports mentioning about crackling audio capture on
> SKL (I forgot URLs).  It might be triggered by that.

Quiet possible..

-- 
~Vinod

  reply	other threads:[~2017-03-28  8:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 17:40 [PATCH v2 00/11] ASoC: Intel: Skylake: More driver updates jeeja.kp
2017-03-24 17:40 ` [PATCH v2 01/11] ALSA: hda: Fix LLCH register read jeeja.kp
2017-03-24 18:37   ` Takashi Iwai
2017-03-24 17:40 ` [PATCH v2 02/11] ASoC: Intel: Skylake: Use the sig_bits to define dai bps capability jeeja.kp
2017-03-24 17:40 ` [PATCH v2 03/11] ASoC: hdac_hdmi: Update sig_bits based on converter capability jeeja.kp
2017-03-24 17:40 ` [PATCH v2 04/11] ASoC: Intel: Skylake: Add 16-bit constraint to FE bxt_rt298 machine jeeja.kp
2017-03-24 17:40 ` [PATCH v2 05/11] ASoC: Intel: Skylake: Don't unload module when in use jeeja.kp
2017-03-24 17:40 ` [PATCH v2 06/11] ASoC: Intel: Skylake: Remove redundant vmixer handler jeeja.kp
2017-03-24 17:40 ` [PATCH v2 07/11] ASoC: Intel: Skylake: remove hard coded ACPI path jeeja.kp
2017-03-24 17:40 ` [PATCH v2 08/11] ASoC: Intel: Skylake: Rearrangement of code to cleanup SKL SST library jeeja.kp
2017-03-24 17:40 ` [PATCH v2 09/11] ASoC: Intel: Skylake: Fix DMA position reporting for capture stream jeeja.kp
2017-03-24 18:38   ` Takashi Iwai
2017-03-24 18:43     ` Ughreja, Rakesh A
2017-03-24 18:49       ` Takashi Iwai
2017-03-24 20:51         ` Ughreja, Rakesh A
2017-03-27 10:29           ` Vinod Koul
2017-03-27 13:12             ` Takashi Iwai
2017-03-28  8:45               ` Vinod Koul [this message]
2017-03-29 11:54   ` Applied "ASoC: Intel: Skylake: Fix DMA position reporting for capture stream" to the asoc tree Mark Brown
2017-03-24 17:40 ` [PATCH v2 10/11] ASoC: Intel: Skylake: Fix module state after unbind and delete jeeja.kp
2017-03-24 17:40 ` [PATCH v2 11/11] ASoC: Intel: Skylake: Add support for deferred DSP module bind jeeja.kp
2017-03-27 10:31 ` [PATCH v2 00/11] ASoC: Intel: Skylake: More driver updates Vinod Koul

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=20170328084529.GR9308@localhost \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=dharageswari.r@intel.com \
    --cc=hardik.t.shah@intel.com \
    --cc=jeeja.kp@intel.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=patches.audio@intel.com \
    --cc=rakesh.a.ughreja@intel.com \
    --cc=tiwai@suse.de \
    /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).