Mailing List archive

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

[vdr] Re: Seperation of sat clock code



On Wed, 17 Apr 2002, bernd_muc@gmx.de () wrote:

> Hi,
>
> would it be possible to seperate the clock set code from the rest of VDR
> into a little program or script? Then it would be possible to let VDR run
> as some user and the clock synchronization as root.

some time ago I thought about it, too and I was going to post the
following message, what I never did (see below for the reason)

====================================================================

in the last few days I had some time related problems with my vdr machine
(all of them caused on the user side of the keyboard ;-)

but it gave me some thoughts....

at the moment, we can choose a trustable transponder in the setup menu of
vdr. so vdr could adjust the system time to the time of this transponder.

there were some problems in the past related to time jumps (IIRC,
especially jumps to the past)

so now my idea was the following: we could implement a time protocol
service (RFC868, only 2 pages of ascii text) into vdr.

so vdr wouldn't adjust the time byself, but let the ntp client do the
work. The advantage is that there are good ntp clients (e.g. xntp) which
could adjust the time slowly, without jumps.

another advantage would be that other PCs on the LAN could adjust their
clocks to this service

here is the (very simple) function which would do the whole calculation:

--------------------------------------------------------
#include <stdio.h>

int  main() {

  unsigned long int t = 2208988800 + time(NULL);
  printf("%c%c%c%c",  t               >> 24,
                     (t & 0x00FF0000) >> 16,
                     (t & 0x0000FF00) >>  8,
                     (t & 0x000000FF)       );
  return 0;
}
--------------------------------------------------------

ok, we would need another thread listening on port 37. and we would have
to make sure that the standard time service of the port 37 wouldn't be
started. and the service would only be available while one of the dvb
cards is tuned to the trusted transponder.

what do you think?
====================================================================

The reason I never sent it is the following: the ntp clients use the
Network Time Protocol (RFCs 958, 1059, 1119, 1305), which is _MUCH_ more
complicated than the Time Protocol (RFC 868). So I don't know if it is
possible to tell an ntp client to use the Time Service at Port 37.
(but probably we could just ask the authors)

And again, this would only be available while one of the dvb cards is
tuned to the trusted transponder.

another advantage would be that the time client could run with root
rights.


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






Home | Main Index | Thread Index