Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  Clock synchronization
« previous next »
  • Print
Pages: [1]

Author Topic: Clock synchronization  (Read 3199 times)

Offline nerdrunner

  • Member
  • *
  • Posts: 33
Clock synchronization
« on: July 22, 2009, 09:34:53 PM »
Is there any way for Rockbox to automagically syncronize its clock to a computer's clock when it is hooked up to the computer's USB port?
Logged

Offline soap

  • Member
  • *
  • Posts: 1678
  • Creature of habit.
Re: Clock synchronization
« Reply #1 on: July 22, 2009, 09:54:59 PM »
As I understand mass storage mode - there really isn't any communication, just file transfers.  Perhaps a PC app to constantly write to a file with current time and a Rockbox routine to read said time - but that would require Rockbox to allow both your PC and Rockbox to access the drive at the same time (not sure this is possible) and would be impossible on the devices where Rockbox does not provide the USB mode (rather it relies on the existing hardware or Original Firmware USB.)
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Clock synchronization
« Reply #2 on: July 22, 2009, 10:16:59 PM »
It is impossible (in UMS) for Rockbox and the host PC to access the drive at the same time.

It *would* be possible to sync times on SWUSB targets if, for example, we had a resident program running on the host PC that could recognize a Rockbox player and send the right SCSI commands, if I understand correctly.

Of course, this requires someone write such a host program, and implement support for it in Rockbox, and such.
« Last Edit: July 23, 2009, 01:49:49 AM by Llorean »
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: Clock synchronization
« Reply #3 on: July 23, 2009, 05:37:51 AM »
Implementing the iTunes time sync command (which it sends over SCSI) would not be too difficult probably (there is already a patch that accepts the command but just throws it away), but someone would actually have to write a program for the host PC to send the command for people who don't have an iPod or don't use iTunes.
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline Vchat20

  • Member
  • *
  • Posts: 30
Re: Clock synchronization
« Reply #4 on: August 02, 2009, 10:41:51 PM »
FWIW, we already have more advanced USB usage thanks to the HID support that (iirc) is already in SVN (for the capable hardware of course which is a good sized list) so something like this wouldn't be too difficult from a capabilities standpoint. And I would think there'd be some USB standard to be able to access the host RTC without any extra software running on said host. Just comes down to researching it all I guess.
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: Clock synchronization
« Reply #5 on: August 03, 2009, 09:08:44 AM »
There is no such feature in USB, and generally USB transactions have to be the other way around: initiated by the host.

This is never going to be possible without *some* program on the host.
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline NorTheBear

  • Member
  • *
  • Posts: 33
Re: Clock synchronization
« Reply #6 on: August 03, 2009, 12:18:43 PM »
This comes in mind: not directly the request of the OP but what about letting the rockbox installer create a clock synchronisation file in the .rockbox folder, let's say clocksync.txt.
Whenever RB boots it looks for the existence of such a file. if found: it updates the clock accordingly and deletes the file afterwards.
silly idea?
Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Clock synchronization
« Reply #7 on: August 03, 2009, 03:28:03 PM »
But where is the time it's setting the clock to coming from ?
Logged

Read The Manual Please

Offline NorTheBear

  • Member
  • *
  • Posts: 33
Re: Clock synchronization
« Reply #8 on: August 05, 2009, 05:41:47 AM »
After some afterthoughts, I must admit that my idea has no solid ground to stand on. I first thought that it would be possible that the Roxbox utility read the computer time and feed Roxbox with that time in form of a file. Once Roxbox gets the control back, it would read that time from the file and sets the system time accurately. However, the time span between reading the computer time and setting the time by Rockbox would be unpredictable, and thus not acceptable.
Logged

Offline bakseetdrivr

  • Member
  • *
  • Posts: 33
Re: Clock synchronization
« Reply #9 on: August 05, 2009, 07:52:59 PM »
what if rockbox created a file with the time according to the player as well as the time recorded from the computer. once the player starts up again, it could read the file, determine the difference between the two times and adjust accordingly

Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Clock synchronization
« Reply #10 on: August 05, 2009, 08:24:31 PM »
Quote from: bakseetdrivr on August 05, 2009, 07:52:59 PM
what if rockbox created a file with the time according to the player as well as the time recorded from the computer.

This requires rockbox knowing the correct time from the computer.  If rockbox knows the correct time, why wouldn't it just use that and not bother writing the file? 
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: Clock synchronization
« Reply #11 on: August 06, 2009, 05:49:37 AM »
Why on earth would we mess about with a file containing the time (which requires a PC-side utility anyway) when there's a perfectly good way to do it with a SCSI command which Apple have already invented for us, and is already implemented in iTunes? :)

It just needs someone to finish the patch for it to actually set the time in Rockbox, and someone to write a utility (or modify rbutil) to send the command for people who don't have iPods or don't want to use iTunes. There's not much reason to speculate on other ways to do it...
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

Offline Multiplex

  • Member
  • *
  • Posts: 440
Re: Clock synchronization
« Reply #12 on: August 12, 2009, 07:45:53 AM »
If I've read the recent changes properly this is being done...
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  Clock synchronization
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.126 seconds with 14 queries.