From patchwork Thu Jul 10 13:09:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 33426 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4E972203C0 for ; Thu, 10 Jul 2014 13:11:30 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id eu11sf59644217pac.10 for ; Thu, 10 Jul 2014 06:11:29 -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:in-reply-to:references: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=i7uGM+0Vs/EKmtqXJk/tRmaepW+ki1Bp6Ka/8+MWAxA=; b=IJ3iSfy+noR1eLBaHd7K8rN9BV3vWH1MU7uxSf2oaXHYcKXyMxqKl/PVholpmlbK3+ +wiAtf1VuTv/zdlNqvI8McCaKR7yidNZaF6YbJ2JJaJLU8wuVE2Iak4kN5ehIX2bjpsw Bza2z6DvFFNfxN9OFidqWHfv27ieNDeb72PDpKaJHeWu6NL4HgaL9PqzQY7o+mokLE8e 48rZfHCfh8WdmvPlEAIRLQ9O4ON0QqPrrhhSzvOBWObCtSC4LSv46fKLuTo4N8FTF/DE 54E9dor1SVcRmF6ZyIrV0OPeD7jFWSwOPHhZY7pt6VZY28TqC6/ev5f7PlVWQQqSRO+Y +ung== X-Gm-Message-State: ALoCoQkKNgWEOz58vcMOoYIeebMMPEUUW+ZxzG/8cKr28N5CKnv8DyI8Ue1gz0eiz50MCHTC8sA8 X-Received: by 10.66.231.68 with SMTP id te4mr12894375pac.29.1404997889416; Thu, 10 Jul 2014 06:11:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.17 with SMTP id z17ls56798qge.74.gmail; Thu, 10 Jul 2014 06:11:29 -0700 (PDT) X-Received: by 10.52.86.131 with SMTP id p3mr83150vdz.72.1404997889245; Thu, 10 Jul 2014 06:11:29 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id iw8si14234943vdb.59.2014.07.10.06.11.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Jul 2014 06:11:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id lf12so10487197vcb.32 for ; Thu, 10 Jul 2014 06:11:29 -0700 (PDT) X-Received: by 10.52.248.146 with SMTP id ym18mr37657894vdc.8.1404997889104; Thu, 10 Jul 2014 06:11:29 -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 tc5csp131552vcb; Thu, 10 Jul 2014 06:11:28 -0700 (PDT) X-Received: by 10.180.206.163 with SMTP id lp3mr19313410wic.72.1404997888174; Thu, 10 Jul 2014 06:11:28 -0700 (PDT) Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id bw4si12580995wib.64.2014.07.10.06.11.27 for ; Thu, 10 Jul 2014 06:11:28 -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 0964B261AFC; Thu, 10 Jul 2014 15:11:27 +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 260F72617B6; Thu, 10 Jul 2014 15:09:32 +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 54B6B261684; Thu, 10 Jul 2014 15:09:30 +0200 (CEST) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id A699126072A for ; Thu, 10 Jul 2014 15:09:19 +0200 (CEST) Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8417BAD58; Thu, 10 Jul 2014 13:09:19 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Thu, 10 Jul 2014 15:09:13 +0200 Message-Id: <1404997757-15500-2-git-send-email-tiwai@suse.de> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1404997757-15500-1-git-send-email-tiwai@suse.de> References: <1404997757-15500-1-git-send-email-tiwai@suse.de> Cc: Daniel Thompson , Mark Brown , Clemens Ladisch Subject: [alsa-devel] [PATCH alsa-lib 1/5] pcm: 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: tiwai@suse.de X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 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 Signed-off-by: Takashi Iwai --- 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 1774a5c3ef10..9061cdd5b69f 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 */