Bug 261341 - powerdevil can't set NVIDIA brightness
Summary: powerdevil can't set NVIDIA brightness
Status: RESOLVED WORKSFORME
Alias: None
Product: solid
Classification: Unmaintained
Component: powermanagement (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Lukáš Tinkl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-27 02:49 UTC by Jesse Milette
Modified: 2013-03-23 08:43 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
xsession error file. (9.47 KB, text/plain)
2010-12-30 03:54 UTC, Jesse Milette
Details
syslog resume from standby (32.30 KB, text/plain)
2010-12-30 04:03 UTC, Jesse Milette
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Milette 2010-12-27 02:49:10 UTC
Version:           unspecified (using KDE 4.5.90) 
OS:                Linux

Since my upgrade to 4.6RC1 powerdevil will randomly loose control of my screen brightness.  The brightness slider on the power applet doesn't work anymore, and powerdevil will not adjust screen brightness when switching power profiles.

I have a VGA compatible controller: nVidia Corporation G84 [GeForce 8600M GT] (rev a1) running NVIDIA's 260.19.29 drivers.


Reproducible: Sometimes
Comment 1 Jesse Milette 2010-12-27 17:08:06 UTC
the backlighthelper process is not getting started.


nerdy_kid@jesse-laptop:~$ /usr/lib/kde4/libexec/backlighthelper 
kernel backlight support found in "/sys/class/backlight/acpi_video0"
nerdy_kid@laptop:~$ cd /sys/class/backlight/acpi_video0
nerdy_kid@laptop:/sys/class/backlight/acpi_video0$ ls
total 0
-r--r--r-- 1 root root 4096 2010-12-27 11:02 actual_brightness
-rw-r--r-- 1 root root 4096 2010-12-27 11:02 bl_power
-rw-r--r-- 1 root root 4096 2010-12-27 10:25 brightness
lrwxrwxrwx 1 root root    0 2010-12-27 11:02 device -> ../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:2d/LNXVIDEO:00/device:30
-r--r--r-- 1 root root 4096 2010-12-27 11:02 max_brightness
drwxr-xr-x 2 root root    0 2010-12-27 11:02 power
lrwxrwxrwx 1 root root    0 2010-12-27 11:02 subsystem -> ../../../../class/backlight
-rw-r--r-- 1 root root 4096 2010-12-27 11:02 uevent
nerdy_kid@laptop:/sys/class/backlight/acpi_video0$ cat brightness 
7
nerdy_kid@laptop:/sys/class/backlight/acpi_video0$ cat max_brightness 
7
nerdy_kid@laptop:/sys/class/backlight/acpi_video0$ sudo -i
[sudo] password for nerdy_kid: 
root@laptop:~# echo 5 > /sys/class/backlight/acpi_video0/brightness 
root@laptop:~# cat brightness 
5
root@laptop:~#


doing the above correctly sets and queries the lcd brightness, so it is a KDE issue.
Comment 2 Dario Freddi 2010-12-28 18:37:11 UTC
Reassigning to Lukas
Comment 3 Lukáš Tinkl 2010-12-29 17:36:03 UTC
Any conditions under which to reproduce this? "powerdevil will randomly loose control" doesn't help much :)
Comment 4 Jesse Milette 2010-12-30 03:54:22 UTC
Created attachment 55364 [details]
xsession error file.
Comment 5 Jesse Milette 2010-12-30 04:03:48 UTC
Created attachment 55365 [details]
syslog resume from standby

I can't reproduce it reliably yet, but it does seem to have something to do with the suspend/resume cycle.  Lines 301 and 203 are of interest in the syslog.

I tried manually starting the backlight helper as root, but it still did not fix it.
Comment 6 Jesse Milette 2010-12-30 04:12:57 UTC
I apologize for my string of comments, but I just tried manually setting the brightness via dbus (qdbusviewer) and it failed with the same "kded(10126) PowerDevilUPowerBackend::setBrightness: org.kde.powerdevil.backlighthelper.setbrightness failed" in .xsession-errors.

Also, I notice when it does work the backlighthelper process is not always running, it will normally start as soon as I adjust the brightness, and then exit about 5 seconds after I have ceased adjusting the brightness.  Is it supposed to do that?
Comment 7 Jesse Milette 2010-12-30 14:52:14 UTC
added info.
Comment 8 Lukas Tines 2011-01-06 23:26:33 UTC
For me plasma widget is utterly broken - the brightness slider doesnt work. When I try to adjust the brightness slider PolicyKit eats 100% cpu for a few seconds then the slider is back at maximum.

In xsession-errors I have the same "kded(3595) PowerDevilUPowerBackend::setBrightness: org.kde.powerdevil.backlighthelper.setbrightness failed" lines.

But changing brightness on profile change works perfectly a in xssesion-errors I got
"Debug message from helper: brightness: 4 
Debug message from helper: max brightness: 7 
Debug message from helper: data contains: QVariant(int, 57) "

I am using KDE 4.6 RC2 and I have nVidia Corporation GT216 [GeForce GT 330M]
Comment 9 Jesse Milette 2011-01-09 03:38:47 UTC
polkitd cpu spikes up to about 7% for me.  I think it is authentication bug with Kauth actually, but I'm not a programmer.  My brightness does not change at all once this bug happens, not even with power profile changes.
Comment 10 Jesse Milette 2011-01-11 21:00:03 UTC
It seems to have something to do with suspend/resume.  Like today, everything was working fine, I suspended the laptop (taking note of the state of the brightness slider) and when I resumed it, the brightness control was broken.
Comment 11 Jesse Milette 2011-01-21 18:45:38 UTC
killing and restarting kded4 fixes the issue temporarily.
Comment 12 Jesse Milette 2011-02-01 03:11:49 UTC
still effects 4.6 final
Comment 13 Jesse Milette 2011-02-01 03:24:57 UTC
ok, can reproduce it!  With everything working, suspend the laptop -- it has to be a laptop I am pretty sure.  Now, turn it back on and immediately begin hitting the key combo to raise/lower brightness.  When KDE comes back up, the brightness control no longer works and "kded(17585) PowerDevilUPowerBackend::brightness: org.kde.powerdevil.backlighthelper.brightness failed " is littered all through the terminal output from kded4.  Killing kded4 and restarting it fixes it until the above is done again, but it also produces this line: 

 "QDBusConnection: name 'org.kde.powerdevil.backlighthelper' had owner '' but we thought it was ':x.xxxx'" 

which I thought was interesting.  

Suspending the laptop while it is plugged in, unplugging it and resuming or vice versa also triggers the bug, as power devil tries changing the brightness too soon I guess.
Comment 14 Alex Fiestas 2013-03-03 18:06:33 UTC
This should be fixed using latest NVIDIA beta driver, can you test please?
Comment 15 Zak 2013-03-23 01:02:03 UTC
I have an NVIDIA Quadro K1000M and with the latest stable driver (310.40, which used to be the "beta" referred to above) can confirm that issue is fixed for me. I used Fedora 18, and be aware the latest driver in YUM is still only 304.something and is too old to support changing brightness.