torstai 14. helmikuuta 2008

Quickie: Setting NTP

If you are doing DVB recordings via timers like I am, then you probably want to set up ntp-client to update the systemtime in startup.

During this past month that I have been slowly building my HTPC, systemtime is already ahead by five minutes. That means basically that every timer now starts recording 5 minutes too early and ends early also. I have, of course, setup extra time before and after every timer, in fact VDR does this by default. But if the time gets ahead by more than 10 minutes, my recordings start to end prematurely, which of course is not very nice.


So ntp-client to the rescue! Here is short how to, in which we are using NTP-server in Finland, please find one closer to your location.

echo "net-misc/ntp caps" >> /etc/portage/package.use
emerge -a ntp


Edit /etc/ntp.conf and change the server to one close to your location. For us Finns it is "server fi.pool.ntp.org".

Edit /etc/conf.d/ntp-client and change the NTPCLIENT_OPTS to following (again this server is in Finland)

NTPCLIENT_OPTS="-s -b -u fi.pool.ntp.org"

Test the ntp-client by issuing date commands before and after starting the ntp-client. System time should be updated. If it works, set it to run every boot by adding it to default runlevel.

date /etc/init.d/ntp-client start date rc-update add ntp-client default

If running time sync every boot is not enough for you, then you can set up the ntpd. But do not setup the ntpdate to be run by cron, here is why.

2 kommenttia:

Gordan Kresic kirjoitti...

I've found your blog while I was googling for HTPC-related materials for my own setup and it seems that you are trying to build HTPC box in many ways similar to mine. So, allow me to spam you a bit, hopefully with some useful content :)

Could you take a look at my HTPC tutorial at:

http://www.htpchouse.com/

and send me some feedback if you find it useful in any way?

Regards,

Gordan Kresic
Author of HTPCHouse.com tutorial

Lake-end kirjoitti...

Your site seems very nice, I will read through it for sure. Very nice to see that other people also understand Linux systems value in HTPC use. :)

One thing I noticed is that you are going the MythTV-way, which unfortunately is not a good one for me. DVB support (at least here in Finland) is better in VDR based solution, for example DVB-subtitles our national broadcasting company (YLE) uses, are not so well implemented in MythTV. MythTV would be my choice IF I were using normal analog television, but Finland was one of the first ones in Europe to change to digital TV broadcast and we have to suffer from all of the "birthing ills".

Cheers!
Petri

BTW, check back on my site later, I will be posting demonstration video of how the MMS/VDR setup works (including how the audio, high def. video and DVB TV get along).