I looked into the code around the message that the alarm will be ignored and found the following text:
# Check if this alarm is still current - we could be running really late due to hibernation or similar ok - this gives a little clue, but you said your server does run 24/7. So I digged a bit deeper into the code to see how the timer are internally scheduled within SBS. As it turns out, a third party library is used, where the following interesting comment for the 'timer' function is given: --------- The timer is based on a monotonic clock, that is, if somebody is sitting in front of the machine while the timer is running and changes the system clock, the timer will nevertheless run (roughly) the same time. -------- I interpret this that the seconds are just counted down - if the server hibernates or sleeps for 5mins the timer would trigger 5mins later. Also when there are daylight saving changes in the night, the server would not respect them, which is a but strange for an alarm clock. Another interesting comment there: ----- The timer does his best not to drift, but it will not invoke the timer more often then once per event loop iteration, and might drift in other cases. If that isn't acceptable, look at EV::periodic, which can provide long-term stable timers. ----- Aha - a hint to a better method! So well. For some reason the timer drifts on your computer (maybe because your computer sleeps for a very short time in the night), but I guess we will never find out why. And SqueezeboxServer uses a function that isn't foolproof against drifts. Are you happy trying out some new code? I'm no perl programmer so what I'm suggesting might not work at all, but maybe we can change the one line responsible for all timers, to use this more robust function. Based on the documentation found here: http://search.cpan.org/~mlehmann/EV-4.03/EV.pm SB-Server currently uses the function: Code: -------------------- $w = EV::timer $after, $repeat, $callback -------------------- and a better one would be Code: -------------------- $w = EV::periodic $at, $interval, $reschedule_cb, $callback -------------------- Looks easy to change indeed. In Squeezeboxserver this line is called in the file Slim/Utils/Timers.pm around line 231 (the last line of this snippet): Code: -------------------- sub _makeTimer { my ($objRef, $when, $subptr, @args) = @_; if ( !defined $objRef ) { $objRef = ''; } my $now = EV::now; # We could use AnyEvent->timer here but paying the overhead # cost of proxying the method is silly my $w; $w = EV::timer( $when - $now, 0, sub { -------------------- I'd suggest changing the last line to Code: -------------------- $w = EV::periodic($when, 0,0, sub { -------------------- then restart the server and try some simple alarms first if we broke anything. If these are working schedule your normal alarm and then we'll see what happens. If it really works we could start a bug report in the hope that Logitech reviews this fix and integrates it into the server. -- bluegaspode Did you know: *'SqueezePlayer' (www.squeezeplayer.com)* will stream all your music to your Android device. Take your music everywhere! Remote Control + Streaming to your iPad? *'Squeezebox + iPad = SqueezePad ' (www.squeezepad.com)* Want to see a Weather Forecast on your Radio/Touch/Controller ? => why not try my 'Weather Forecast Applet' (http://forums.slimdevices.com/showthread.php?t=73827) Want to use the Headphones with your Controller ? => why not try my 'Headphone Switcher Applet' (http://forums.slimdevices.com/showthread.php?t=67139) ------------------------------------------------------------------------ bluegaspode's Profile: http://forums.slimdevices.com/member.php?userid=31651 View this thread: http://forums.slimdevices.com/showthread.php?t=89292 _______________________________________________ Radio mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/radio
