All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v4 1/4] Produce system time from correlated clocksource
Date: Tue, 13 Oct 2015 06:58:32 +0200	[thread overview]
Message-ID: <20151013045832.GA2437@netboy> (raw)
In-Reply-To: <1444675522-4198-2-git-send-email-christopher.s.hall@intel.com>

On Mon, Oct 12, 2015 at 11:45:19AM -0700, Christopher S. Hall wrote:
> Another representative use case of time sync and the correlated
> clocksource (in addition to PTP noted above) is PTP synchronized
> audio.

The added explanations of the audio use case do help.  However, you
did not address my point in the last series in any way.
 
> In a streaming application, as an example, samples will be sent
> and/or received by multiple devices with a presentation time that is
> in terms of the PTP master clock. Synchronizing the audio output on
> these devices requires correlating the audio clock with the PTP
> master clock. The more precise this correlation is, the better the
> audio quality (i.e. out of sync audio sounds bad).

^^^^
This is mega important.  You want to convert PTP time into audio clock
time.  There is no need for the system time at all.
 
> From an application standpoint, to correlate the PTP master clock
> with the audio device clock, the system clock is used as a
> intermediate timebase.

But why involve the system time base?

> The transforms such an application would
> perform are:
> 
> System Clock <-> Audio clock
> System Clock <-> Network Device Clock [<-> PTP Master Clock]

This is extra work with no benefit.  In fact, this hurts you
because of the need to take avoid update_wall_time AND because of the
NTP frequency adjustments.  Cascaded servos are prone to gain peaking,
and this can easily avoided in this case.
 
> Modern Intel platforms can perform a more accurate cross-
> timestamp in hardware (ART,audio device clock).  The audio driver
> requires ART->system time transforms -- the same as required for
> the network driver.

No, it doesn't need the system time.  It only needs the PTP time.

> The modification to the original patch accomodates these
> slow devices by adding the option of providing an ART value outside
> of the retry loop and adding a history which can consulted in the
> case of an out of date counter value. The history is kept by
> making the shadow_timekeeper an array. Each write to the
> timekeeper rotates through the array, preserving a
> history of updates.

This is all wrong.  All you need to provide the DSP with (ART, PTP)
pairs.  This can be done in a multiple of the DSP period, like every
1, 10, or 100 milliseconds.

Thanks,
Richard

WARNING: multiple messages have this Message-ID (diff)
From: Richard Cochran <richardcochran@gmail.com>
To: "Christopher S. Hall" <christopher.s.hall@intel.com>
Cc: jeffrey.t.kirsher@intel.com, hpa@zytor.com, mingo@redhat.com,
	tglx@linutronix.de, john.stultz@linaro.org, peterz@infradead.org,
	x86@kernel.org, intel-wired-lan@lists.osuosl.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kevin.b.stanton@intel.com
Subject: Re: [PATCH v4 1/4] Produce system time from correlated clocksource
Date: Tue, 13 Oct 2015 06:58:32 +0200	[thread overview]
Message-ID: <20151013045832.GA2437@netboy> (raw)
In-Reply-To: <1444675522-4198-2-git-send-email-christopher.s.hall@intel.com>

On Mon, Oct 12, 2015 at 11:45:19AM -0700, Christopher S. Hall wrote:
> Another representative use case of time sync and the correlated
> clocksource (in addition to PTP noted above) is PTP synchronized
> audio.

The added explanations of the audio use case do help.  However, you
did not address my point in the last series in any way.
 
> In a streaming application, as an example, samples will be sent
> and/or received by multiple devices with a presentation time that is
> in terms of the PTP master clock. Synchronizing the audio output on
> these devices requires correlating the audio clock with the PTP
> master clock. The more precise this correlation is, the better the
> audio quality (i.e. out of sync audio sounds bad).

^^^^
This is mega important.  You want to convert PTP time into audio clock
time.  There is no need for the system time at all.
 
> From an application standpoint, to correlate the PTP master clock
> with the audio device clock, the system clock is used as a
> intermediate timebase.

But why involve the system time base?

> The transforms such an application would
> perform are:
> 
> System Clock <-> Audio clock
> System Clock <-> Network Device Clock [<-> PTP Master Clock]

This is extra work with no benefit.  In fact, this hurts you
because of the need to take avoid update_wall_time AND because of the
NTP frequency adjustments.  Cascaded servos are prone to gain peaking,
and this can easily avoided in this case.
 
> Modern Intel platforms can perform a more accurate cross-
> timestamp in hardware (ART,audio device clock).  The audio driver
> requires ART->system time transforms -- the same as required for
> the network driver.

No, it doesn't need the system time.  It only needs the PTP time.

> The modification to the original patch accomodates these
> slow devices by adding the option of providing an ART value outside
> of the retry loop and adding a history which can consulted in the
> case of an out of date counter value. The history is kept by
> making the shadow_timekeeper an array. Each write to the
> timekeeper rotates through the array, preserving a
> history of updates.

This is all wrong.  All you need to provide the DSP with (ART, PTP)
pairs.  This can be done in a multiple of the DSP period, like every
1, 10, or 100 milliseconds.

Thanks,
Richard

  reply	other threads:[~2015-10-13  4:58 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 18:45 [Intel-wired-lan] [PATCH v4 0/4] Patchset enabling hardware based cross-timestamps for next gen Intel platforms Christopher S. Hall
2015-10-12 18:45 ` Christopher S. Hall
2015-10-12 18:45 ` [Intel-wired-lan] [PATCH v4 1/4] Produce system time from correlated clocksource Christopher S. Hall
2015-10-12 18:45   ` Christopher S. Hall
2015-10-13  4:58   ` Richard Cochran [this message]
2015-10-13  4:58     ` Richard Cochran
2015-10-13  7:51     ` [Intel-wired-lan] " Thomas Gleixner
2015-10-13  7:51       ` Thomas Gleixner
2015-10-13  8:31       ` [Intel-wired-lan] " Richard Cochran
2015-10-13  8:31         ` Richard Cochran
2015-10-13 19:15         ` [Intel-wired-lan] " Thomas Gleixner
2015-10-13 19:15           ` Thomas Gleixner
2015-10-13 21:12           ` [Intel-wired-lan] " Richard Cochran
2015-10-13 21:12             ` Richard Cochran
2015-10-14  7:21             ` [Intel-wired-lan] " Thomas Gleixner
2015-10-14  7:21               ` Thomas Gleixner
2015-10-14  9:29               ` [Intel-wired-lan] " Richard Cochran
2015-10-14  9:29                 ` Richard Cochran
2015-10-14 14:22                 ` [Intel-wired-lan] " Thomas Gleixner
2015-10-14 14:22                   ` Thomas Gleixner
2015-10-14 16:18                   ` [Intel-wired-lan] " Richard Cochran
2015-10-14 16:18                     ` Richard Cochran
2015-10-15  2:34             ` [Intel-wired-lan] " Christopher Hall
2015-10-15  2:34               ` Christopher Hall
2015-10-15  5:41               ` [Intel-wired-lan] " Richard Cochran
2015-10-15  5:41                 ` Richard Cochran
2015-10-15  8:13                 ` [Intel-wired-lan] " Thomas Gleixner
2015-10-15  8:13                   ` Thomas Gleixner
2015-10-13  5:26   ` [Intel-wired-lan] " Richard Cochran
2015-10-13  5:26     ` Richard Cochran
2015-10-13 13:50   ` [Intel-wired-lan] " Richard Cochran
2015-10-13 13:50     ` Richard Cochran
2015-10-13 19:42   ` [Intel-wired-lan] " Thomas Gleixner
2015-10-13 19:42     ` Thomas Gleixner
2015-10-15  1:57     ` [Intel-wired-lan] " Christopher Hall
2015-10-15  1:57       ` Christopher Hall
2015-10-15  5:57       ` [Intel-wired-lan] " Richard Cochran
2015-10-15  5:57         ` Richard Cochran
2015-10-15  8:15       ` [Intel-wired-lan] " Thomas Gleixner
2015-10-15  8:15         ` Thomas Gleixner
2015-10-20  0:18         ` [Intel-wired-lan] " Christopher Hall
2015-10-20  0:18           ` Christopher Hall
2015-10-20  0:36           ` [Intel-wired-lan] " John Stultz
2015-10-20  0:36             ` John Stultz
2015-10-20  8:54             ` [Intel-wired-lan] " Richard Cochran
2015-10-20  8:54               ` Richard Cochran
2015-10-20 10:48               ` [Intel-wired-lan] " Thomas Gleixner
2015-10-20 10:48                 ` Thomas Gleixner
2015-10-20 11:51                 ` [Intel-wired-lan] " Richard Cochran
2015-10-20 11:51                   ` Richard Cochran
2015-10-20 14:55                   ` [Intel-wired-lan] " Richard Cochran
2015-10-20 14:55                     ` Richard Cochran
2015-10-20 19:11                     ` [Intel-wired-lan] " Thomas Gleixner
2015-10-20 19:11                       ` Thomas Gleixner
2015-10-20 19:36                       ` [Intel-wired-lan] " Richard Cochran
2015-10-20 19:36                         ` Richard Cochran
2015-10-20 20:16                       ` [Intel-wired-lan] " John Stultz
2015-10-20 20:16                         ` John Stultz
2015-10-21  7:44                         ` [Intel-wired-lan] " Thomas Gleixner
2015-10-21  7:44                           ` Thomas Gleixner
2015-11-03 19:18                           ` [Intel-wired-lan] " Stanton, Kevin B
2015-11-03 19:18                             ` Stanton, Kevin B
2015-11-09 21:17                             ` [Intel-wired-lan] " John Stultz
2015-11-09 21:17                               ` John Stultz
2015-10-12 18:45 ` [Intel-wired-lan] [PATCH v4 2/4] Always running timer " Christopher S. Hall
2015-10-12 18:45   ` Christopher S. Hall
2015-10-13  2:03   ` [Intel-wired-lan] " kbuild test robot
2015-10-13  2:03     ` kbuild test robot
2015-11-18 23:53   ` [Intel-wired-lan] " Jacob Pan
2015-11-18 23:53     ` Jacob Pan
2015-10-12 18:45 ` [Intel-wired-lan] [PATCH v4 3/4] Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping Christopher S. Hall
2015-10-12 18:45   ` Christopher S. Hall
2015-10-13 13:59   ` [Intel-wired-lan] " Richard Cochran
2015-10-13 13:59     ` Richard Cochran
2015-10-15  2:47     ` [Intel-wired-lan] " Christopher Hall
2015-10-15  2:47       ` Christopher Hall
2015-11-07  2:15     ` [Intel-wired-lan] " Christopher Hall
2015-11-07  2:15       ` Christopher Hall
2015-10-12 18:45 ` [Intel-wired-lan] [PATCH v4 4/4] Adds hardware supported cross timestamp Christopher S. Hall
2015-10-12 18:45   ` Christopher S. Hall
2015-10-13  2:10   ` [Intel-wired-lan] " kbuild test robot
2015-10-13  2:10     ` kbuild test robot
2015-10-13  2:11   ` [Intel-wired-lan] " kbuild test robot
2015-10-13  2:11     ` kbuild test robot
2015-10-13  2:31   ` [Intel-wired-lan] " David Miller
2015-10-13  2:31     ` David Miller

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=20151013045832.GA2437@netboy \
    --to=richardcochran@gmail.com \
    --cc=intel-wired-lan@osuosl.org \
    /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.