Ubuntu 20.04 将电池电量读取为错误状态,导致笔记本电脑关机

Ubuntu 20.04 将电池电量读取为错误状态,导致笔记本电脑关机

我有一台运行 Ubuntu 20.04 的联想 Thinkpad P2。尽管有时电量超过 80%,但电池电量却非常低。因此,我的笔记本电脑会在一两分钟内关机,丢失我的所有工作。

但“有时”,当我在此期间打开 Gnome 中的“电源设置”时,电池百分比会恢复到正常水平。但这并不总是发生。我还从 dconf-editor 将关键电池电量操作设置为“无”。但笔记本电脑仍然会关机。

我尝试使用 Thinkpad 的实用程序校准电池。电池寿命似乎不错。我尝试按照论坛的建议运行“电源校准”工具。我尝试将电池充满电,然后将电池完全耗尽后再充电。但似乎没有任何帮助。

在此之前,我曾经运行过 Ubuntu 18.04,没有出现此问题。升级到 20.04 后似乎出现了此问题。

这些是我在关机时在“journalctl -r”中找到的日志

May 20 10:25:22 nitin systemd-logind[1243]: System is powering down.
May 20 10:25:22 nitin kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
May 20 10:25:22 nitin kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
May 20 10:25:12 nitin kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
May 20 10:25:12 nitin kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
May 20 10:25:10 nitin systemd[2412]: Started Application launched by gnome-shell.
May 20 10:25:08 nitin gnome-shell[2688]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
May 20 10:25:08 nitin gnome-shell[2688]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
May 20 10:25:08 nitin gnome-shell[2688]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
May 20 10:25:08 nitin gnome-shell[2688]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
May 20 10:25:08 nitin gnome-shell[2688]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
May 20 10:25:08 nitin gnome-shell[2688]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
May 20 10:25:08 nitin gnome-shell[2688]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
May 20 10:25:08 nitin gnome-shell[2688]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
May 20 10:25:08 nitin gnome-shell[2688]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
May 20 10:25:08 nitin gnome-shell[2688]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
May 20 10:25:07 nitin kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
May 20 10:25:07 nitin gnome-shell[2688]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
May 20 10:25:07 nitin gnome-shell[2688]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
May 20 10:25:02 nitin kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
May 20 10:25:02 nitin kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
May 20 10:25:02 nitin kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
May 20 10:25:02 nitin kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
May 20 10:25:01 nitin CRON[9033]: pam_unix(cron:session): session closed for user root
May 20 10:25:01 nitin CRON[9034]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
May 20 10:25:01 nitin CRON[9033]: pam_unix(cron:session): session opened for user root by (uid=0)
May 20 10:23:49 nitin gnome-shell[2688]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
May 20 10:23:49 nitin gnome-shell[2688]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
May 20 10:23:49 nitin gnome-shell[2688]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
May 20 10:23:49 nitin gnome-shell[2688]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
May 20 10:23:49 nitin gnome-shell[2688]: cr_declaration_parse_list_from_buf: assertion 'parser' failed

本论坛提供的解决方案似乎都无济于事。如有任何帮助,不胜感激!

~

编辑1:

我最近注意到,当电池电量不足通知弹出时,我会继续锁定屏幕。然后几秒钟后,当我解锁屏幕时,电池电量会恢复到实际百分比。这至少可以帮助我解决不丢失工作的问题。

我觉得 gnome-shell 不知怎么报告了错误的电池读数。然后当我锁定和解锁屏幕时,gnome-shell 不知怎么重新加载了正确的电池状态。

编辑2:

我确实看到“upower”返回了错误的电池容量。从“更新”的时间戳中可以看出,电池百分比下降到了 3%。然后,在我锁定并解锁屏幕后,电池百分比恢复到其原始百分比。

$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               Celxpert
  model:                5B10V98091
  serial:               4143
  power supply:         yes
  updated:              Fri 08 Jul 2022 05:02:54 AM PDT (19 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       critical
    energy:              2.31 Wh
    energy-empty:        0 Wh
    energy-full:         145.98 Wh
    energy-full-design:  80.4 Wh
    energy-rate:         13.419 W
    voltage:             15.714 V
    time to empty:       10.3 minutes
    percentage:          3%
    capacity:            91.99%
    technology:          lithium-polymer
    icon-name:          'battery-caution-symbolic'
  History (charge):
    1657281774  3.000   discharging
  History (rate):
    1657281774  13.419  discharging

# After locking and unlocking the screen 
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               Celxpert
  model:                5B10V98091
  serial:               4143
  power supply:         yes
  updated:              Fri 08 Jul 2022 05:03:24 AM PDT (18 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              53.38 Wh
    energy-empty:        0 Wh
    energy-full:         145.98 Wh
    energy-full-design:  80.4 Wh
    energy-rate:         13.75 W
    voltage:             15.312 V
    time to empty:       3.9 hours
    percentage:          71%
    capacity:            91.99%
    technology:          lithium-polymer
    icon-name:          'battery-full-symbolic'
  History (charge):
    1657281804  71.000  discharging
    1657281774  3.000   discharging
  History (rate):
    1657281804  13.750  discharging
    1657281774  13.419  discharging

相关内容