Re: [RFC] Monotonic clock usage in buffer timestamps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 02, 2011 at 10:10:46AM +0100, Daniel Glöckner wrote:
> Hello,

Hi Daniel,

> On Tue, Nov 01, 2011 at 01:49:46PM +0100, Laurent Pinchart wrote:
> > > Nevertheless, I agree that the monotonic clock is better than the real
> > > time clock.
> > > In user space, VLC, Gstreamer already switched to monotonic a while ago as
> > > far as I know.
> > > 
> > > And I guess there is no way to detect this, other than detect ridiculously
> > > large gap between the timestamp and the current clock value?
> > 
> > That's right. We could add a device capability flag if needed, but that 
> > wouldn't help older applications that expect system time in the timestamps.
> 
> I just so happen to have tried to use V4L2 and ALSA timestamps in a
> single application. In ALSA the core supports switching between
> monotonic and realtime timestamps, with the library always using
> monotonic available.
> 
> How about making all drivers record monotonic timestamps and doing
> the conversion to/from realtime timestamps in v4l2-ioctl.c's
> __video_do_ioctl if requested? We then just need an extension of the
> spec to switch to monotonic, which can be implemented without touching
> a single driver.

Converting between the two can be done when making the timestamp but it's
non-trivial at other times and likely isn't supported. I could be wrong,
though. This might lead to e.g. timestamps that are taken before switching
to summer time and for which the conversion is done after the switch. This
might be a theoretical possibility, but there might be also unfavourable
interaction with the NTP.

I'd probably rather just make a new timestamp in wall clock time in
v4l2-ioctl.c if needed using do_gettimeofday(). It also needs to be agreed
how does the user space request that to be done.

Or just do the wall clock timestamps user space as they are typically
critical in timing.

How would this work for you?

Kind regards,

-- 
Sakari Ailus
e-mail: sakari.ailus@xxxxxx	jabber/XMPP/Gmail: sailus@xxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux