linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Henrik Austad <henrik@austad.us>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Richard Cochran <richardcochran@gmail.com>
Cc: alsa-devel@alsa-project.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@linaro.org>,
	linux-media@vger.kernel.org
Subject: Re: [alsa-devel] [very-RFC 0/8] TSN driver for the kernel
Date: Thu, 23 Jun 2016 12:38:48 +0200	[thread overview]
Message-ID: <20160623103848.GG32724@icarus.home.austad.us> (raw)
In-Reply-To: <07283da9-f6d1-c3b1-7989-a6fce7ca0ee6@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 3116 bytes --]

On Tue, Jun 21, 2016 at 10:45:18AM -0700, Pierre-Louis Bossart wrote:
> On 6/20/16 5:18 AM, Richard Cochran wrote:
> >On Mon, Jun 20, 2016 at 01:08:27PM +0200, Pierre-Louis Bossart wrote:
> >>The ALSA API provides support for 'audio' timestamps (playback/capture rate
> >>defined by audio subsystem) and 'system' timestamps (typically linked to
> >>TSC/ART) with one option to take synchronized timestamps should the hardware
> >>support them.
> >
> >Thanks for the info.  I just skimmed Documentation/sound/alsa/timestamping.txt.
> >
> >That is fairly new, only since v4.1.  Are then any apps in the wild
> >that I can look at?  AFAICT, OpenAVB, gstreamer, etc, don't use the
> >new API.
> 
> The ALSA API supports a generic .get_time_info callback, its implementation
> is for now limited to a regular 'DMA' or 'link' timestamp for HDaudio - the
> difference being which counters are used and how close they are to the link
> serializer. The synchronized part is still WIP but should come 'soon'

Interesting, would you mind CCing me in on those patches?

> >>The intent was that the 'audio' timestamps are translated to a shared time
> >>reference managed in userspace by gPTP, which in turn would define if
> >>(adaptive) audio sample rate conversion is needed. There is no support at
> >>the moment for a 'play_at' function in ALSA, only means to control a
> >>feedback loop.
> >
> >Documentation/sound/alsa/timestamping.txt says:
> >
> >  If supported in hardware, the absolute link time could also be used
> >  to define a precise start time (patches WIP)
> >
> >Two questions:
> >
> >1. Where are the patches?  (If some are coming, I would appreciate
> >   being on CC!)
> >
> >2. Can you mention specific HW that would support this?
> 
> You can experiment with the 'dma' and 'link' timestamps today on any
> HDaudio-based device. Like I said the synchronized part has not been
> upstreamed yet (delays + dependency on ART-to-TSC conversions that made it
> in the kernel recently)

Ok, I think I see a way to hook this into timestamps from the skbuf on 
incoming frames and a somewhat messy way on outgoing. Having time coupled 
with 'avail' and 'delay' is useful, and from the looks of it, 'link'-time 
is the appropriate level to add this.

I'm working on storing the time in the tsn_link struct I use, and then read 
that from the avb_alsa-shim. Details are still a bit fuzzy though, but I 
plan to do that and then see what audio-time gives me once it is up and 
running.

Richard: is it fair to assume that if ptp4l is running and is part of a PTP 
domain, ktime_get() will return PTP-adjusted time for the system? -Or do I 
also need to run phc2sys in order to sync the system-time to PTP-time? Note 
that this is for outgoing traffic, Rx should perhaps use the timestamp 
in skb.

Hooking into ktime_get() instead of directly to the PTP-subsystem (if that 
is even possible) makes it a lot easier to debug when running this in a VM 
as it doesn't *have* to use PTP-time when I'm crashing a new kernel :)

Thanks!

-- 
Henrik Austad

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  parent reply	other threads:[~2016-06-23 10:38 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-11 23:01 [very-RFC 0/8] TSN driver for the kernel Henrik Austad
2016-06-11 23:01 ` [very-RFC 1/8] TSN: add documentation Henrik Austad
2016-06-11 23:01 ` [very-RFC 2/8] TSN: Add the standard formerly known as AVB to the kernel Henrik Austad
2016-06-11 23:01 ` [very-RFC 3/8] Adding TSN-driver to Intel I210 controller Henrik Austad
2016-06-11 23:01 ` [very-RFC 4/8] Add TSN header for the driver Henrik Austad
2016-06-11 23:01 ` [very-RFC 5/8] Add TSN machinery to drive the traffic from a shim over the network Henrik Austad
2016-06-11 23:01 ` [very-RFC 6/8] Add TSN event-tracing Henrik Austad
2016-06-12 16:58   ` Steven Rostedt
2016-06-12 21:25     ` Henrik Austad
2016-06-13  2:22       ` Steven Rostedt
2016-06-13  7:20         ` Henrik Austad
2016-06-11 23:01 ` [very-RFC 7/8] AVB ALSA - Add ALSA shim for TSN Henrik Austad
2016-06-15 11:49   ` Richard Cochran
2016-06-15 12:13     ` Henrik Austad
2016-06-15 12:43       ` Richard Cochran
2016-06-11 23:01 ` [very-RFC 8/8] MAINTAINERS: add TSN/AVB-entries Henrik Austad
2016-06-13 11:47 ` [very-RFC 0/8] TSN driver for the kernel Richard Cochran
2016-06-13 13:00   ` Henrik Austad
2016-06-13 19:32     ` Richard Cochran
2016-06-14  9:30       ` Henrik Austad
2016-06-14 18:26         ` Richard Cochran
2016-06-14 20:38           ` Henrik Austad
2016-06-15  7:04             ` Richard Cochran
2016-06-15  7:50               ` Henrik Austad
2016-06-15 11:41               ` Richard Cochran
2016-06-15  7:11             ` Richard Cochran
2016-06-13 19:37     ` Richard Cochran
2016-06-13 13:12   ` Arnd Bergmann
2016-06-13 15:56   ` John Fastabend
2016-06-14  8:35     ` Henrik Austad
2016-06-13 19:51   ` Richard Cochran
2016-06-14 11:18     ` One Thousand Gnomes
2016-06-14 17:04       ` Richard Cochran
2016-06-15  3:15       ` Takashi Sakamoto
2016-06-15  8:06         ` Richard Cochran
2016-06-18  5:22           ` Takashi Sakamoto
2016-06-18 22:45             ` Henrik Austad
2016-06-19  9:46               ` Richard Cochran
2016-06-20  8:05                 ` Henrik Austad
2016-06-20 11:08               ` [alsa-devel] " Pierre-Louis Bossart
2016-06-20 11:49                 ` Henrik Austad
2016-06-20 12:18                 ` Richard Cochran
2016-06-20 12:31                   ` Richard Cochran
2016-06-20 15:21                     ` Richard Cochran
2016-06-21  5:54                       ` Takashi Iwai
2016-06-21  6:38                         ` Richard Cochran
2016-06-21  6:45                           ` Takashi Iwai
2016-06-21 17:18                     ` Pierre-Louis Bossart
2016-06-21 17:45                   ` Pierre-Louis Bossart
2016-06-21 19:40                     ` Richard Cochran
2016-06-22 12:36                       ` Pierre-Louis Bossart
2016-06-23 10:38                     ` Henrik Austad [this message]
2016-06-23 13:28                       ` Richard Cochran
2016-06-15  3:27       ` Takashi Sakamoto

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=20160623103848.GG32724@icarus.home.austad.us \
    --to=henrik@austad.us \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnd@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=richardcochran@gmail.com \
    /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).