Clock out of sync on resume from suspend

Bug #1328646 reported by Jean-Baptiste Lallement
88
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Indicator Date and Time
Invalid
Undecided
Unassigned
indicator-datetime (Ubuntu)
Invalid
High
Charles Kerr
qmenumodel (Ubuntu)
Fix Released
Undecided
Unassigned
unity8 (Ubuntu)
Fix Released
Critical
Nick Dedekind

Bug Description

When the device is resumed by pressing the power button and the device is not connected over USB the clock is out of sync

You need another system to compare the time to verify this bug report, and make sure both clocks are in sync.

TEST CASE
1. Unplug the device from its USB cable
2. Press the power button to switch to suspend mode or wait until it goes to suspend
3. Wait 2 or more minutes
4. Press the power button again to resume the device
5. Compare the time on the greeter and indicator with the time on the other system

EXPECTED RESULT
Clocks are in sync

ACTUAL RESULT
Time on the device is behind by several minutes.

The use case are people who use their device as a watch. You usually resume it, check the time, suspend it.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: unity8 7.88+14.10.20140606-0ubuntu1
Uname: Linux 3.4.0-5-mako armv7l
ApportVersion: 2.14.3-0ubuntu1
Architecture: armhf
Date: Tue Jun 10 19:11:42 2014
InstallationDate: Installed on 2014-06-10 (0 days ago)
InstallationMedia: Ubuntu Utopic Unicorn (development branch) - armhf (20140610)
SourcePackage: unity8
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
status: New → Confirmed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Works fine with the non-split greeter. Closing

Changed in unity8 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Reopening, it is still the case with build #91. The time difference can be several minutes.

Changed in unity8 (Ubuntu):
importance: Undecided → High
status: Fix Released → Confirmed
Revision history for this message
Michał Sawicz (saviq) wrote :

TBH I don't understand how :|

It's using the same source for the clock that the panel has...

Changed in unity8:
assignee: nobody → Michael Terry (mterry)
Revision history for this message
Michał Sawicz (saviq) wrote :

Michael, do you have an idea how to explain this still? Can anyone else reproduce?

Revision history for this message
Michael Terry (mterry) wrote :

I know that I was seeing some time-zone oddities when I tied the clock to the phone_greeter menu model we got from the indicator (instead of just phone). This was when the greeter was split out.

But after unsplitting, I haven't noticed any problems. But this description makes it sound like the indicator and the greeter are both in agreement, they are just both wrong.

In which case, this should likely be an indicator-datetime bug because it is giving unity8 the wrong data.

affects: unity8 (Ubuntu) → indicator-datetime (Ubuntu)
affects: unity8 → indicator-datetime
Changed in indicator-datetime:
assignee: Michael Terry (mterry) → nobody
Revision history for this message
Michał Sawicz (saviq) wrote :

Hmm or we're not compositing / pushing the last frame on screen? Which might be the case, since we've been suspended we weren't rendering, and maybe it takes a while to catch up? We'd need to inspect what the indicator data is at the point of power on. Or the labels' text property, for that matter.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

happens with me on image: r117

tags: added: qa-daily-testing rtm14
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Confirmed on Utopic 161.

I unplugged the mako from USB, turned its screen off, and let it sit for 10 minutes next to a computer with a known-good clock. When I turned it back on, its clock updated within one second from T-2m to T-1m -- that is, it was just over a minute behind, after being idle for only 10 minutes. About 20 seconds later the clock updated again to the current time. I assume that was when NTP kicked in.

So, it seems that the clock gets behind at a rate of roughly 6 seconds per minute. That's pretty bad, as far as clocks go. And it presumably doesn't update until it can get online.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Note, given the behavior I saw, it's also possible that it was only behind by about 40 seconds, and the second screen update wasn't related to NTP or data from cell towers. The first (immediate) update could have been the usual split second before the screen redraws on resume. In any case, that's still losing 4 seconds per minute, which it shouldn't be doing. I think the usual tolerance is more like 0.5 seconds per hour, at most.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Wow. So, when I tried again 13 minutes later, the clock was already 5 minutes behind. Apparently the speed isn't consistent.

It figured out the correct time again about 30 seconds later, but it seems the onboard clock might be way off without help from the network (cell or wifi).

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Or maybe it's not the onboard clock, but just the display widget. If I open the actual clock app, I can see two different times -- one in the indicator, one in the app. So apparently the welcome time widget and indicator widget just get out of sync with the system clock.

Revision history for this message
Michał Sawicz (saviq) wrote :

I can't reproduce this now, I see consistently synced clocks between wizard, panel and clock app.

Changed in unity8:
status: New → Incomplete
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

It happens to me all the time, your device have to be unplugged from usb. Sometimes the time different is not a couple of minutes but like half an hour.

Changed in unity8:
status: Incomplete → Confirmed
Revision history for this message
Michał Sawicz (saviq) wrote :

Right, mine are constantly connected over USB so just don't suspend...

The issue seems to be that the indicator does not send the time updates when device is suspended, *or* unity8 does not react to the updates it does send.

If the latter, we just need to resync on wakeup, if the former, the indicator would have to do something smarter here.

Changed in unity8:
importance: Undecided → Critical
Revision history for this message
Michał Sawicz (saviq) wrote :

I'm saying this is critical as in normal phone usage your phone will be 8 hours behind for up to a minute in the morning...

Changed in unity8:
status: Confirmed → Triaged
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Being away for a while and not having the phone plugged in all the time this happened to me too all the time. But the panel seems to lag behind too. It's in sync, but outdated. The time only updates when the next minute update is triggered which in worst case leaves you with an outdated clock for 59 seconds.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

The proof! :)

The watch (time is set by GPS) indicates 23:17 and the phone indicates 23:16 in the indicator and the greeter

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

And on this photo, 1 minute later...

The time on the watch is 23:18 and on the phone it's 23:18 on the clock and 23:16 in the indicator (and the greeter before I unlocked it)

The time on these 2 devices was in sync at the beginning of the test.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

The difference can be several hours. This morning, at 07:38 the time on the phone was 04:09

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

On this photo mako shows 9:10 but it's 9:13 (both devices were in sync at the beginning of the test)

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

9:14 on the watch, 9:14 on the clock of the phone and 9:10 in the indicator (and the greeter before I unlocked it)

Revision history for this message
Oliver Grawert (ogra) wrote :

i must say that you are very lucky only getting teh clock being off by a few minutes ...
*every* morning when i go to the landing meeting which starts at 10:30 for me the notification for that particular meeting goes off at 10:40 or 10:45 ... when the screen turns on with the notification both, the lock screen and indicator still show a time around 10:20 ..

this is reproducable every morning for me ...

Changed in indicator-datetime (Ubuntu):
assignee: nobody → Charles Kerr (charlesk)
Revision history for this message
Dave Morley (davmor2) wrote :

Also see bug 1357307 which was introduced at the same time

tags: added: lt-blocker lt-category-visible lt-prio-high
Revision history for this message
Charles Kerr (charlesk) wrote :

Where does the greeter get its time from?

Indicator-datetime ultimately gets its time from a call to g_date_time_new_now_local() + the system timezone, and (unless there's a bug) is updated at least once per minute. But several people here (jibel, ogra, more) are reporting the clock being /far/ out of sync.

Could one of you please attach the output of this run from phablet-shell next time you see the datetime clock dramatically out of sync?

$ dbus-send --print-reply --dest=com.canonical.indicator.datetime \
  "/com/canonical/indicator/datetime/phone" "org.gtk.Menus.Start" array:uint32:0,1,2,3,4

Revision history for this message
Charles Kerr (charlesk) wrote :

Okay I've talked to mterry and he's confirmed that the greeter gets its time and date from indicator-datetime. So this is good news of a sort, it means the bug is probably only in datetime, rather than some larger strangeness :)

Changed in indicator-datetime (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Michał Sawicz (saviq) wrote :

Here's the requested output:

http://paste.ubuntu.com/8057589/

What's weird... my indicator says 8:06 and the greeter 8:22 now... Both over an hour out of sync.

After a greeter cycle the greeter came around to correct 9:45, panel still off...

Revision history for this message
Charles Kerr (charlesk) wrote :
Revision history for this message
Charles Kerr (charlesk) wrote :
Revision history for this message
Charles Kerr (charlesk) wrote :

I'm seeing this bug in image 191 and found something interesting: the datetime service is still pushing the right information to the bus, but for some reason the panel and greeter aren't seeing it.

You can ask the datetime service what time it thinks it is by calling this from phablet shell:

$ dbus-send --print-reply --dest=com.canonical.indicator.datetime \
 "/com/canonical/indicator/datetime" "org.gtk.Actions.Describe" string:"phone-header"

Which will give you something like:

> method return sender=:1.33 -> dest=:1.78 reply_serial=2
> struct {
> boolean true
> signature ""
> array [
> variant array [
> dict entry(
> string "title"
> variant string "Upcoming"
> )
> dict entry(
> string "visible"
> variant boolean true
> )
> dict entry(
> string "label"
> variant string " 8:30 PM"
> )
> dict entry(
> string "accessible-desc"
> variant string " 8:30 PM"
> )
> ]
> ]

The "label" here is updated at least every minute and should be updated by the panel, but for some reason isn't.

The two screenshots above show this visually: the phone's panel and greeter say it's 8:17 PM, but the system clock and indicatator-datetime service say that it's 8:29 (screenshot 1) and 8:30 (screenshot 2). I took the second to confirm that the service was still updating its label each minute.

Revision history for this message
Charles Kerr (charlesk) wrote :
Revision history for this message
Charles Kerr (charlesk) wrote :

In the ~/.cache/upstart/unity8 log for the phone tested above, there are several error warnings about a null property in Panel/Indicators/DefaultIndicatorWidget.qml:76 and

(process:2451): GLib-GIO-CRITICAL **: g_dbus_connection_signal_subscribe: assertion 'object_path == NULL || g_variant_is_object_path (object_path)' failed

(process:2451): GLib-GIO-CRITICAL **: g_dbus_connection_call_internal: assertion 'object_path != NULL && g_variant_is_object_path (object_path)' failed

Revision history for this message
Charles Kerr (charlesk) wrote :

Lastly, it looks like indicator-datetime is continuing to correctly publish the updated time when the minute changes.

You can reproduce this test on an affected system by running this from phablet-shell:

$ dbus-monitor "path=/com/canonical/indicator/datetime"

Expected results: when the minute changes, indicator-datetime should publish new header information, formatted similar to comment:30 but with the correct time in its header label.

Changed in indicator-datetime (Ubuntu):
status: In Progress → Incomplete
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in indicator-datetime (Ubuntu):
status: New → Confirmed
Changed in qmenumodel (Ubuntu):
status: New → Confirmed
Revision history for this message
Ted Gould (ted) wrote :

Just got this on my phone from letting it run over the weekend. Verified the value passed over DBus is correct from the indicator:

$ gdbus call --session --dest com.canonical.indicator.datetime --object-path /com/canonical/indicator/datetime --method org.gtk.Actions.Describe phone-header
((true, signature '', [<{'title': <'Upcoming'>, 'visible': <true>, 'label': <' 9:41 AM'>, 'accessible-desc': <' 9:41 AM'>}>]),)

Where the panel is saying that it's "6:13 PM"

Changed in unity8:
assignee: nobody → Nick Dedekind (nick-dedekind)
Michał Sawicz (saviq)
Changed in unity8:
status: Triaged → In Progress
Revision history for this message
Charles Kerr (charlesk) wrote :

Marking this as Invalid for indicator-datetime as -- similar to bug#1357311 -- the service is correctly pushing out menuitems and the header label to the bus.

Changed in indicator-datetime (Ubuntu):
status: Confirmed → Invalid
Changed in indicator-datetime:
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity8 - 8.00+14.10.20140820-0ubuntu1

---------------
unity8 (8.00+14.10.20140820-0ubuntu1) utopic; urgency=low

  [ CI bot ]
  * Resync trunk

  [ Nick Dedekind ]
  * Fixed CachedUnityMenuModel destruction unhinging indicators. (LP:
    #1328646)

  [ Mirco Müller ]
  * Temporarily disable any opacity-animation for notifications to
    unblock the train due to LP: 1354406. (LP: #1354406)
 -- Ubuntu daily release <email address hidden> Wed, 20 Aug 2014 20:03:55 +0000

Changed in unity8 (Ubuntu):
status: New → Fix Released
kevin gunn (kgunn72)
Changed in unity8:
status: In Progress → Fix Released
Changed in qmenumodel (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
cm-t 🦄🏂🌈🎵 (cm-t) wrote :

Hi,

Just to be sure: does the patch is now landing is an image (I am using mako as daily purpose, with channel devel on utopic image 203).

If it is suposing to be landed, then I can see this behavior's bug is still here: always (and I mean always, everytime I need to check the time) must open the clock apps after resuming the phone to be sure I read the real time, not a cache'ed time that is not refreshed on the lockscreen/time indicator.(if I get lost and it is not the same bug, then tell me, I'll open a new one).

Libement

Revision history for this message
Michał Sawicz (saviq) wrote :

@cm-t, there is a new bug about this: bug #1365530

Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
assignee: nobody → Nick Dedekind (nick-dedekind)
importance: Undecided → Critical
no longer affects: unity8
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.