Thanks Jeremy, could you open it for discussion upstream. There had been
similar problems discussed in the past, see
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/547 , is
the outcome matching what you can observe?

** Bug watch added: gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues #547
   https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/547

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to upower in Ubuntu.
https://bugs.launchpad.net/bugs/1945418

Title:
  Hibernate doesn't support as the default action in Ubuntu when
  critical power

Status in OEM Priority Project:
  Confirmed
Status in gnome-settings-daemon package in Ubuntu:
  New
Status in upower package in Ubuntu:
  New

Bug description:
  In a stock ubuntu 20.04.3, g-s-d will notify the critical action when battery 
is lower than warned critical threshold.
  The notification is "The battery is below the critical level and this 
computer is about to hibernate."

  When hitting critical threshold, it takes "HybirdSleep" as the action.
  ```
   九  29 11:24:48 ubuntu-HP-ZBook-Studio-15-6-Inch-G8-Mobile-Workstation-PC 
systemd[1]: Reached target Sleep.
   九  29 11:24:48 ubuntu-HP-ZBook-Studio-15-6-Inch-G8-Mobile-Workstation-PC 
systemd[1]: Starting Hybrid Suspend+Hibernate...
   九  29 11:24:48 ubuntu-HP-ZBook-Studio-15-6-Inch-G8-Mobile-Workstation-PC 
kernel: PM: Image not found (code -22)
   九  29 11:24:48 ubuntu-HP-ZBook-Studio-15-6-Inch-G8-Mobile-Workstation-PC 
systemd-sleep[3212]: Suspending system...
   九  29 11:24:48 ubuntu-HP-ZBook-Studio-15-6-Inch-G8-Mobile-Workstation-PC 
kernel: PM: hibernation: hibernation entry
  ```

  You could see the hibernation called by logind but it will fail to
  restore since either not enough SWAP or resume address is not specify
  to kernel.

  It confusing users about the critical actions.

  In UPower.conf:
  ```
  $ tail etc/UPower.conf 
  # reached for the batteries (UPS or laptop batteries) supplying the computer
  #
  # Possible values are:
  # PowerOff
  # Hibernate
  # HybridSleep
  #
  # If HybridSleep isn't available, Hibernate will be used
  # If Hibernate isn't available, PowerOff will be used
  CriticalPowerAction=HybridSleep
  ```

  In g-s-d:
  ```
            /* We don't make the difference between HybridSleep and Hibernate 
*/                            
            if (g_strcmp0 (action, "PowerOff") == 0)
                    policy = GSD_POWER_ACTION_SHUTDOWN;
            else               
                    policy = GSD_POWER_ACTION_HIBERNATE;
  ...
                    /* use different text for different actions */
                    if (policy == GSD_POWER_ACTION_HIBERNATE) {                 
                                                                                
                                                      
                            /* TRANSLATORS: computer will hibernate */
                            message = g_strdup (_("The battery is below the 
critical level and "
                                                  "this computer is about to 
hibernate."));

  ```

  There are two approach if possible: 
  1) change "CriticalPowerAction" to "PowerOff" because the suspend to ram is 
almost useless when battery is in critical threshold and the suspend to disk is 
usually not working in default installed ubuntu.
  2) have a new "GsdPowerActionType" type for "HybridSleep" to show the 
appropriate message but taking the same action (notify logind).

  ---
  $ dpkg -l | grep -i 'upower\|gnome-settings-daemon'
  ii  gir1.2-upowerglib-1.0:amd64                0.99.11-1build2                
       amd64        GObject introspection data for upower
  ii  gnome-settings-daemon                      3.36.1-0ubuntu1.1              
       amd64        daemon handling the GNOME session settings
  ii  gnome-settings-daemon-common               3.36.1-0ubuntu1.1              
       all          daemon handling the GNOME session settings - common files
  ii  libupower-glib3:amd64                      0.99.11-1build2                
       amd64        abstraction for power management - shared library
  ii  upower                                     0.99.11-1build2                
       amd64        abstraction for power managemen

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1945418/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to