From patchwork Tue Jul 8 14:52:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 33228 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 66A2120969 for ; Tue, 8 Jul 2014 14:55:06 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w8sf17752932qac.8 for ; Tue, 08 Jul 2014 07:55:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=UpjGwlnNZ5+rKnNBAI3KMuzJcKwgVmRsIX7rtM5J9N0=; b=UPW0FggCzZo5h+kbaRT6p5HImLL+VPCuE7Wwbize36Y/Jrdh8VZvUzxY1xxe2tbqPQ HG1yKCfvcN2Tl1etFeAac1l4/GmTjK8HPHqaBuEUI01LagWmL3cgxgyU+7nqgdIKNDR5 7FgotnYtfKB9XX2FJG6U61u36aMY4tQkAUgEf8aRcgfNlKt5v2FvcnmVp2XRVBm2W1Ss G9TMurvehPOFzvO46EZJn2DZ2xCoJ9zEWk9Gqc7CjY+/faLX2E605WyP/0MVnp2TMqe6 PVeF/pReYoWJJoqMeYaMjW5bNnk+BoJGCwfoxUwefGxONNso/aXAsEV+basKwed9Qu6O 3MVw== X-Gm-Message-State: ALoCoQl9yPy5H5O511vqbJ/JyyQGtmdt9uQucZjJYFDCQovHLvk0bkjcgcFpwSTsdJREzBk6ENrh X-Received: by 10.236.63.197 with SMTP id a45mr3568147yhd.9.1404831306258; Tue, 08 Jul 2014 07:55:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.201 with SMTP id z67ls2288284qgd.94.gmail; Tue, 08 Jul 2014 07:55:06 -0700 (PDT) X-Received: by 10.58.69.198 with SMTP id g6mr528399veu.56.1404831306144; Tue, 08 Jul 2014 07:55:06 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id vl1si3955005vec.61.2014.07.08.07.55.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 07:55:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id sa20so5837546veb.10 for ; Tue, 08 Jul 2014 07:55:06 -0700 (PDT) X-Received: by 10.220.68.140 with SMTP id v12mr34196802vci.13.1404831306066; Tue, 08 Jul 2014 07:55:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp777273vcb; Tue, 8 Jul 2014 07:55:05 -0700 (PDT) X-Received: by 10.194.192.201 with SMTP id hi9mr41243945wjc.28.1404831305029; Tue, 08 Jul 2014 07:55:05 -0700 (PDT) Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id y1si3171539wij.95.2014.07.08.07.55.03 for ; Tue, 08 Jul 2014 07:55:04 -0700 (PDT) Received-SPF: none (google.com: alsa-devel-bounces@alsa-project.org does not designate permitted sender hosts) client-ip=77.48.224.243; Received: by alsa0.perex.cz (Postfix, from userid 1000) id 68881261785; Tue, 8 Jul 2014 16:55:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.2.4 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 763C52618ED; Tue, 8 Jul 2014 16:54:44 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 15EC52619D9; Tue, 8 Jul 2014 16:54:43 +0200 (CEST) Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id BE1C82617A5 for ; Tue, 8 Jul 2014 16:54:28 +0200 (CEST) Received: from lputeaux-656-01-48-212.w82-127.abo.wanadoo.fr ([82.127.83.212] helo=finisterre) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1X4Wmg-0003w1-QP; Tue, 08 Jul 2014 14:54:25 +0000 Received: from broonie by finisterre with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1X4WlD-00026g-FH; Tue, 08 Jul 2014 16:52:47 +0200 From: Mark Brown To: Jaroslav Kysela , Takashi Iwai Date: Tue, 8 Jul 2014 16:52:32 +0200 Message-Id: <1404831152-8064-1-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.0.0 X-SA-Exim-Connect-IP: 82.127.83.212 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Cc: alsa-devel@alsa-project.org, Daniel Thompson , Mark Brown Subject: [alsa-devel] [PATCH] alsa-lib: Provide a CLOCK_MONOTONIC_RAW timestamp type X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: broonie@kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Mark Brown For applications which need to synchronise with external timebases such as broadcast TV applications the kernel monotonic time is not optimal as it includes adjustments from NTP and so may still include discontinuities due to that. A raw monotonic time which does not include any adjustments is available in the kernel from getrawmonotonic() so provide userspace with a new timestamp type SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW which provides timestamps based on this as an option. Reported-by: Daniel Thompson Signed-off-by: Mark Brown --- include/sound/asound.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/sound/asound.h b/include/sound/asound.h index 1774a5c..9061cdd 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h @@ -457,7 +457,8 @@ struct snd_xfern { enum { SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */ SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */ - SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, + SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */ + SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, }; /* channel positions */