Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Backlight controls
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
K73SK
n00b
n00b


Joined: 14 Jan 2015
Posts: 4

PostPosted: Wed Jan 14, 2015 8:38 pm    Post subject: Backlight controls Reply with quote

Alright, so I've tried getting help from a few on the irc about this... Figured I might give a try here too. I used to have Linux Mint installed on this computer but wanted to do Gentoo instead. I have everything working except the backlight. It's either at 100% (when power is plugged in) or the dimmest of 0% (when running on battery). I have no control of it. I have tried following this guide: wiki.gentoo.org/wiki/Power_management/HOWTO#About_laptop_mode but that did not help me (actually made things worse). I tried this: https://wiki.ubuntu.com/Kernel/Debugging/Backlight but still no luck.

Emerge --info: http://pastebin.com/Nt5ykjma
dmesg: http://pastebin.com/wUqwTpGw
.config: http://pastebin.com/DPgWdHJi

My laptop is a Samsung NP470R5E-K02UB

If anyone has any idea what kernel modules I need to load or whatnot, please let me know. I've been having trouble with this for the past week lol. Or is there something else I need to do?

Thanks.

edit: And yes, I do have the folder: /sys/class/backlight/intel_backlight/ and it has the brightness files. Here's the cat on each file:

actual_brightness: 4882
bl_power: 0
brightness: 4882
max_brightness: 4882

When I do Fn + the brightness keys, these values do go up and down. The screen's brightness doesn't change, though.
Back to top
View user's profile Send private message
tclover
Guru
Guru


Joined: 10 Apr 2011
Posts: 516

PostPosted: Wed Jan 14, 2015 9:45 pm    Post subject: Reply with quote

I have no clue on what x86 platform you have to enable for Samsung hardware (hw)... you will have to dig that up yourself.
Actually, you will have to read ACPI related article on the wiki on how to get ACPI working on your hw. Second, look for x86 platform driver for Samsung hw.

With a working ACPI+x86 platfrom drivers combination, Fn+$KEY combination would work. But do not expect everything to work (you will have to look on Thinkpads... or Dell hw for that.) You should do this first.

And then... even in the case the (samsung) x86 platform driver does no provide anything workable with Fn+$KEY for backlight; a workable ACPI would be enough to get a workable `xbacklight -dec|-inc $VALUE' to work with. And then, you can configure your WM/DE to bind some keys to `xbacklight -inc 10' & `xbacklight -dec 10' which would do the trick. (Or else, you will have to type the equivalent in a terminal... beware that, in this case, you should not shut off the screen because you could not increase it afterwards.)
_________________
home/:mkinitramfs-ll/:supervision/:e-gtk-theme/:overlay/
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Wed Jan 14, 2015 10:34 pm    Post subject: Reply with quote

K73SK ... does adding 'video.use_native_backlight=1' to your boot parameters have any effect?

As far as acpi is concerned I have the following:

/etc/acpi/default.sh
Code:
video)
   case "$action" in
      brightnessup)
         /etc/acpi/actions/backlight.sh up
         ;;
      brightnessdown)
         /etc/acpi/actions/backlight.sh down
         ;;
      *) log_unhandled $*
         ;;
   esac
   ;;

/etc/acpi/actions/backlight.sh

Code:
#!/bin/sh

backlight_sys_dir="/sys/class/backlight/intel_backlight"

read -r max_brightness < "${backlight_sys_dir}/max_brightness"
read -r curr_brightness < "${backlight_sys_dir}/brightness"

case "$1" in
      up) increment="+ 10" ;;
    down) increment="- 10" ;;
       *) exit 1 ;;
esac

new_brightness=$(($curr_brightness $increment))

if $((new_brightness < 1)) || $((new_brightness > $max_brightness)); then
    exit 1
else
    echo "$new_brightness" > ${backlight_sys_dir}/brightness
fi

HTH & best ... khay
Back to top
View user's profile Send private message
K73SK
n00b
n00b


Joined: 14 Jan 2015
Posts: 4

PostPosted: Thu Jan 15, 2015 1:42 am    Post subject: Reply with quote

tclover wrote:
I have no clue on what x86 platform you have to enable for Samsung hardware (hw)... you will have to dig that up yourself.
Actually, you will have to read ACPI related article on the wiki on how to get ACPI working on your hw. Second, look for x86 platform driver for Samsung hw.

With a working ACPI+x86 platfrom drivers combination, Fn+$KEY combination would work. But do not expect everything to work (you will have to look on Thinkpads... or Dell hw for that.) You should do this first.

And then... even in the case the (samsung) x86 platform driver does no provide anything workable with Fn+$KEY for backlight; a workable ACPI would be enough to get a workable `xbacklight -dec|-inc $VALUE' to work with. And then, you can configure your WM/DE to bind some keys to `xbacklight -inc 10' & `xbacklight -dec 10' which would do the trick. (Or else, you will have to type the equivalent in a terminal... beware that, in this case, you should not shut off the screen because you could not increase it afterwards.)


I installed samsung-tools and also samsung-backlight (compiled, installed, and added module). Tools allows me to disable/enable it, but doesn't control the brightness in anyway. the backlight driver did nothing (didn't expect it since my model wasn't on the "supported" list).

xbacklight doesn't do anything different than my current Fn keys. As mentioned in the post, My Fn keys do change the values to the brightness files, and I even have the GUI pop up telling me that the brightness is changing levels. But the change doesn't actually go to my backlight. I tried xbacklight anyway just in case, and expected, nothing happen.

khayyam wrote:
K73SK ... does adding 'video.use_native_backlight=1' to your boot parameters have any effect?

As far as acpi is concerned I have the following:

/etc/acpi/default.sh
Code:
video)
   case "$action" in
      brightnessup)
         /etc/acpi/actions/backlight.sh up
         ;;
      brightnessdown)
         /etc/acpi/actions/backlight.sh down
         ;;
      *) log_unhandled $*
         ;;
   esac
   ;;

/etc/acpi/actions/backlight.sh

Code:
#!/bin/sh

backlight_sys_dir="/sys/class/backlight/intel_backlight"

read -r max_brightness < "${backlight_sys_dir}/max_brightness"
read -r curr_brightness < "${backlight_sys_dir}/brightness"

case "$1" in
      up) increment="+ 10" ;;
    down) increment="- 10" ;;
       *) exit 1 ;;
esac

new_brightness=$(($curr_brightness $increment))

if $((new_brightness < 1)) || $((new_brightness > $max_brightness)); then
    exit 1
else
    echo "$new_brightness" > ${backlight_sys_dir}/brightness
fi

HTH & best ... khay


I put that into my boot parameters and it didn't change anything, unfortunately. Also, just looking at your scripts, do those simply do the same thing as echoing new values into the brightness files? The values change with my Fn keys so that shouldn't be necessary. If you think they should work, or I'm reading the script wrong, let me know and I'll give it a try.

I forgot to mention to both of you that the video card in here is apparently an Intel HD 4000. I tried googling that and finding answers to it, and still am looking up answers. So far, nothing. I still feel that there's something in the kernel I'm missing and just can't seem to notice lol.

The only thing I did notice that was different is that I don't have a /etc/acpi folder...

Thanks for the responses.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Thu Jan 15, 2015 8:13 am    Post subject: Reply with quote

K73SK wrote:
The only thing I did notice that was different is that I don't have a /etc/acpi folder...

K73SK ... you're welcome. In which case you don't have sys-power/acpid installed ... or running ... and so nothing to notify, or act on, acpi events (like a button press).

Code:
# emerge --ask acpid
# rc-update add acpid default
# /etc/init.d/acpid start

HTH & best ... khay
Back to top
View user's profile Send private message
K73SK
n00b
n00b


Joined: 14 Jan 2015
Posts: 4

PostPosted: Fri Jan 16, 2015 1:27 am    Post subject: Reply with quote

khayyam wrote:
K73SK wrote:
The only thing I did notice that was different is that I don't have a /etc/acpi folder...

K73SK ... you're welcome. In which case you don't have sys-power/acpid installed ... or running ... and so nothing to notify, or act on, acpi events (like a button press).

Code:
# emerge --ask acpid
# rc-update add acpid default
# /etc/init.d/acpid start

HTH & best ... khay


I gave that a shot, still no go lol. I also copied your scripts into the respective folders (just in case) but that didn't help, even after rebooting. :(

Is there anything I could grab from my previous Linux Mint install that might help? I imaged the data before overwriting it with Gentoo. :)
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Fri Jan 16, 2015 7:30 am    Post subject: Reply with quote

K73SK wrote:
I gave that a shot, still no go lol. I also copied your scripts into the respective folders (just in case) but that didn't help, even after rebooting.

K73SK ... one was a (complete) script, the other was a exerpt (the 'video' section from default.sh) ... the latter won't work standalone. The complete /etc/acpi/default.sh can be viewed here.

Thats perhaps the reason for it not working ...

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum