Hey, I reported this loosely some time ago in the comments of this blogpost: http://blog.broulik.de/2015/02/power-management-in-5-3/#comment-369 So the bug is still there. My system is a wetab, which is basically an old intel atom system (https://en.wikipedia.org/wiki/WeTab#Technical_specifications). Plasma runs fine on it. However, the following bug remains: Let's say powerdevil is configured to dim the brightness of the screen to 50% when running in battery mode and to go to full brightness (100%) if the power cable is plugged in. Expected behavior would be to see the change in brightness when plugging the cable in and out. However, I can only observe a dimming action when going from battery mode to plugged in mode. The brightness slider works. So I plug out the cable, slide brightness to 50%, plug the cable in and the brightness goes up to 100%. The other way round, however, does not work. If I am in plugged in mode and the brightness is at 100%, the brightness stays at 100% when the cable is plugged out. The system also does not go in suspend when being in battery mode even if it is switched on the configuration. This bothers me most. So there seems to be a problem in that powerdevil does not act on being in battery mode even thought the modes are recognized (simply see by the change of the powerdevil icon when plugging, unplugging the cable). I searched the systems for other daemons being repsonsible for this, e.g. tlp, laptop-mode etc. There is nothing on the computer like that. I also disabled systemd backlight control. Btw. I just checked this behavior on my Acer 7750G (i5) with AMD graphics card. It is the same! I just never realized, as I never unplug the cable. Or very rarely. So it seems not to be a hardware related bug. Please let me know if you need more information. Reproducible: Always Steps to Reproduce: 1. Configure backlight to 50% for battery mode 2. Unplug cable to enter battery mode 3. Look at the backlight slider Actual Results: Backlight is still at 100% Expected Results: Backlight should switch to 50%
Can you kill kded5 and run it from console? PowerDevil should print a debug message when it's switching profiles or changes brightness.
powerdevil: powerdevil: Can't contact ck powerdevil: We are now into activity "9324fd99-91a1-41e2-a00b-7c23f09aaa1e" powerdevil: () () powerdevil: () () powerdevil: Loading profile for unplugged AC powerdevil: Activity is not forcing a profile powerdevil: powerdevil: Loading timeouts with 120000 Created alarm 8388617 Created alarm 8388618 Created alarm 8388619 powerdevil: Profiles: "Battery" "AC" powerdevil: Screen brightness value: 9 powerdevil: Not changing brightness, the current one is lower and the profile is more conservative Created alarm 8388620 Created alarm 8388621 Created alarm 8388622 Created alarm 8388623 powerdevil: powerdevil: Can't contact ck powerdevil: We are now into activity "9324fd99-91a1-41e2-a00b-7c23f09aaa1e" powerdevil: () () powerdevil: () () powerdevil: Loading profile for plugged AC powerdevil: Activity is not forcing a profile powerdevil: powerdevil: Loading timeouts with 300000 Created alarm 8388624 Created alarm 8388625 Created alarm 8388626 powerdevil: Profiles: "AC" "Battery" powerdevil: Screen brightness value max: 9 powerdevil: set screen brightness value: 9 Created alarm 8388627 Created alarm 8388628 powerdevil: Udev device changed "/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0" "/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0"
above was the laptop, this is the wetab powerdevil: powerdevil: Can't contact ck powerdevil: We are now into activity "87d6f93d-1ae5-4285-9be2-762865f86d8e" powerdevil: () () powerdevil: () () powerdevil: Loading profile for unplugged AC powerdevil: Activity is not forcing a profile powerdevil: powerdevil: Loading timeouts with 120000 Created alarm 8388618 Created alarm 8388619 Created alarm 8388620 Created alarm 8388621 Created alarm 8388622 powerdevil: Profiles: "Battery" "AC" powerdevil: Screen brightness value: 15 powerdevil: Not changing brightness, the current one is lower and the profile is more conservative Created alarm 8388623 Created alarm 8388624 powerdevil: powerdevil: Can't contact ck powerdevil: We are now into activity "87d6f93d-1ae5-4285-9be2-762865f86d8e" powerdevil: () () powerdevil: () () powerdevil: Loading profile for plugged AC powerdevil: Activity is not forcing a profile powerdevil: powerdevil: Loading timeouts with 300000 Created alarm 8388625 Created alarm 8388626 Created alarm 8388627 powerdevil: Profiles: "AC" "Battery" powerdevil: Screen brightness value max: 15 powerdevil: set screen brightness value: 15 Created alarm 8388628 Created alarm 8388629 powerdevil: Screen brightness value: 15 powerdevil: Brightness changed!! powerdevil: Screen brightness value: 15 powerdevil: Brightness changed!!
OK so we can see that it switches profiles when plugging in/out the AC. I don't see anything particularly noteworthy broken in the output :/
powerdevil: Screen brightness value: 9 powerdevil: Not changing brightness, the current one is lower and the profile is more conservative My value for Battery Mode is 60 according to the config file. But 60 means 60 percent. Could it be that powerdevil tries to set 60 instead of 60 percent? In that case it would never be able to switch the brightness as the value is always lower (9<60). Maybe the calculation for the brightness level for the AC mode is correct, but for the battery mode is somehow weird and uses 60 as absolute value? I tried to set my battery brightness to 6 to see if it gets changed, but then the screen went black and i had to restart.
Thought so too. Could be. I'll have a look. that doesn't explain broken auto suspend
Created attachment 95654 [details] Patch to reenable the automatic brightness control due to mixed up absolute/relative values This patch should deal with the problem of absolute and relative values being compared.
Btw. autosuspend works for me on my laptop, so the bug on the wetab might be related to the kidletime library as you mentioned in the reply to the blog post above. I will have a look into this, too.
https://bugs.kde.org/show_bug.cgi?id=355732
Yes, we were right. Thanks for your help in investigating this! The code checks for if (m_defaultValue > brightness()) with m_defaultValue being the saved config value from 0-100 whereas brightness() is the absolute value from 0 to whatever the driver reports as maximum. I'll fix this.
Please give a try to: https://git.reviewboard.kde.org/r/126138/
I cannot log in to the review board due to missing KDE credentials. Also, the patch does not apply to powerdevil 5.4.3, which version I am currently using. Thus I changed the 5.4.3 powerdevil accordingly and it works as expected. However, the keyboard brightness could not be verified as I do not have keyboard leds. You might consider changing absoluteBrightnessValue to keyboardabsoluteBrightnessValue for the keyboardbrightnesscontrol.cpp to keep the naming consistent.
Git commit 6b4ffe32367a6413d8c270480445a4955d63e71f by Kai Uwe Broulik. Committed on 23/11/2015 at 14:02. Pushed by broulik into branch 'Plasma/5.5'. Use absolute brightness value in conservative check when loading profile There's a check that ensures the brightness isn't ramped up when we switch to a more conservative profile and then current brightness is lower. However, it compared the raw hardware value with the config percentage value. FIXED-IN: 5.5.0 REVIEW: 126138 M +7 -6 daemon/actions/bundled/brightnesscontrol.cpp M +6 -6 daemon/actions/bundled/keyboardbrightnesscontrol.cpp http://commits.kde.org/powerdevil/6b4ffe32367a6413d8c270480445a4955d63e71f
*** Bug 355732 has been marked as a duplicate of this bug. ***