Bugzilla – Bug 17164
Clock runs slow using internal SB touch server
Last modified: 2019-01-25 10:11:12 UTC
I am using the built in SB server with an USB harddrive. On boot the SB Touch fetches the correct time from the Internet, but the clock is running slow. Within a week the clock differs by two minutes. Restarting leads to the correct time, sshing onto the Touch and using ntp also works. If there were cron-support I could use it to automatically set the time daily, but without this is not easy. I have several other SBs including SB Radio next to my bed as an alarm clock. It is really annoying that this expensive piece of hardware is unable to display the correct time.
Same problem with 7.6 beta. see thread http://forums.slimdevices.com/showthread.php?t=87431
I guess that a function to manually set date/time is anyway mandatory in the settings menu. If you use the Touch with TinySBS in a location with no PC and no internet access, you have to be able to manually set data/time see thread http://forums.slimdevices.com/showthread.php?t=87431
That's right, manual setting of time is also a must have, especially for offline usage. But please do not make this the only possibility. It's an internet device that is capable of receiving the correct time. So please run this functionality once a day without user-interaction.
When my Squeezebox Touch is using the SD card library it looses a minute or so per day. To keep the time correct I daily "Switch to mysqueezebox.com" and then "Switch to library: Touch(SD)". 7.5.4
*** This bug has been confirmed by popular vote. ***
I'm using TinySB. I've personally seen two modes. Most often, the Touch get the proper time a boot, but it drifts quite quickly. After two weeks, it's a few minutes off, which is not acceptable. The radio that is connected to TinySB keep sync with the Touch, which means it drifts as well. Some time, the Touch does not get any time at all at boot. In this case, the off screen remains totally black and the screensaver does not kick in, both on the Touch and on the Radio. Note that since the update to 7.5.4, it's currently in this state. I've had the Touch since april 2010, and I've never seen it keeping time properly, except maybe the very first month, but maybe I was not paying attention. I was planning to buy another Radio or a Boom2 as an alarm clock, but that does not seem like a great plan. I'm using NTP on my computers so I know that having accurate time using the Internet is possible. Jean
There is probably various ways to "fix" the current setup, but it will never be as reliable and accurate as NTP. So, I would personally vote to get NTP on the Touch and get rid of the current scheme. See : http://forums.slimdevices.com/showthread.php?t=87588 Jean
New SW-version but still the same problem. What can I do to make this issue receive more attention?
(In reply to comment #8) > New SW-version but still the same problem. > What can I do to make this issue receive more attention? I confirm - still in 7.6.1. I really thought this was fixed in 7.6. Must surely be trivial for someone who knows the code.
There is a mechanism that resyncs the time every 3600 seconds. I can see a way that this would fail. Experimental evidence seems to confirm this. The relevant code fragment is: if ( $snTime && $snTime =~ /^\d+$/ && $snTime > 1262887372 ) { main::INFOLOG && $log->info("Got SqueezeNetwork server time - set local time to $snTime"); # update offset to SN time $prefs->set( sn_timediff => $snTime - time() ); # set local time to mysqueezebox.com's epochtime Slim::Control::Request::executeRequest(undef, ['date', "set:$snTime"]); } else { $log->error("Invalid or no mysqueezebox.com server timestamp - ignoring"); } Slim::Utils::Timers::killTimers( undef, \&syncSNTime ); Slim::Utils::Timers::setTimer( undef, time() + SNTIME_POLL_INTERVAL, \&syncSNTime, ); This will actually update the system clock in two ways: 1. via the preferences on-change handler for sn_timediff in Slim::Utils::OS::SqueezeOS; 2. via the 'date' request with the 'set' parameter (if and only if the Touch UI is controlling a player using the Touch's own server - the usual case). The problem is that the Slim::Utils::Timers::setTimer call (actually Slim::Utils::Timers::_makeTimer()) uses EV::now as the reference time which will, by now, be out of date because of the updated time. In the common case that the Touch's initial time will be the Unix epoch, the result is that the next time update will not happen for something over 40 years (at the time of writing). I guess that the Timers module needs a means to be notified that the system clock has been updated and this should be called by Slim::Utils::OS::SqueezeOS::settimeofday().
Created attachment 7434 [details] Proposed patch
== Auto-comment from SVN commit #33320 to the slim repo by ayoung == == http://svn.slimdevices.com/slim?view=revision&revision=33320 == Fixed bug 17164: Clock runs slow using internal SB touch server Notifiy Timers subsystem of epoch change so that new timers in same interval get correct interval.
== Auto-comment from SVN commit #33322 to the slim repo by ayoung == == http://svn.slimdevices.com/slim?view=revision&revision=33322 == bug 17164: Clock runs slow using internal SB touch server
Updated to 7.7.0 r33614, still the same problem: Several minutes running slow within a week. :-(
(In reply to comment #14) > Updated to 7.7.0 r33614, still the same problem: Several minutes running slow > within a week. :-( I confirm the problem. I'm running Squeezebox Touch 7.7.0 r9550 with 32GB USB stick with music. Uptime is 7 days & 21 hours and clock is delayed by 4 muntes. Tomas
Can you confirm that your Touch can talk to mysqueezebox.com properly and that you have done nothing to inhibit this functionality. For example, does the My Apps menu display appropriate items?
*cought* http://forums.slimdevices.com/showthread.php?t=87588&highlight=ntp Why not implement ntp and be done with it ?
(In reply to comment #16) > Can you confirm that your Touch can talk to mysqueezebox.com properly and that > you have done nothing to inhibit this functionality. For example, does the My > Apps menu display appropriate items? Switching the music source to mysqueezebox.com works - and syncs the time. But if I switch back to the internal music server, the clock starts running slow again. Also: - no firewall or other connectivity affecting devices - plugged directly into AVM Fritz!Box via cat 5 ethernet cable - "My Apps" works - connectivity test works - it did not stop working, it never worked before. There are only two types of devices in my home that need a manual time adjustment: a 50 euro microwave and my Squeezeboxes (2 x Radio, 1 x Touch, 1 x Controller) :-( PS: I made you guys a couple of photos - please notice that the wrist watch in one of the pictures is radio controlled (DCF77) http://www.dropbox.com/gallery/2251582/1/Squeezebox?h=e23caa
(In reply to comment #16) > Can you confirm that your Touch can talk to mysqueezebox.com properly and that > you have done nothing to inhibit this functionality. For example, does the My > Apps menu display appropriate items? Look in the linked tread Toby10 did a test. What is broken is as the bug title suggest, when running the built in server against a media it never checks with mysb.com for time adjustments it just don't even if the connection is working.
could you please check your device's log file when you're seeing this drift? Log in using ssh and check /var/log/messages. If you're not familiar with ssh, go to Settings/Advanced/Sharing/USB Storage/Sharing: enable it and you should be able to access the log through Windows networking. Failure to sync the time should be logged.
(In reply to comment #20) > could you please check your device's log file when you're seeing this drift? > Log in using ssh and check /var/log/messages. Logfile on Dropbox: http://db.tt/ZUMqJe6b Yesterday night TinySC crashed while being in standby so the clock is quite acurate today.
Squeezebox Touch connected to the SD card. 7.7.0. Still loosing time.
7.7.1 - clock still behind :-(
(In reply to comment #22) > Squeezebox Touch connected to the SD card. 7.7.0. Still loosing time. Squeezebox Touch connected to the SD card. 7.7.1. Still loosing time.
Touch connected to USB Stick. Same problem still here with 7.7.1 Is somebody working on this (bug is marked as assigned) ? Basic problem reported 9 monthes ago ...
(In reply to comment #25) > Is somebody working on this (bug is marked as assigned) ? I don't think so. :-( > Basic problem reported 9 monthes ago ... This is really a pain in the ass, what could I do to give this bug more attention?
(In reply to comment #25) > Touch connected to USB Stick. > Same problem still here with 7.7.1 > > Is somebody working on this (bug is marked as assigned) ? > Basic problem reported 9 monthes ago ... Squeezebox Touch with USB stick; running SB server on Touch. Firmware 7.7.1 Uptime 9days + 2hours - time delayed by 50 seconds It would be great to have the issue fixed in the next version. Tomas
When using the TinySC built into the touch and using an external drive the touch loses time within a few days. This affects all devices downstream connecting through the touch. Using the alarm from a squeezebox radio connected through the touch becomes unreliable within a few days and defaults to the backup alarm. Time gets reset when connecting the touch to mysqueezebox.com. I have temporarily left the touch contacted to mysqueezebox.com but left the internal tinySC running so the Squeezebox radio still connects through the touch. The time issue goes away and I'm still able to access my files, but I must manually change the touch back to the tinySC when playing local files using the touch. Please fix ASAP! Thanks!
(In reply to comment #28) > When using the TinySC built into the touch and using an external drive the > touch loses time within a few days. This affects all devices downstream > connecting through the touch. Using the alarm from a squeezebox radio > connected through the touch becomes unreliable within a few days and defaults > to the backup alarm. Time gets reset when connecting the touch to > mysqueezebox.com. I have temporarily left the touch contacted to > mysqueezebox.com but left the internal tinySC running so the Squeezebox radio > still connects through the touch. The time issue goes away and I'm still able > to access my files, but I must manually change the touch back to the tinySC > when playing local files using the touch. Please fix ASAP! Thanks! When using TinySC, the clock does not appear to be properly reset even on reboot, and, of course, internet is connected... This is very annoying. A solution using ntpclient has been proposed: http://forums.slimdevices.com/showthread.php?t=87588 This seams to work well (I did not compile ntpclient, but used the [second] provided tar image). It is a temporary fix, as I will have to re-install on my Touch(s) whenever the system gets updated. Logitech should include this by default (or some other solution that works). If ntpclient is adopted, of course the user would need to be able to configure the choice of ntp server by menu. Alan
Slow clock problem still not resolved. 7.7.2
TinySC will not be updated any more.