Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1123724imm; Wed, 17 Oct 2018 13:51:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV60FVfc4Ek9aL8R7SBx2dN4WWqFCYapKT4cnWJUDkdRpyP0pMVU4EFTXy4e5fWqMf/abEX2t X-Received: by 2002:a63:3308:: with SMTP id z8-v6mr25550949pgz.220.1539809504166; Wed, 17 Oct 2018 13:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539809504; cv=none; d=google.com; s=arc-20160816; b=xtrawh1v1Xt5QfPz5y+9R18NW1A+l8reub13UddpLAfF/RU3Hl65tWW2uSHidNAxx4 Q6YAwhUudZs6/Yhh5etSE7n7VYey/inQdM6z75HxlmhjZrFXEa8ObchQDcVmuCjEd/Cf Hb9SQ37IM907uz1hqEkzcNmmL7ikQE3yAXh0vJHLp+37oUlFKoOCIKlkSsdVOtgjKnSe bY+g3C4z1jjEkPxgxux8aD87sN0NlGgh9174T0U5J6WdpF8m57qH3q2Bi1UknsSndpZG IcU3y80NEXbh8S4U8oxLDbLYQFlm9IeNqeBYr2su+buT65vGko+paXLvjhnGuziKovoY H/Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=cgVKbdtqGMYqRndV13TTMrSjwVisUubGR9hm8ApiHGY=; b=hW6MAEOjnO7jUlldbQGkgQvWpL9yY2oPo2q0ilew6+6/PbbyZZJNPFbAgQPkuO1AFo nhsMQ+hUllvJLpvlInrGBZ8l1Rvp/wDgKQFLgx0r6Qou0LgMcJrezweqkhk6ezfIn+qZ Bt4cN67ULOzcwna2VD2tt0mCDBJqbTFcyplQiiEZmmNJIP3qXY3bSzaAFft0gw8QxHZc Tr8F2FAhFG9FMeDzrjJVADenYPyygGYKj8TMzThbv/n2FzC9OAm96A0KTFBsmocK9djH fVVLDQ5oQklJBPHQ43KFFQmpjxGTL+C8Sjmex2ylU/nC6kSqJN4sb2IUkQzSBq3BzSfE H7gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=U9PNRp9P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i10-v6si19078728pgc.420.2018.10.17.13.51.28; Wed, 17 Oct 2018 13:51:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=U9PNRp9P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727331AbeJREro (ORCPT + 99 others); Thu, 18 Oct 2018 00:47:44 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:56054 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726876AbeJRErn (ORCPT ); Thu, 18 Oct 2018 00:47:43 -0400 Received: from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 921131277; Wed, 17 Oct 2018 22:50:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1539809415; bh=QnlgGMCqq24KUZW/VhCAXjMzG/GkznVndEilws0ccsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U9PNRp9P21UY4F45JG9i/9EWkmGqMItgP/QwwTR5Czaru6VEtXZbO9jnhQkZE2NQT x/Zcf73JHC/66/JwsJa3k5wdR+FnA3buSLdgNtxk/TlLZ7cCFOcXp+9n+UEOwkvWzT BFR48d9N5N2yFWOv3qJXWODApN4t/I6VU/oTPsnE= From: Laurent Pinchart To: Tomasz Figa Cc: Heng-Ruey Hsu , Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List , Ricky Liang Subject: Re: [PATCH] media: uvcvideo: Add boottime clock support Date: Wed, 17 Oct 2018 23:50:25 +0300 Message-ID: <2355808.GKno8i6Ks9@avalon> Organization: Ideas on Board Oy In-Reply-To: References: <20181017075242.21790-1-henryhsu@chromium.org> <13883852.6N9L7C0n48@avalon> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tomasz, On Wednesday, 17 October 2018 11:28:52 EEST Tomasz Figa wrote: > On Wed, Oct 17, 2018 at 5:02 PM Laurent Pinchart wrote: > > On Wednesday, 17 October 2018 10:52:42 EEST Heng-Ruey Hsu wrote: > >> Android requires camera timestamps to be reported with > >> CLOCK_BOOTTIME to sync timestamp with other sensor sources. > > > > What's the rationale behind this, why can't CLOCK_MONOTONIC work ? If the > > monotonic clock has shortcomings that make its use impossible for proper > > synchronization, then we should consider switching to CLOCK_BOOTTIME > > globally in V4L2, not in selected drivers only. > > CLOCK_BOOTTIME includes the time spent in suspend, while > CLOCK_MONOTONIC doesn't. I can imagine the former being much more > useful for anything that cares about the actual, long term, time > tracking. Especially important since suspend is a very common event on > Android and doesn't stop the time flow there, i.e. applications might > wake up the device to perform various tasks at necessary times. Sure, but this patch mentions timestamp synchronization with other sensors, and from that point of view, I'd like to know what is wrong with the monotonic clock if all devices use it. > Generally, I'd see a V4L2_BUF_FLAG_TIMESTAMP_BOOTTIME flag being added > and user space being given choice to select the time stamp base it > needs, perhaps by setting the flag in v4l2_buffer struct at QBUF time? I would indeed prefer a mechanism specified at the V4L2 API level, with an implementation in the V4L2 core, over a module parameter. If the goal is to use the boottime clock for synchronization purpose, we need to make sure that all drivers will support it correctly. Patching drivers one by one doesn't really scale. -- Regards, Laurent Pinchart