All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org, lrg@ti.com
Subject: Re: [PATCH] ALSA: pcm - introduce soc_delay
Date: Mon, 23 Jul 2012 22:27:23 +0100	[thread overview]
Message-ID: <20120723212723.GD12438@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <500DB11C.1050007@linux.intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 1868 bytes --]

On Mon, Jul 23, 2012 at 03:16:28PM -0500, Pierre-Louis Bossart wrote:

> >Right, but this depends on the ability of the device to pause reading
> >data when it reads up to the point where the application has written.
> >This is a separate capability to any latency that's been added by the
> >buffering, and most of the systems that have the buffering don't have
> >this capability but instead either don't report the buffer or rely on
> >the application being a full buffer ahead of the hardware.

> We don't have such fancy hardware (and I don't think anyone has).
> This can happen even with simple IP that has an embedded SRAM and
> bursty DMA,  if the IP buffer amounts to the period size to avoid

The usual way of representing this is to have the pointers in the buffer
represent where the input to the hardware pipeline is at (ie, where the
actual DMA is reading) and handle underflow on that normally.

> partial wakes or transfers, and the application cannot provide more
> than one period initially you get an underflow that isn't a true
> one.

Normally this is handled by requiring that the application has at least
one period ready for the hardware at all times, otherwise as you get
down towards the end of the buffer things get racier and racier.  It's
not really about the delay, either - it's about when the DMA wants to
read the memory which isn't quite the same thing.  It could be that it
does this with half the buffer remaining, it could be that it waits
until it's got some much smaller amount of data left.

I think what's really needed here is to represent the buffer in the
hardware and how it's filled up to the stack more directly.  It's not
the fact that there is data buffered that we need to tell the stack
about (we can already do that), what we need to tell it is that the
trigger level for refilling that may not be what's expected.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2012-07-23 21:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23 10:06 [PATCH] ALSA: pcm - introduce soc_delay Vinod Koul
2012-07-23 10:18 ` Mark Brown
2012-07-23 10:39   ` Vinod Koul
2012-07-23 10:47     ` Mark Brown
2012-07-23 11:06       ` Vinod Koul
2012-07-23 13:47         ` Mark Brown
2012-07-23 19:51       ` Pierre-Louis Bossart
2012-07-23 20:05         ` Mark Brown
2012-07-23 20:16           ` Pierre-Louis Bossart
2012-07-23 21:27             ` Mark Brown [this message]
2012-07-23 14:21     ` Jassi Brar
2012-07-23 10:19 ` Jassi Brar
2012-07-23 10:39   ` Vinod Koul
2012-07-23 10:50     ` Jassi Brar
2012-07-23 11:17       ` Vinod Koul
2012-07-23 11:23         ` Mark Brown
2012-07-23 13:37         ` Jassi Brar
2012-07-23 10:27 ` Takashi Iwai
2012-07-23 10:47   ` Vinod Koul
2012-07-23 10:47   ` Jaroslav Kysela
2012-07-23 11:14     ` 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=20120723212723.GD12438@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@ti.com \
    --cc=pierre-louis.bossart@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.