FS#2232 - timesync
Opened by Peter Grecian (petergrecian) - Friday, 18 June 2004, 10:22 GMT
|
Detailstimesync sets the clock on the jukebox to that of a
host computer. You run the timesync plugin on the jukebox and timesync.pl on the host. You press f1 on the jukebox and enter on the host at the same time. (This creates a file on the jukebox), You connect the USB. (The host script mounts the filesystem, calculates the difference in seconds between when enter was hit and the timestamp on the file on the jukebox. This is written to a file on the jukebox. The script unmounts the jukebox) You disconnect the USB. You run the timesync plugin again which sets the clock according to the time difference file. Currently it only deals with hours, minutes and seconds so is unreliable at midnight. The script assumes the mount point is /mnt/archos and would need some changes for a non unix system (I guess). If the plugin turns out to be useful it would be worth developing it further. Happy listening everybody! Peter Grecian Fri Jun 18 10:34:05 BST 2004 ToDo ==== 1) get arround disk spin up time see comment timesync.pl line 65 2) deal with days and years. Easiest way is to do 3 runs of the plugin. First delta ignored and just sets the AJB clock to the host file timestamp. Hard way is to understand calendars - which has been done somewhere in rockbox. |
I think there is a better way, ie. automatically updating
the time on each connection without user intervention.
(Note I'm only familiar with Windows and the iRiver H140,
but this would probably work elsewhere).
You write a little app that sits on the host and waits for
the player to connect (ie. for the drive letter to
appear). As soon as that happens, the app creates a dummy
file on the player which is timestamped.
RockBox automatically waits for the appearance of this file
on connection (ideally this would be in the background and
wouldn't cause a boot delay, and would timeout after eg. 30
secs). As soon as it shows, it compares the timestamp with
its own internal time and corrects accordingly, then
deletes the file.
This wouldn't be accurate to the second, but that doesn't
seem important to me.