Brightness controls are not working in Unity / Xorg because of Nvidia proprietary driver.

Bug #1389215 reported by Hans Deragon
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-340 (Ubuntu)
Confirmed
High
Unassigned
nvidia-graphics-drivers-375 (Ubuntu)
Confirmed
High
Unassigned

Bug Description

Affects: Ubuntu 16.04 and 14.04.
Occurs only with Nvidia proprietary driver. Nouveau works well.

Brightness controls are not working in Unity / Xorg. When pressing the keys <fn><home> and <fn><end> on my Lenovo W510, I see the indicator on the screen showing the level of brightness changing, so key mapping is not the problem. However, the brightness is not changing.

On the kernel level, I have the single following device:

# cd /sys/class/backlight
# ls -l
total 0
lrwxrwxrwx 1 root root 0 Nov 3 17:16 acpi_video0 -> ../../devices/pci0000:00/0000:00:03.0/0000:01:00.0/backlight/acpi_video0

When playing with the <fn><home> and <fn><end>, the value of /sys/class/backlight/brightness changes accordingly. The screen brightness does not change.

Performing:

# echo 10 >brightness

...does not have any effect (regardless of the value provided, 10 being just an example).

WORKAROUND

There is an odd workaround. Simply go to the console using <CTRL><ALT><F1> and using the <fn><home> and <fn><end> keys, brightness then changes. Return to Unity / Xorg with <CTRL><ALT><F7> and the selected brightness persists.

NON WORKING WORKAROUND

On the web, I read that adding:

Option "RegistryDwords" "EnableBrightnessControl=1"'

in xorg.conf might fix the problem. I do not have an xorg and when I let the proprietary Nvidia driver generate one and add this option, X does not start anymore.

Ubuntu 14.04.1 LTS with latest updates as of this writing.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: xorg 1:7.7+1ubuntu8
ProcVersionSignature: Ubuntu 3.13.0-39.66-generic 3.13.11.8
Uname: Linux 3.13.0-39-generic x86_64
NonfreeKernelModules: nvidia
.proc.driver.nvidia.gpus.0: Error: [Errno 21] Is a directory: '/proc/driver/nvidia/gpus/0'
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 331.38 Wed Jan 8 19:32:30 PST 2014
 GCC version: gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
.tmp.unity.support.test.0:

ApportVersion: 2.14.1-0ubuntu3.5
Architecture: amd64
CompizPlugins: [core,bailer,detection,composite,opengl,compiztoolbox,decor,place,put,snap,resize,move,regex,session,vpswitch,imgpng,gnomecompat,text,ring,grid,mousepoll,animation,unitymtgrabhandles,wall,expo,ezoom,workarounds,fade,scale,unityshell]
CompositorRunning: compiz
CompositorUnredirectDriverBlacklist: '(nouveau|Intel).*Mesa 8.0'
CompositorUnredirectFSW: true
CurrentDesktop: Unity
Date: Tue Nov 4 07:38:59 2014
DistUpgraded: Fresh install
DistroCodename: trusty
DistroVariant: ubuntu
DkmsStatus:
 bbswitch, 0.7, 3.13.0-32-generic, x86_64: installed
 bbswitch, 0.7, 3.13.0-39-generic, x86_64: installed
 nvidia-331, 331.38, 3.13.0-32-generic, x86_64: installed
 nvidia-331, 331.38, 3.13.0-39-generic, x86_64: installed
 tp-smapi, 0.41, 3.13.0-32-generic, x86_64: installed
ExtraDebuggingInterest: Yes
GraphicsCard:
 NVIDIA Corporation GT216GLM [Quadro FX 880M] [10de:0a3c] (rev a2) (prog-if 00 [VGA controller])
   Subsystem: Lenovo Device [17aa:2145]
InstallationDate: Installed on 2014-11-01 (3 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
MachineType: LENOVO 4318CTO
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-3.13.0-39-generic root=UUID=994f9c2c-f967-472e-ace3-23cd620ec702 ro quiet splash
SourcePackage: xorg
Symptom: display
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 10/03/2012
dmi.bios.vendor: LENOVO
dmi.bios.version: 6NET84WW (1.45 )
dmi.board.name: 4318CTO
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr6NET84WW(1.45):bd10/03/2012:svnLENOVO:pn4318CTO:pvrThinkPadW510:rvnLENOVO:rn4318CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 4318CTO
dmi.product.version: ThinkPad W510
dmi.sys.vendor: LENOVO
version.compiz: compiz 1:0.9.11.2+14.04.20140714-0ubuntu1
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.52-1
version.libgl1-mesa-dri: libgl1-mesa-dri 10.1.3-0ubuntu0.1
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 10.1.3-0ubuntu0.1
version.nvidia-graphics-drivers: nvidia-graphics-drivers N/A
version.xserver-xorg-core: xserver-xorg-core 2:1.15.1-0ubuntu2.1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.8.2-1ubuntu2
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:7.3.0-1ubuntu3.1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.910-0ubuntu1.1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.10-1ubuntu2
xserver.bootTime: Tue Nov 4 01:40:35 2014
xserver.configfile: default
xserver.errors: open /dev/fb0: No such file or directory
xserver.logfile: /var/log/Xorg.0.log
xserver.outputs:

xserver.version: 2:1.15.1-0ubuntu2.1

Revision history for this message
Hans Deragon (deragon) wrote :
Revision history for this message
Hans Deragon (deragon) wrote :

Some more clarification. I tried under KDE Plasma 5.1 (Neon) and still I could not change the brightness of the backlight.

However, the CLI commands that fail in a terminal running under an Xorg session work flawlessly under a console (<CTRL><ALT><F1>).

cd /sys/class/backlight/acpi_video0

echo 5 >brightness # Works under the console!
echo 10 >brightness # Works under the console!

This all suggest that somehow, Xorg is inhibiting the brightness control.

Revision history for this message
Hans Deragon (deragon) wrote :

Found out that brightness control works fine with Nouveau driver, but not with Nvidia proprietary driver.

summary: - Brightness controls are not working in Unity / Xorg.
+ Brightness controls are not working in Unity / Xorg because of Nvidia
+ proprietary driver.
Revision history for this message
Hans Deragon (deragon) wrote :

Reverted to using NVIDIA proprietary drivers because Nouveau cannot resume from sleep (year old critical issue: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-nouveau/+bug/1111884)

The problem occurs only with NVIDIA proprietary drivers versions 304.117 and 331.38, and Ubuntu 14.04 LTS.

A month ago, I was running Ubuntu 12.04 LTS and it worked flawlessly with NVIDIA proprietary driver. I did not take note which version it was though; I assume it was the latest since usually this is what I select. Because it was working with 12.04, the problem might not be with the driver per se, but the interaction between it and the graphical/kernel environment.

Revision history for this message
Hans Deragon (deragon) wrote :

Discovered another behaviour. If you play with the brightness controls under Xorg, nothing changes. However, suspend the computer and resume it, and the brightness will be setup to the last setup you left when playing with the brightness controls. Thus, the value in the kernel persists.

You can also test this with the CLI:

# cd /sys/class/backlight/acpi_video0
# echo 10 >brightness # Nothing happens
# cat actual_brightness
10
# echo 5 >brightness # Nothing happens
# cat actual_brightness
5

<suspend computer>
<resume computer>

Now the brightness level is set to 5 and the screen finds itself at that level.

In the backend, the controls are changing the brightness levels, it is just that during an Xorg Session with NVIDIA proprietary drivers, the screen's real brightness is not updated. As if the hardware signal to the screen is never sent, except when in the console or upon resume.

Revision history for this message
penalvch (penalvch) wrote :

Hans Deragon, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please test for this with the latest development release of Ubuntu? ISO images are available from http://cdimage.ubuntu.com/daily-live/current/ .

If it remains an issue, could you please run the following command in the development release from a Terminal as it will automatically gather and attach updated debug information to this report:

apport-collect -p xorg 1389215

Please ensure you have xdiagnose installed, and that you click the Yes button for attaching additional debugging information.

As well, given the information from the prior release is already available, testing a release prior to the development one would not be helpful.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

tags: added: latest-bios-1.45
no longer affects: xorg (Ubuntu)
affects: nvidia-drivers-ubuntu → xorg (Ubuntu)
Changed in xorg (Ubuntu):
status: New → Incomplete
Revision history for this message
Hans Deragon (deragon) wrote :

The problem still persist on my laptop running Ubuntu 14.04 LTS Trusty Thar, all packages updated up to 2015-02-25.

Revision history for this message
Hans Deragon (deragon) wrote : .proc.driver.nvidia.params.txt

apport information

tags: added: apport-collected possible-manual-nvidia-install
description: updated
Revision history for this message
Hans Deragon (deragon) wrote : BootDmesg.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : BootLog.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : Dependencies.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : DkmsStatus.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : DpkgLog.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : GconfCompiz.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : LightdmDisplayLog.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : LightdmGreeterLog.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : LightdmGreeterLogOld.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : LightdmLog.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : Lspci.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : Lsusb.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : NvidiaBugReportLog.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : ProcEnviron.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : ProcModules.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : UdevDb.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : UdevLog.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : UnitySupportTest.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : XorgLog.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : XorgLogOld.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : Xrandr.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : nvidia-installer.log.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : nvidia-settings.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : xdpyinfo.txt

apport information

Revision history for this message
Hans Deragon (deragon) wrote : xserver.devices.txt

apport information

Hans Deragon (deragon)
Changed in xorg (Ubuntu):
status: Incomplete → New
penalvch (penalvch)
tags: added: needs-vivid-test
Changed in xorg (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
description: updated
Revision history for this message
Hans Deragon (deragon) wrote :

Greetngs M. Penalver. I noticed that you have put back this bug in "Imcomplete" with the additional tag "needs-vivid-test". I fail to understand what else I can provide you. What does "needs-vivid-test" mean and how can I perform that test on my system? The problem still exist, is real and should not expire in 60 days.

Revision history for this message
Hans Deragon (deragon) wrote :

To avoid expiration of this bug, I put it back to 'new'. if more information is required, please indicate in a comment what is required and how to fetch that information.

Changed in xorg (Ubuntu):
status: Incomplete → New
Revision history for this message
penalvch (penalvch) wrote :
Changed in xorg (Ubuntu):
status: New → Incomplete
Revision history for this message
Hans Deragon (deragon) wrote :

Ah, I understand. No I cannot test it with the latest version of Ubuntu. I do not have a spare computer to do so. However, it is still relevant to Ubuntu 14.04 LTS Trusty Thar, which is a LTS and for which I hope this bug will be fixed. Since I use Ubuntu as my main OS, I need stability and thus, I only use LTS versions.

Revision history for this message
Hans Deragon (deragon) wrote :

Moved to 'new' to avoid expiration. I answered the question asked, though I confirm that I cannot test with 15.04.

Changed in xorg (Ubuntu):
status: Incomplete → New
Revision history for this message
penalvch (penalvch) wrote :

Hans Deragon, just to clarify, one doesn't need a spare computer to test Vivid. One may either perform a dual boot, swap a dedicated and temporary spare drive in, or test the live environment.

Changed in xorg (Ubuntu):
status: New → Incomplete
Revision history for this message
Hans Deragon (deragon) wrote :

I do not have a spare drive, nor the time to perform such extensive test. I am a desktop, power user and I cannot afford the time to do QA on vivid. The problem still exist as of today on the LTS. Is anything we can test on the LTS to get the fix on LTS?

Hans Deragon (deragon)
Changed in xorg (Ubuntu):
status: Incomplete → New
Revision history for this message
penalvch (penalvch) wrote :

Hans Deragon, not testing at least a live environment is largely going to further delay your issue from being addressed (as it has already).

Changed in xorg (Ubuntu):
status: New → Incomplete
Revision history for this message
Hans Deragon (deragon) wrote :

I fully understand that there are no resources to test this. Still, the bug is valid and I cannot provide more input. It should be remained to 'new' to avoid expiration. It should not expire; it exist for real. And having this bug open, someone else having the same problem might one day stumble upon it.

BTW, what do you mean by 'live environment'?

Revision history for this message
Hans Deragon (deragon) wrote :

I replaced the official proprietary NVIDIA driver nvidia-331 with nvidia-340 from xorg-edgers and the problem persists. nvidia-340 (340.76) is the latest driver for the legacy card Quadro FX 880M of my Lenovo W510.

Revision history for this message
Hans Deragon (deragon) wrote :

I tried acpi_backlight=vendor on grub to novail. It even stopped working on the TTY. Putting grub as it was restored the functionality back in the TTY. Under X11, the problem persists.

Changed in xorg (Ubuntu):
status: Incomplete → New
status: New → Incomplete
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

De-dup this bug
As this one shouldn't be duplicated to an EOL bug.

Revision history for this message
penalvch (penalvch) wrote :

Hans Deragon, any change updating to the Vivid enablement stack as outlined in https://wiki.ubuntu.com/Kernel/LTSEnablementStack ?

Revision history for this message
Hans Deragon (deragon) wrote :

Following instructions found in bug #562005, I fixed the problem in Ubuntu 14.04.03 LTS Trusty Thar. Attached, the script which fixes the problem. It only creates the file /usr/share/X11/xorg.conf.d/99-nvidia-proprietary-brigthness-keys-fix.conf if a card that suffers from the problem is detected. Thus for cards without issue, if this script is executed, no change is brought to the system. This makes it pretty safe.

This script should be added to the package that performs the installation of the package. Can someone help me figure out how to do this or want to take the lead from here?

penalvch (penalvch)
Changed in nvidia:
status: New → Incomplete
Revision history for this message
Hans Deragon (deragon) wrote :

M. Penalver, the link you provide does not indicate how to revert such a change. I want to keep my OS LTS, not having it become obsolete in a few months. Are you in contact with the people that created that link and can you ask them to document the rollback procedure so I can return to a pure 14.04 LTS system?

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hello Hans,
You can just remove the vivid kernel by removing those packages that the wiki page ask you to install.
And reboot, you will be running on Trusty kernel again.

BTW the Vivid kernel will reach EOL on Aug. 2016, see:
https://wiki.ubuntu.com/Kernel/LTSEnablementStack#Kernel.2BAC8-Support.A14.04.x_Ubuntu_Kernel_Support

Revision history for this message
Hans Deragon (deragon) wrote :

This LTS Enablement Stack scares me a lot; I do not want to screw my system. So if I understand you correctly, I should return to my previous state with the following command, right?

sudo apt-get remove linux-generic-lts-vivid xserver-xorg-core-lts-vivid xserver-xorg-lts-vivid xserver-xorg-video-all-lts-vivid xserver-xorg-input-all-lts-vivid libwayland-egl1-mesa-lts-vivid libgl1-mesa-glx-lts-vivid libgl1-mesa-glx-lts-vivid:i386 libglapi-mesa-lts-vivid:i386

If any of you work for Canonical, please suggest that a "Talk" page be implemented on the Wiki like Wikipedia has. I would like to communicate with the people who wrote this page so I could ask them to officially endorse this rollback procedure.

Hans Deragon (deragon)
Changed in nvidia:
status: Incomplete → New
status: New → Incomplete
Changed in xorg (Ubuntu):
status: Incomplete → New
status: New → Incomplete
Hans Deragon (deragon)
Changed in nvidia:
status: Incomplete → New
status: New → Incomplete
Changed in xorg (Ubuntu):
status: Incomplete → New
status: New → Incomplete
Hans Deragon (deragon)
Changed in nvidia:
status: Incomplete → New
status: New → Incomplete
Changed in xorg (Ubuntu):
status: Incomplete → New
status: New → Incomplete
Hans Deragon (deragon)
Changed in nvidia:
status: Incomplete → New
status: New → Incomplete
Changed in xorg (Ubuntu):
status: Incomplete → New
status: New → Incomplete
Revision history for this message
Hans Deragon (deragon) wrote :

Ok, so I upgraded my Lenovo w510 to Ubuntu 16.04 LTS Xenial Xerus and the problem persists. The fix I provide works, though when changing the brightness, it is jerky, i.e. it flashes between a low level and the actual selected level. But once the desired level reached, all is good.

So, can we finally introduce my fix into 14.04 and 16.04? At least, it provides a mean to change the brightness.

description: updated
Changed in nvidia:
status: Incomplete → New
Changed in xorg (Ubuntu):
status: Incomplete → New
penalvch (penalvch)
tags: added: xenial
removed: needs-vivid-test
no longer affects: xorg (Ubuntu)
affects: nvidia → nvidia-graphics-drivers-340 (Ubuntu)
Changed in nvidia-graphics-drivers-340 (Ubuntu):
importance: Undecided → Low
Revision history for this message
Leon (lnsilcott) wrote :

I was experiencing this bug with KDE NEON 5.8 on my MacBookPro5,5. Luckily I stumbled over https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-340/+bug/1389215/comments/50 (Thank you Hans Deragon (deragon)).

As my laptop uses NVIDIA GeForce 9400M, I had to slightly tweak his script and like magic after making it executable, running it and a quick reboot for safe measures.. IT WORKS!!

See attached

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nvidia-graphics-drivers-340 (Ubuntu):
status: New → Confirmed
Revision history for this message
xtsbdu3reyrbrmroezob (xtsbdu3reyrbrmroezob) wrote :

this may actually be a microcode flaw since it apparently affects windows too?

https://forums.geforce.com/default/topic/910276/screen-brightness-issues-with-a-quadro-card/

Changed in nvidia-graphics-drivers-375 (Ubuntu):
status: New → Confirmed
Revision history for this message
xtsbdu3reyrbrmroezob (xtsbdu3reyrbrmroezob) wrote :
Revision history for this message
xtsbdu3reyrbrmroezob (xtsbdu3reyrbrmroezob) wrote :

nox2apic seems like a poor workaround and also doesnt resove the issue on most systems

Changed in nvidia-graphics-drivers-375 (Ubuntu):
importance: Undecided → High
Changed in nvidia-graphics-drivers-340 (Ubuntu):
importance: Low → High
Revision history for this message
Hans Deragon (deragon) wrote :

After using the Nouveau driver for months, I needed performance and came back to Nvidia proprietary driver 340.102 on Ubuntu 16.04. The problem still exist, but my script that fix it by adding 'Option "RegistryDwords" "EnableBrightnessControl=1"' into /usr/share/X11/xorg.conf.d/99-nvidia-proprietary-brigthness-keys-fix.conf works very well.

The only issue left is that when one changes the brightness using the keys Fn and 'brightness up or down' on the keyboard, briefly at each change of brightness, it goes to full for a fraction of a second before settling back to the proper value. This causes an annoying flashing of the screen.

The fix for this is to add "acpi_backlight=native" in /etc/default/grub, like
the following:

  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=native"

Then, issue, as root:

  update-grub
  reboot

With all these changes applied, the brightness issue is fully fixed.

I could integrate this fix and support of the 9400M card into my script, but would it be of any use? Would it be deployed or just be wasted here in this bug report? Would be nice if that script could be added to the Nvidia proprietary driver package. How could this be done? Who should I contact?

To post a comment you must log in.