Return-path: Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:52888 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755148AbaKEQLv (ORCPT ); Wed, 5 Nov 2014 11:11:51 -0500 Date: Wed, 5 Nov 2014 18:11:47 +0200 From: Sakari Ailus To: Paulo Assis Cc: =?iso-8859-1?Q?R=E9mi?= Denis-Courmont , Grazvydas Ignotas , Linux Media Mailing List , Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab Subject: Re: (bisected) Logitech C920 (uvcvideo) stutters since 3.9 Message-ID: <20141105161147.GW3136@valkosipuli.retiisi.org.uk> References: <20141102225704.GM3136@valkosipuli.retiisi.org.uk> <20141104115839.GN3136@valkosipuli.retiisi.org.uk> <20141104153650.GO3136@valkosipuli.retiisi.org.uk> <54596226.8040403@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-media-owner@vger.kernel.org List-ID: Hi Paolo, On Wed, Nov 05, 2014 at 10:13:45AM +0000, Paulo Assis wrote: > Hi, > > 2014-11-04 23:32 GMT+00:00 Sakari Ailus : > > Sakari Ailus wrote: > >> yavta does, for example, print both the monotonic timestamp from the buffer > >> and the time when the buffer has been dequeued: > >> > >> > >> > >> $ yavta -c /dev/video0 > >> > >> should do it. The first timestamp is the buffer timestamp, and the latter is > >> the one is taken when the buffer is dequeued (by yavta). > > I've done exaclty this with guvcview, and uvcvideo timestamps are > completly unreliable, in some devices they may have just a bit of > jitter, but in others, values go back and forth in time, making them > totally unusable. > Honestly I wouldn't trust device firmware to provide correct > timestamps, or at least I would have the driver perform a couple of > tests to make sure these are at least reasonable: within an expected > interval (maybe comparing it to a reference monotonic clock) or at the > very least making sure the current frame timestamp is not lower than > the previous one. Using the hardware timestamps provides much better accuracy than the software ones --- the real time capabilities of the USB aren't exactly the same as on some other busses. Freel free to try the follow-up patches; I've only compile tested them so far. It might be possible to add some heuristics to detect bad implementations but perhaps we could simply flag them for now. If heuristics would be used, then one would likely have a few bad timestamps every time the device is accessed the first time anyway. Besides, the timestamp type changes as a result. I wonder what Laurent thinks. :-) -- Kind regards, Sakari Ailus e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk