Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-02-19 10:58:56

qonos68
Member
Registered: 2024-02-19
Posts: 4

[SOLVED] Two power supplies in xfce4-power-manager-settings

Hello everyone,
I recently moved from Manjaro XFCE to Debian XFCE on my Lenovo Thinkpad L570, and I'm facing a problem with power management.
Long story short, my system claims it has two different power supplies: line_power_ACAD and line_power_AC. Whilst line_power_ACAD reflects the current power supply status (plugged in/unplugged), line_power_AC reflects the status when upower was started (system startup / upower restart). When I unplug the power supply (line_power_ACAD), my system thinks it is still plugged to line_power_AC and never activates battery's power management policies. On the other hand if the system is started unplugged then line_power_AC always shows unplugged and everything works fine.
This is what upower -d outputs when power supply is unplugged but the system was started with power supply plugged in:
Device: /org/freedesktop/UPower/devices/line_power_ACAD
  native-path:          ACAD
  power supply:         yes
  updated:              lun 19 feb 2024, 19:40:56 (5 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              no
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              lun 19 feb 2024, 19:00:41 (2420 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              yes
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               LGC
  model:                00NY486
  serial:               1385
  power supply:         yes
  updated:              lun 19 feb 2024, 19:41:01 (0 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              24,13 Wh
    energy-empty:        0 Wh
    energy-full:         33,19 Wh
    energy-full-design:  47,52 Wh
    energy-rate:         7,809 W
    voltage:             11,221 V
    charge-cycles:       N/A
    time to empty:       3,1 hours
    percentage:          72%
    capacity:            69,8443%
    technology:          lithium-ion
    icon-name:          'battery-full-symbolic'
  History (charge):
    1708339252    72,000    charging
    1708339192    71,000    charging
  History (rate):
    1708339261    7,809    discharging
    1708339257    8,875    discharging
    1708339256    25,572    discharging
    1708339252    24,889    charging
    1708339222    24,859    charging
    1708339192    24,835    charging
    1708339162    24,809    charging

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              lun 19 feb 2024, 19:41:01 (0 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              24,13 Wh
    energy-full:         33,19 Wh
    energy-rate:         7,809 W
    charge-cycles:       N/A
    time to empty:       3,1 hours
    percentage:          72%
    icon-name:          'battery-full-symbolic'

Daemon:
  daemon-version:  0.99.20
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: HybridSleep
 
As a sidenote I use tlp to limit battery charging, /etc/tlp.conf being completely commented with the exception of
START_CHARGE_THRESH_BAT0=85
STOP_CHARGE_THRESH_BAT0=90

Is there a way to get rid of line_power_AC? Any hint to solve this problem would be appreciated.

Last edited by qonos68 (2024-02-20 13:14:20)

Offline

#2 2024-02-19 18:13:05

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,032

Re: [SOLVED] Two power supplies in xfce4-power-manager-settings

Hello and welcome.

I'm assuming that you didn't have the problem in Manjaro. You don't mention the version of Debian, but it would be interesting to compare the version differences of:
- xfce4-power-manager
- kernel
- upower

Perhaps a change there might account for the difference. xfce4-power-manager will only display/manage what upower tells it.

I also came across this this upower bug report that looks relevant. Interesting is that in one of the comments talks about creating an override that can ignore one of the line power supply entries.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2024-02-20 05:48:17

qonos68
Member
Registered: 2024-02-19
Posts: 4

Re: [SOLVED] Two power supplies in xfce4-power-manager-settings

Hello ToZ, thanks for your reply even if it looks like it doesn't have anything to do with XFCE. I apologise.
I checked the informations you asked me

Manjaro
xfce4-power-manager 4.18.2-1
upower 1.90.2-1
Kernel 6.1.62-1-MANJARO

Debian
xfce4-power-manager 4.18.1-1
upower 0.99.20-2
Kernel 6.1.0-18-amd64

Manjaro behaves like Debian, oddly enough I was remembering differently..
Thank you for the provided link, this is exactly what I was looking for, the thread was started 9 months ago but it looks like it has been just revived yesterday.
Monitoring system events through udevadm monitor and connecting/disconnecting power supply actually kicks events on BAT0 and ACAD, never AC as expected from the behaviour of upower, so maybe there is a bug somewhere.
I will follow the thread you brought to my attention and join it if necessary.

Offline

#4 2024-02-20 12:43:48

qonos68
Member
Registered: 2024-02-19
Posts: 4

Re: [SOLVED] Two power supplies in xfce4-power-manager-settings

For the sake of completeness, according to the owner of upower forum, it doesn't look a problem of upower, but rather something related to the kernel driver.
Anyway I implemented the workaround suggested in the post inserting in the section [Service] of upower.service the line:

InaccessiblePaths=/sys/class/power_supply/AC /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:19/PNP0C09:00/ACPI0003:00/power_supply/AC /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:19/PNP0C09:00/ACPI0003:00

(This line must be altered to fit the real paths of one's own system, of course)

After a reboot, the offending line_power_AC is ignored and the system behaves correctly when it's unplugged from power supply.

Offline

#5 2024-02-20 13:11:12

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,032

Re: [SOLVED] Two power supplies in xfce4-power-manager-settings

Thanks for sharing the outcome. Can you edit your first post and prepend "[SOLVED]" to the subject line?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2024-02-20 13:15:09

qonos68
Member
Registered: 2024-02-19
Posts: 4

Re: [SOLVED] Two power supplies in xfce4-power-manager-settings

Done, thanks again for your support.

Offline

Board footer

Powered by FluxBB