All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Young <consult.awy@gmail.com>
To: Clemens Ladisch <clemens@ladisch.de>, alsa-devel@alsa-project.org
Subject: Re: Improving status timestamp accuracy
Date: Sat, 4 Jun 2016 11:43:56 +0100	[thread overview]
Message-ID: <5752B0EC.3030605@gmail.com> (raw)
In-Reply-To: <84551786-d910-efa0-3cc7-23a3e8f6ed8f@ladisch.de>

On 04/06/16 11:17, Clemens Ladisch wrote:
> Alan Young wrote:
>> I am looking at ways to get more accurate status timestamp information
>> for various SoC drivers.
> What for?

I want to know, at any given point in wall-clock time, how many samples 
have been output. I want this to an accuracy better than period time. I 
want this when the output buffer is not being kept full, and therefore I 
cannot rely on polls firing only on period boundaries.

>> A call to snd_pcm_status() result in snd_pcm_update_hw_ptr0() being
>> called. This gets the current output position (pos) via
>> substream->ops->pointer(substream) and then makes all the other
>> calculations based on the result. In theory, the result of
>> substream->ops->pointer() could be sample accurate but in practice it
>> is very unlikely to be better than period accurate.
> Accurate timestamps make sense only with accurate pointers.  The purpose
> of these timestamps is to allow better prediction of the position of the
> DMA pointer, but this is pointless when the DMA pointer does large jumps.
>

I think that that was exactly my point. The DMA pointer does large 
jumps. An accurate position is only obtained at the point of an 
interrupt callback. Attempting to rely on more accurate reports from the 
DMA subsystems outside of an interrupt is doomed to failure. Therefore, 
base reports on the data obtained at the last interrupt point.

Alan.

  reply	other threads:[~2016-06-04 10:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-04  9:31 Improving status timestamp accuracy Alan Young
2016-06-04 10:17 ` Clemens Ladisch
2016-06-04 10:43   ` Alan Young [this message]
2016-06-04 15:59     ` Clemens Ladisch
2016-06-04 16:20       ` Alan Young
2016-06-05 16:27         ` Clemens Ladisch
2016-06-05 16:32           ` Alan Young
2016-06-05  1:14 ` Raymond Yau
2016-06-05 10:33   ` Alan Young
2016-06-06  1:24     ` Raymond Yau
2016-06-06  9:40       ` Alan Young
2016-06-06  8:34     ` Takashi Iwai
2016-06-06  9:42       ` Alan Young
2016-06-06 14:53         ` Pierre-Louis Bossart
2016-06-07  6:44           ` Alan Young
2016-06-07 18:01             ` Pierre-Louis Bossart
2016-07-08 15:03             ` Alan Young
2016-07-15 20:13               ` Pierre-Louis Bossart
2016-07-19 15:33                 ` Alan Young
2016-07-19 15:58                   ` Pierre-Louis Bossart
2016-07-20  6:59                     ` Alan Young
2016-08-01 21:56                       ` Pierre-Louis Bossart
2016-08-02  7:30                         ` Alan Young
2016-08-02  7:55                           ` Clemens Ladisch
2016-08-02 16:25                           ` Pierre-Louis Bossart

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=5752B0EC.3030605@gmail.com \
    --to=consult.awy@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.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.