Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1464380imm; Wed, 17 Oct 2018 21:34:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV61nKs51fmbMnS7kbAAM5ZnQRfO09HI7+iemY6I4I+UPJNaoRmqstD8O+/n5Ev/nbquoLEOJ X-Received: by 2002:a17:902:3a5:: with SMTP id d34-v6mr28245083pld.231.1539837245908; Wed, 17 Oct 2018 21:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539837245; cv=none; d=google.com; s=arc-20160816; b=y+D5x7ZgSWqW4MKlejCTO6/tVyGH1HuUIVVyD3ct0HXvj7eB4zhAU5b4VSRXqj+kgq DRprUZANmJSvWZIfTYJ5xy6u5Yt0NymEbiHVbxaPA5SaIpBQckyfaJ6mBVodXxi7rgnD jhg+3KKcOv+zRlxovJfllClzHRJCb+jobWY6IjMyfjQ5V5B3kOghWHf4Io/fhdTb9Nrw 01sEGAcsdy56EbGCDdZulGpZoNP5DiUWbp7eO4qqj9ZbiYg0SOBUMgOnSFjXANRJB/sK 8py+mu9EcRZo0Ed4920364hRFvCTCuSfQwsK0qJt6BAHIRjQ+cMvIJvKWv/UuNJ+ifvn Jp/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OZSwTv+XUMKcJR+cvGYCOtARHhGLWiPAZFlDPUtfuPc=; b=wGapm6YHhBmK1lGBOrahwwru+WXTCudEDUNerrvgAebPbQ8deP03sjkl1rOzatvAut MmfKhsV5U/k5TKIKXJED4wEPFCnpJ/cJBBC0Gt9Ay/Ai+aNzzcux4lPjTomNSm6MySFj DbYX+Ndoz4TsZ62LKSWqZdj7SQI6B0jiVJWSOEKFm9Qf++TmlohxBP8j8BpUt0vs4aEx iFZmc3q39HHfUwbGSNAxf2ZhRwB8yUAcKqKLezbrOmrerCOnj3MW4k6uTIcPUCvnGSCa X9x4PpZaisDH1iREKu1HLWTjmb6hCdrn0E2bM4sPEKbzCx1bRGVlQg8JJ3dmkPe5EqO/ aZgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hYrvkGYb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15-v6si21356435pli.239.2018.10.17.21.33.49; Wed, 17 Oct 2018 21:34:05 -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 header.i=@chromium.org header.s=google header.b=hYrvkGYb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727398AbeJRMbE (ORCPT + 99 others); Thu, 18 Oct 2018 08:31:04 -0400 Received: from mail-yw1-f67.google.com ([209.85.161.67]:42291 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727352AbeJRMbE (ORCPT ); Thu, 18 Oct 2018 08:31:04 -0400 Received: by mail-yw1-f67.google.com with SMTP id a197-v6so11288518ywh.9 for ; Wed, 17 Oct 2018 21:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OZSwTv+XUMKcJR+cvGYCOtARHhGLWiPAZFlDPUtfuPc=; b=hYrvkGYbr32sxDFKZKgBGLbDNHk55eVJSshas2d/4fU1fwsP5iAyNURKbNiepBC/0J 3PPMma7L/oMZAyVcFg8JPynYgvzh99kUGPfjmn5jYxvMTc4COHbMFKq3YXiIOcS8SVIL uic/rpHKFESfOIvBj3mCVTO213wYyvtFYdXmI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OZSwTv+XUMKcJR+cvGYCOtARHhGLWiPAZFlDPUtfuPc=; b=bqVZyz7uHv9Ism9Sd9T7LUg35cuCKsRtriDwMHKU4O0+05dPh8UbD8YxE/e4iFR8Uz Wn6E6KipIR+q8Ok8tblMDvmyolLz2bSEKon2rKYPiVKSptOYLy4I9BZmOTOAsue4o4bE PHGkpz35HM4ZkzeZxK1a6qFTVO76vRncSeWPoqLGuIF4CMrL9FNdYqteeVKmYygICZil Q+95UzO6IfHzwP7SlbnaBVXOekM7rLgdsMZIbjxIgzZnLWaQXnu+mES3jlyjvAlfdO86 q4UF+OT2WHuCR2o3Yf3HJPVSlR3kpreiVtA51dMTVkCUfCh6vpdMx0Ib4VZsSEXjn/N6 Ppdw== X-Gm-Message-State: ABuFfojF1ZmWzpCqwDEc3yQNbMzxs2ZRiabQa9oV8TS4j3lQjpVObP5t SR3Qp3eCPRAgbMZDm1cTJ4gZXLz5s02u/w== X-Received: by 2002:a81:c545:: with SMTP id o5-v6mr17231868ywj.102.1539837122174; Wed, 17 Oct 2018 21:32:02 -0700 (PDT) Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com. [209.85.219.181]) by smtp.gmail.com with ESMTPSA id y198-v6sm6119614ywy.64.2018.10.17.21.32.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Oct 2018 21:32:00 -0700 (PDT) Received: by mail-yb1-f181.google.com with SMTP id 5-v6so11335202ybf.3 for ; Wed, 17 Oct 2018 21:32:00 -0700 (PDT) X-Received: by 2002:a25:24c6:: with SMTP id k189-v6mr6595231ybk.373.1539837119869; Wed, 17 Oct 2018 21:31:59 -0700 (PDT) MIME-Version: 1.0 References: <20181017075242.21790-1-henryhsu@chromium.org> <13883852.6N9L7C0n48@avalon> <2355808.GKno8i6Ks9@avalon> In-Reply-To: <2355808.GKno8i6Ks9@avalon> From: Tomasz Figa Date: Thu, 18 Oct 2018 13:31:48 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: uvcvideo: Add boottime clock support To: Laurent Pinchart , gwendal@chromium.org, amstan@chromium.org Cc: Heng-Ruey Hsu , Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List , Ricky Liang , linux-iio@vger.kernel.org, Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 18, 2018 at 5:50 AM Laurent Pinchart wrote: > > 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. AFAIK the sensors mentioned there are not camera sensors, but rather things we normally put under IIO, e.g. accelerometers, gyroscopes and so on. I'm not sure how IIO deals with timestamps, but Android seems to operate in the CLOCK_BOTTIME domain. Let me add some IIO folks. Gwendal, Alexandru, do you think you could shed some light on how we handle IIO sensors timestamps across the kernel, Chrome OS and Android? > > > 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. Agreed. Best regards, Tomasz