From: "Rémi Denis-Courmont" <remi@remlab.net>
To: workshop-2011@linuxtv.org
Cc: "linux-media" <linux-media@vger.kernel.org>
Subject: Re: [Workshop-2011] RFC: V4L2 API ambiguities
Date: Mon, 13 Aug 2012 19:09:31 +0300 [thread overview]
Message-ID: <201208131909.31834.remi@remlab.net> (raw)
In-Reply-To: <201208131427.56961.hverkuil@xs4all.nl>
Le lundi 13 août 2012 15:27:56 Hans Verkuil, vous avez écrit :
> 1) What is the right/best way to set the timestamp? The spec says
> gettimeofday, but is it my understanding that ktime_get_ts is much more
> efficient.
>
> Some drivers are already using ktime_get_ts.
>
> Options:
>
> a) all drivers must comply to the spec and use gettimeofday
gettimeofday() is wrong for use other than getting the wall clock time.
In particular, it breaks if the real-time clock gets adjusted while streaming.
Practically all modern multimedia applications on Linux use the monotonic
POSIX clock in a way or another.
> b) we change the spec and all drivers must use the more efficient
> ktime_get_ts
Unfortunately, that would not be enough to be immediately useful. Userspace
needs a way to know that it can (finally!) trust the timestamps. Currently,
since different drivers use different clocks, the only reasonable option for
user space consists of ignoring the V4L2 timestamp. Thus userspace has to fall
back to the current clock time after ioctl(DQBUF) returns, as an
approximation.
> c) we add a buffer flag V4L2_BUF_FLAG_MONOTONIC to tell
> userspace that a monotonic clock like ktime_get_ts is used and all drivers
> that use ktime_get_ts should set that flag.
Yes, either a buffer or a capability flag ought to work.
> If we go for c, then we should add a recommendation to use one or the
> other as the preferred timestamp for new drivers.
IMHO, all drivers should be adapted to the new specification as far as
possible.
Of course, that will break any user space application that would have trusted
V4L2 to return valid CLOCK_REALTIME timestamps so far. I'd argue such an
application was already broken in practice even if it conformed to the letter
of the V4L2 specification.
--
Rémi Denis-Courmont
C/C++ software engineer looking for a job
http://www.linkedin.com/in/remidenis
next prev parent reply other threads:[~2012-08-13 16:09 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-13 12:27 RFC: V4L2 API ambiguities Hans Verkuil
2012-08-13 13:13 ` [Workshop-2011] " Hans de Goede
2012-08-13 14:52 ` Hans Verkuil
2012-08-13 14:58 ` Hans de Goede
2012-08-13 15:09 ` Ilyes Gouta
2012-08-13 19:15 ` Sylwester Nawrocki
2012-08-14 8:13 ` Hans de Goede
2012-08-14 0:00 ` Laurent Pinchart
2012-08-14 8:15 ` Hans de Goede
2012-08-13 16:09 ` Rémi Denis-Courmont [this message]
2012-08-13 20:27 ` Walter Van Eetvelt
2012-08-13 21:31 ` Devin Heitmueller
2012-08-13 21:39 ` Mauro Carvalho Chehab
2012-08-13 21:42 ` Devin Heitmueller
2012-08-13 21:55 ` Mauro Carvalho Chehab
2012-08-13 23:54 ` [Workshop-2011] " Laurent Pinchart
2012-08-14 10:54 ` Hans Verkuil
2012-08-14 11:06 ` Laurent Pinchart
2012-08-14 11:11 ` Hans Verkuil
2012-08-14 11:15 ` Laurent Pinchart
2012-08-14 11:32 ` Hans Verkuil
2012-08-14 11:42 ` Laurent Pinchart
2012-08-14 21:14 ` Guennadi Liakhovetski
2012-08-14 22:10 ` Laurent Pinchart
2012-08-14 12:43 ` Hans de Goede
2012-08-14 12:44 ` Chinmay V S
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201208131909.31834.remi@remlab.net \
--to=remi@remlab.net \
--cc=linux-media@vger.kernel.org \
--cc=workshop-2011@linuxtv.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).