All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Young <Alan.Young@IEE.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Takashi Iwai <tiwai@suse.de>
Cc: Raymond Yau <superquad.vortex2@gmail.com>, alsa-devel@alsa-project.org
Subject: Re: Improving status timestamp accuracy
Date: Wed, 20 Jul 2016 07:59:05 +0100	[thread overview]
Message-ID: <578F2139.9060001@IEE.org> (raw)
In-Reply-To: <805c3724-f027-a405-5704-3b343aa5404b@linux.intel.com>

On 19/07/16 16:58, Pierre-Louis Bossart wrote:
>> In update_audio_tstamp() it either usedruntime->delay, if
>> runtime->audio_tstamp_config.report_delay is true, or applies a delta -
>> not both.
>
> ah yes, I did miss it in the code. maybe a comment would be nice to 
> avoid being thrown.
ok

> I still have mixed feelings about the code, it seems to make sense for 
> the case where the .pointer is updated at every period, but it's not 
> using the regular BATCH definition. With the tests such as
> runtime->status->hw_ptr == runtime->hw_ptr_interrupt you could end-up 
> modifying the results by a small amount for other hardware platforms 
> depending on when the timestamp is taken (in other words scheduling 
> latency would affect audio timestamps).
>

Yes, that could be true - there could be some jitter -  but I think it 
will still result in more accurate results. Note that the adjustment to 
the reported audio_tstamp will only occur for the 
AUDIO_TSTAMP_TYPE_DEFAULT case and when the platform has not updated the 
(hw_ptr) position outside of the interrupt callback independent of 
whether the BATCH flag is used.

There is actually an argument for being less restrictive. Hardware 
platform updates to position, where they happen outside of an interrupt, 
may (generally will) be less accurate than the update mechanism that I 
propose because such position updates are mostly restricted to the level 
of DMA residue granularity, which is relatively coarse (usually).

>
> if your timestamps are REALTIME since they can jump backwards. The 
> expectation is to use MONOTONOUS (or better MONOTONOUS_RAW to avoid  
> NTP corrections), but with the ALSA API the application can choose 
> REALTIME. 

Ok, I'll put in  a check. Of course there are cases where one might 
actually want REALTIME.

Note: For my application, I only actually care about the changes 
implemented using update_delay(). The refinement to 
update_audio_tstamp() just seemed to me to be part of the same issue. If 
the update_audio_tstamp() change is considered too controversial then 
I'd be happy to drop it.

  reply	other threads:[~2016-07-20  6:59 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
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 [this message]
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=578F2139.9060001@IEE.org \
    --to=alan.young@iee.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=superquad.vortex2@gmail.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.