Mailing List archive

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

[vdr] Re: Time jumps



On Wed, 25 Dec 2002, Wolfgang Fritz (WF) wrote:

WF> >>one possibility would be to do the following:
WF> >>   if the system clock is off by at least XX seconds (what is a good
WF> >>   value? 2? 10? 20?), then set the clock, causing a time jump on the
WF> >>   system clock.
WF> >>   if the diff is less than XX seconds, use adjtime.
WF>
WF> You  may  estimate  the  systematic  drift  of  your  system  clock by
WF> comparing  it  to  a reliable external clock source (don't know if the
WF> satellite  time  is  good  enough)  and then compensate the systematic
WF> drift  with  adjtimex  (see  man  adjtimex).  This way the system time
WF> should  always  be  in  the  "adjtime range" and no clock jumps should
WF> happen.
WF>
WF> I am doing this on a server by checking the time against an NTP server
WF> once  a  day.  The  systematic drift of my clock is abt 24 seconds/day
WF> (!!) and I am able to compensate it to less than 25ms/day.

I  assume,  your server is running 24h/day. What happens if the machine is
shut down? I assume it still drifts by 24sec/day while it is switched off.
Most (many?) vdr machines are switched off more than 12h/day (I assume so)

Is the correction amount stored in some file and is used automatically? Or
do you have to call adjtimex each time you boot?

anyway,  it's  a  good idea (-> only one correction per power cycle of the
vdr machine would be needed)

could  you  send  me  an  example  how  you're  using  adjtimex? (I do not
undestand exactly, what all of the modes are doing)

BTW.:  the  glibc  implementation of adjtime is just calling adjtimex with
mode ADJ_OFFSET_SINGLESHOT and an offset. but this seems not to make the
changes permanent.

another  BTW.:  adjtimex  is  Linux  specific  and  should  not be used in
programs  intended  to be portable. Is VDR a linux-only program or does it
run on other unix systems.

c ya
        Sergei
-- 
--------------------------------------------------------------------  -?)
         eMail:       Sergei.Haller@math.uni-giessen.de               /\\
-------------------------------------------------------------------- _\_V
Be careful of reading health books, you might die of a misprint.
                -- Mark Twain



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index