Alarms don't wake up the phone when it is powered off

Bug #1420169 reported by Michael Zanetti
136
This bug affects 28 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Confirmed
Wishlist
Unassigned
indicator-datetime (Ubuntu)
Invalid
Undecided
Unassigned
platform-api (Ubuntu)
Confirmed
Undecided
Unassigned
ubuntu-ui-toolkit (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

The alarms API is not setting the device's RTC alarm to power on the phone when an alarm should ring and the device is powered off.

This causes alarms to be lost.

We are instead using Android's /dev/alarm interface which only works while the phone is on or suspended.

See bug #1375855 which confirms this works on Android.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

In order to have enough battery left to ring an alaarm, this bug would need to be fixed too: https://bugs.launchpad.net/indicator-power/+bug/1317860

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
Revision history for this message
Charles Kerr (charlesk) wrote :

I don't understand what this bug report is requesting that indicator-datetime isn't already doing -- it calls the powerd dbus API to request an RTC alarm wakeup when the alarm should ring. powerd uses platform-api's u_hardware_alarm_*() API to implement; it performs the hardware wakeup and emits a wakeup signal to listeners, which datetime catches and rings the alarm.

Is the request here to power on the phone even if the user has manually powered it off?

Changed in indicator-datetime (Ubuntu):
status: New → Incomplete
Revision history for this message
Michael Zanetti (mzanetti) wrote : Re: [Bug 1420169] Re: Alarms don't set RTC alarm to wake up the phone

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03.03.2015 03:01, Charles Kerr wrote:
> Is the request here to power on the phone even if the user has
> manually powered it off?

Yes bug more importantly, if the phone has switched itself off because
of low battery.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlT1emkACgkQXJwWsxE5x7h9PwCfYL4w9/7wpwdIYMduFvHBN6cc
TloAn0SbaITh7XFDbTehEHCjCyQwIXe1
=13ls
-----END PGP SIGNATURE-----

Changed in indicator-datetime (Ubuntu):
status: Incomplete → New
Revision history for this message
Michael Zanetti (mzanetti) wrote : Re: Alarms don't set RTC alarm to wake up the phone

From the data sheet (http://www.datasheetspdf.com/PDF/MT6582/785907/11):

"After that PWRKEYcan be released, pulling BBWAKEUP high will also turn on the handset. This is the case when the alarm in the RTC expires."

So it seems the hardware should support to turn the device on when an RTC alarm happens.

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
Revision history for this message
MaTiZ (mdehollander) wrote :

I can confirm this bug also occurs on a MX4.
Is this a hardware or a software issue?

summary: - Alarms don't set RTC alarm to wake up the phone
+ Alarms don't wake up the phone when it is powered off
description: updated
Changed in canonical-devices-system-image:
assignee: nobody → Thomas Voß (thomas-voss)
importance: Undecided → Wishlist
milestone: none → backlog
status: New → Confirmed
description: updated
Changed in indicator-datetime (Ubuntu):
status: Confirmed → Invalid
Changed in ubuntu-ui-toolkit (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in platform-api (Ubuntu):
status: New → Confirmed
Revision history for this message
Andrea Bernabei (faenil) wrote :

Jolla phone can do it as well, fwiw.

I love that feature, and I think it is a real showstopper for people who are used to having a reliable alarm-phone.

I already missed the alarm twice because my Krillin switched off because of a bug (or because it had run out of battery) during the night. I've been using the Jolla as secondary alarm since then, and I know that even if it runs out of battery, it will still keep enough juice to fire the alarm when the time comes.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

The use of the API by powerd is correct

u_hardware_alarm_set_relative_to_with_behavior(
         hardware_alarm,
         U_HARDWARE_ALARM_TIME_REFERENCE_RTC,
         U_HARDWARE_ALARM_SLEEP_BEHAVIOR_WAKEUP_DEVICE,
         &sleep_interval);w

Which platform_api maps to

     else if (time_reference == U_HARDWARE_ALARM_TIME_REFERENCE_RTC)
            switch(behavior)
            {
                case U_HARDWARE_ALARM_SLEEP_BEHAVIOR_WAKEUP_DEVICE:
                    type = ANDROID_ALARM_RTC_WAKEUP;
                    break;
                case U_HARDWARE_ALARM_SLEEP_BEHAVIOR_KEEP_DEVICE_ASLEEP:
                    type = ANDROID_ALARM_RTC;
                    break;
            }

        int result = ::ioctl(fd, ANDROID_ALARM_SET(type), ts);

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

Can we look into whether we need to enable something in the kernel configs?

Changed in canonical-devices-system-image:
assignee: Thomas Voß (thomas-voss) → John McAleely (john.mcaleely)
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

The Android API RTC_WAKEUP indeed refers to waking from deep sleep, I see no reference to an API for powering on the device.

Revision history for this message
Andrea Bernabei (faenil) wrote :

Wasn't https://code.launchpad.net/~charlesk/powerd/add-hardware-alarms/+merge/231302 supposed to provide the needed beef for this usecase?

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

That is what we use for alarms but it doesn't work when the device is powered off.

Changed in canonical-devices-system-image:
assignee: John McAleely (john.mcaleely) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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