• Laurent Pinchart's avatar
    V4L/DVB (13827): uvcvideo: Switch to a monotonic clock for V4L2 buffers timestamps · 310fe524
    Laurent Pinchart authored
    The realtime clock provided by do_gettimeofday() is affected by time
    jumps caused by NTP or DST. Furthermore, preliminary investigation
    showed that SMP systems the realtime clock is based on the CPU TSC,
    and those could get slightly out of sync, resulting in jitter in the
    timestamps depending on which processor handles the USB interrupts.
    
    Instead of the realtime clock, use a monotonic high resolution clock to
    timestamp the buffer. As this could in theory introduce a regression
    with some userspace applications expecting a realtime clock timestamp,
    add a module parameter to switch back to the realtime clock.
    
    Thanks to Paulo Assis for pointing out and investigating the issue.
    Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    310fe524
uvc_driver.c 59.4 KB