You are not logged in.

#1 2013-07-28 14:21:51

czheji
Member
Registered: 2011-12-22
Posts: 5

[Solved]Dell XPS 13 cant control backlight

The Dell_XPS_13 said:"the screen brightness does not work".
I find if
/sys/class/backlight/intel_backlight/brightness = 0 (default value is 4882) , I can control backlight by the function keys.
Use SysInit,it easy to add echo command to "/etc/rc.local"

echo -n 0 >/sys/class/backlight/intel_backlight/brightness

But by systemd framework , I dont finded where to do that by root user.
Anyone Help?

Last edited by czheji (2013-07-29 14:52:58)

Offline

#2 2013-07-28 19:05:57

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [Solved]Dell XPS 13 cant control backlight

It is not obvious, but read this part of the systemd wiki article

Create a tmpfile that does that write.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2013-07-28 19:18:35

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved]Dell XPS 13 cant control backlight

I found that using tmpfiles.d for my backlight on my Thinkpad (also Intel graphics) was a bit spotty.  I think this was probably indicative of the systemd-tmpfiles.service being sometimes run before thes particular directories were created.  So I ended up creating a udev rule in order to ensure that the value would be written to the file whenever the backlight stuff in /sys was actually set up.

Here is what I ended up with to set my brightness on boot.  You should be aware that my laptop seems to use acpi_video0 for this.  So you probably are going to have to use udevadm to find appropriate values for the intel_backlight directory specifically.  In other words, this is not meant to be a drop in solution to your issue, just a reference.

$ cat /etc/udev/rules.d/44-backlight.rules
ACTION=="add", KERNEL=="acpi_video0", SUBSYSTEM=="backlight", SUBSYSTEMS=="pci", DRIVERS=="i915", ATTR{brightness}="4"

You may also want to have a look at the bottom of the Intel wiki's troubleshooting.  I personally have to use one of those fixes to make my keyboard backlight functions work at all.

Offline

#4 2013-07-28 19:21:58

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [Solved]Dell XPS 13 cant control backlight

Actually, I was aware of that when I posted my response.  Someone added that caveat to the wiki, so I did not mention it.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2013-07-28 19:25:16

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved]Dell XPS 13 cant control backlight

ewaller wrote:

Actually, I was aware of that when I posted my response.  Someone added that caveat to the wiki, so I did not mention it.

Ah, I see, my bad.  Sorry for the (wordy) noise...

Offline

#6 2013-07-28 19:28:36

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [Solved]Dell XPS 13 cant control backlight

WonderWoofy wrote:

Ah, I see, my bad.  Sorry for the (wordy) noise...

Bah!  You actually provided a rule, the wiki article I liked doesn't  big_smile


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2013-07-29 14:51:56

czheji
Member
Registered: 2011-12-22
Posts: 5

Re: [Solved]Dell XPS 13 cant control backlight

WonderWoofy wrote:

... I think this was probably indicative of the systemd-tmpfiles.service being sometimes run before thes particular directories were created.  So I ended up creating a udev rule in order to ensure that the value would be written to the file whenever the backlight stuff in /sys was actually set up...

Thanks for your help,I got that by adding udev rules.

udevadm info -a -p /sys/class/backlight/intel_backlight

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight':
    KERNEL=="intel_backlight"
    SUBSYSTEM=="backlight"
    DRIVER==""
    ATTR{type}=="raw"
    ATTR{brightness}=="10"
    ATTR{bl_power}=="0"
    ATTR{max_brightness}=="4882"
    ATTR{actual_brightness}=="10"
...

rule looks like this:

cat /etc/udev/rules.d/40-brightness.rules 
ACTION=="add", KERNEL=="intel_backlight", SUBSYSTEM=="backlight", ATTR{brightness}="10"

Last edited by czheji (2013-07-29 14:55:17)

Offline

#8 2013-07-29 15:11:37

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved]Dell XPS 13 cant control backlight

Neato!  Glad I was able to help you achieve your udev rule potential!

Offline

#9 2013-08-07 14:20:56

nshemonsky
Member
From: 40.6856,-76.1955
Registered: 2013-06-07
Posts: 4

Re: [Solved]Dell XPS 13 cant control backlight

I know this is solved but thought I'd chime in since I have an xps 13 as well and was just fighting with this.   I was close to using a udev rule myself but got things working using a systemd temp file.   Oddly though the backlight has to be set via /sys/class/backlight/acpi_video0/backlight rather than intel_backlight when doing it this way.  I also had to add i915 to the modules and rebuild the initramfs. Seems that having the module loaded immediately lets the temp file do the trick.

Offline

Board footer

Powered by FluxBB