Bug 344870 - Digital Clock 15-25 seconds behind
Summary: Digital Clock 15-25 seconds behind
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock (show other bugs)
Version: 5.2.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Martin Klapetek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-05 13:51 UTC by naraesk
Modified: 2015-09-11 15:54 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
both clocks show a different time (91.06 KB, image/jpeg)
2015-03-05 13:51 UTC, naraesk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description naraesk 2015-03-05 13:51:46 UTC
Created attachment 91433 [details]
both clocks show a different time

Have a look at the screenshot. The digital clock of plasma and the ntp time in system settings are out of sync (~25 sec delay).
Comment 1 Martin Kho 2015-03-05 17:12:29 UTC
Hi,
At first side, I thought the same. But when I enabled show seconds for the digital clock the time was correct. So I it seems more a widget/dsiplay update issue.

Martin Kho
Comment 2 naraesk 2015-03-05 18:28:25 UTC
Indeed, with seconds enabled both clocks show the same time.
Comment 3 Rex Dieter 2015-03-21 10:36:19 UTC
Adjusting summary, see also downstream report: 
https://bugzilla.redhat.com/show_bug.cgi?id=1199071
Comment 4 Kevin Kofler 2015-03-22 15:08:14 UTC
So I suppose the issue is that the update timer is set to a 60-second interval, but not synchronized to the beginning of the minute.
Comment 5 Kevin Kofler 2015-03-22 15:10:44 UTC
PS: I guess chances are that with "show seconds" enabled, there is also a delay of something like half a second on average, due to the same synchronization issue. It's just less noticeable in that case.
Comment 6 David Edmundson 2015-03-22 15:11:06 UTC
Not quite.

It is aligned to the minute, but that alignment happens when plasma starts.
If the clock changes due to NTP after that then the alignment is off.

According to timedated documentation, the solution to that is:

>Note that this service will not inform you about system time changes. Use timerfd() with >CLOCK_REALTIME and TFD_TIMER_CANCEL_ON_SET for that.
Comment 7 Martin Kho 2015-05-08 10:07:00 UTC
Hi,

For me this issue seems to be solved in plasma 5.3.

Martin Kho
Comment 8 David Edmundson 2015-09-11 15:54:56 UTC
Git commit bbfffc2d65ab53acd41ee056fdd2a6ea9c2f6a08 by David Edmundson.
Committed on 11/09/2015 at 15:54.
Pushed by davidedmundson into branch 'master'.

Monitor for the clock changes from the kernel

At the moment we update the clock when we resume from suspend or from
the time KCM.

However the signal from the clock KCM isn't very good as it signals just
after it requests an NTP update or clock change, not necessarily when
that finishes.

Also we miss any external NTP updates which might occur at other times
throughout the day, such as a big change when we connect to the network

This method also avoids needing solid to tell us when we're resuming
from suspend, which is deprecated API and also seems slightly slower.
REVIEW: 125028

M  +32   -2    dataengines/time/timeengine.cpp

http://commits.kde.org/plasma-workspace/bbfffc2d65ab53acd41ee056fdd2a6ea9c2f6a08