Bug 483404 - power-profiles-daemon widget for mode change does not work
Summary: power-profiles-daemon widget for mode change does not work
Status: RESOLVED UPSTREAM
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-13 06:49 UTC by davidb9966
Modified: 2024-03-19 02:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description davidb9966 2024-03-13 06:49:09 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

After installing `power-profiles-daemon` by calling `sudo pacman -S power-profiles-daemon`. Following happens:

- We presented with new widget
- New performance mode is unlocked (which was not here before). For example, before installing the package and pressing `FN + Q` - keyboard shortcut to change power mode. We only have `White` and `Blue` colours. With package installed, we also have Red mode.

Lenovo laptops have these power modes. Fn + Q to cycle between blue (Quiet), White (Auto or Balanced), Red (Performance).

Keyboard shortcut works great now, however if you attempt to change power mode via widget slider, it does not affect anything, the power limit wattage stays the same and hardware colour on power button stays the same.

STEPS TO REPRODUCE
1. `sudo pacman -S power-profiles-daemon`
2. `sudo systemctl enable --now power-profiles-daemon`
3. restart computer
4. navigate to widget and change to any mode
5. observe in `nvtop` power limit has not changed and stays the same
6. Manually press `FN + Q` on keyboard as a shortcut for Lenovo laptops to change power mode. This will change wattage limit, and change hardware colour on your power button

OBSERVED RESULT
Widget slider for power change mode does not do anything

EXPECTED RESULT
Widget slider changes power limits accordingly and changes the colour of hardware power button

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux ArchPC 6.7.9-arch1-1 / plasmashell 6.0.1
(available in About System)
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION

journalctl logs when switching mode via widget:
```
Mar 13 06:41:23 ArchPC plasmashell[869]: kf.plasma.quick: location should be set before showing popup window
Mar 13 06:41:24 ArchPC plasmashell[869]: file:///usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/items/PlasmoidItem.qml:60: TypeError: Type error
Mar 13 06:41:27 ArchPC plasmashell[869]: file:///usr/share/plasma/plasmoids/org.kde.plasma.battery/contents/ui/PopupDialog.qml:52:13: QML PlasmoidHeading: Binding loop detected for property "leftInset"
```
Comment 1 Nate Graham 2024-03-13 21:43:50 UTC
Does it work to change the setting using the command-line `powerprofilesctl` program? E.g. `powerprofilesctl set performance`

Or is that broken too?
Comment 2 davidb9966 2024-03-14 02:53:54 UTC
(In reply to Nate Graham from comment #1)
> Does it work to change the setting using the command-line `powerprofilesctl`
> program? E.g. `powerprofilesctl set performance`
> 
> Or is that broken too?

❯ powerprofilesctl set performance 
Traceback (most recent call last):
  File "/usr/bin/powerprofilesctl", line 7, in <module>
    from gi.repository import Gio, GLib
ModuleNotFoundError: No module named 'gi'
Comment 3 Nate Graham 2024-03-14 14:32:13 UTC
Then I guess you need to install some missing python module. Not having it despite having `powerprofilesctl` installed is a distro packaging error; they should have made sure that all necessary python module dependencies were installed automatically.

I'd recommend following up with your distro if you can't figure this out on your own.
Comment 4 davidb9966 2024-03-15 12:56:59 UTC
Issue with running command resolved by installing package - `sudo pacman -S python-gobject`

~ 
❯ sudo powerprofilesctl set performance

~ 
❯ powerprofilesctl list
* performance:
    CpuDriver:  amd_pstate
    Degraded:   no

  balanced:
    CpuDriver:  amd_pstate
    PlatformDriver:     placeholder

  power-saver:
    CpuDriver:  amd_pstate
    PlatformDriver:     placeholder


Running this command in console moves the widget slider, but it also has no effect on the power state itself
Comment 5 Nate Graham 2024-03-18 21:05:30 UTC
If neither the Plasma widget nor `powerprofilesctl` work to change the power mode, and only the Fn+[key] shortcuts work, then it sounds like there's a bug either in your device's firmware, or with power-profiles-daemon itself. I'd recommend starting with a new bug report at https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/. If they tell you it's a firmware issue, you'll need to follow up with the kernel developers or even your laptop's firmware developers.
Comment 6 davidb9966 2024-03-19 02:48:43 UTC
thank you, submitted new bug here https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/143