This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#9985 - AMS Sansa RTC fixes
Attached to Project:
Rockbox
Opened by Bertrik Sikken (bertrik) - Thursday, 05 March 2009, 19:59 GMT+2
Last edited by Bertrik Sikken (bertrik) - Saturday, 09 May 2009, 22:04 GMT+2
Opened by Bertrik Sikken (bertrik) - Thursday, 05 March 2009, 19:59 GMT+2
Last edited by Bertrik Sikken (bertrik) - Saturday, 09 May 2009, 22:04 GMT+2
|
DetailsIt seems the newer ams sansas keep time in the rtc as seconds since 1-1-1970, while older sansas keep time in the rtc as seconds since 1-1-1980. Currently rockbox uses the exact same piece of code for both types. This can result in a problem with the following symptoms on ams sansas:
* after setting the current date in rockbox and booting the OF, the date is reset to some other value. * rockbox shows a date that is approximately 10 years (+/- 1 day) later than the date shown in the OF. It is not entirely clear if all ams sansas suffer from this problem, but at least the e200v2 seems to do so, also the fuze was reported as having problems with the date/time. This patch uses a different reference date of 1-1-1970 for the c200v2, e200v2 and the fuze. All other players use the old reference date of 1-1-1980. Please report if this patch stops the symptoms described above. |
This task depends upon
Closed by Bertrik Sikken (bertrik)
Saturday, 09 May 2009, 22:04 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed in svn r20697
Saturday, 09 May 2009, 22:04 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed in svn r20697
What player do you have? Is the System/Time & Date screen showing the correct date and time?
Another way of fixing the problem is to stick to the current convention of using 1980 as reference year and adding/subtracting 315532800 just before writing/reading the raw seconds value. 315532800 is the exact number of seconds difference between 1970-1-1 and 1980-1-1.
I was getting that for a while on my e260v2 but it seems to be fine now
For example, we could temporarily disable setting date/time in rockbox and just expose the raw time value through a debug menu. Then try out setting various dates/times in the OF and see how they map to the raw value in rockbox.
I did notice that if the time is adjusted in the OF, the change is not changed in Rockbox. But if the time is changed in Rockbox, it is also changed in the OF.
I can't see a pattern in this...
Set date "May 09 2009 04:18" from OF; Read date "Aug 09 2009 04:19" from RB.
Set date "May 09 2009 04:18" from RB; Read date "Feb 06 2009 04:17" from OF.
The OF probably doesn't touch the RTC at all when setting the time (except when it detects a completely invalid date/time). Instead it just adjusts an internal offset between RTC time and actual time. This explains why OF time never transfers back to Rockbox, but it does the other way. This mechanism is probably meant for DRM purposes, so setting the date/time in rockbox may mess up your DRM'd tracks in the OF. The date/time set in Rockbox should now be quite close to the intended OF date/time anyway.
Since there's a explanation now, I'm closing the task.