From: Takashi Iwai Subject: Re: [PATCH] ALSA: Provide a CLOCK_MONOTONIC_RAW timestamp type Date: Wed, 09 Jul 2014 13:02:50 +0200 Message-ID: References: <1404831109-8008-1-git-send-email-broonie@kernel.org> <20140708160036.GA30458@sirena.org.uk> <53BC4C78.5030702@perex.cz> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id A01B32625FE for ; Wed, 9 Jul 2014 13:02:52 +0200 (CEST) In-Reply-To: <53BC4C78.5030702@perex.cz> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Jaroslav Kysela Cc: alsa-devel@alsa-project.org, Mark Brown , Daniel Thompson List-Id: alsa-devel@alsa-project.org At Tue, 08 Jul 2014 21:54:32 +0200, Jaroslav Kysela wrote: > > Date 8.7.2014 18:00, Mark Brown wrote: > > On Tue, Jul 08, 2014 at 05:00:26PM +0200, Takashi Iwai wrote: > >> Mark Brown wrote: > > > >>> 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. > > > >> This looks good to me. Or, thinking of the original use case, should > >> we just replace ktime_get_ts() with getrawmonotonic()? The MONOTONIC > >> mode is really to be monotonic. > > > > I'm totally OK with that as well if people don't mind that, I just added > > a new clock as the most conservative option. I can easily respin the > > patch for this if you prefer? > > Note that the silent change would break the timestamp compatibility, > because monotonic timestamp is used in alsa-lib by default. I would > prefer to add a new type as originaly proposed and allow to choose > between NTP monotonic and raw monotonic. Also the network timestamp > might allow better synchronization for network apps (not sure about the > real usage now, but we're working on an universal framework). Agreed, it's better to have a separate type, then. I'm going to take the patch to for-next branch. > >> While we're at it: there's been long-standing request from V4L guys > >> for improving the timestamps to sync with video streams. I suggested > >> to add a new mode that can be set by the driver. Worth to consider > >> it, too? > > > > Does the wall clock stuff address that? I've no objection to adding a > > further type if the existing ones (and this one aren't sufficient). > > I'm curious about requested sync, too.. Yeah, the wall clock stuff might work. But I forgot the detailed requirement. Let's see whether it suffices for V4L guys. thanks, Takashi