LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices

Reply
 
Search this Thread
Old 09-05-2009, 03:48 PM   #1
OMGitsUGOD
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Rep: Reputation: 0
Special buttons and brightness on Lenovo 3000 N100


Hi!
I have a Lenovo 3000 N100 with the Intel Mobile 945GM chipset and with my previous installation (Ubuntu 9.04), adjusting brightness with Fn-F10 and Fn -F11 worked out-of-the-box. Now I have switched to Arch Linux and I have problems with adjusting the brightness and the Fn-[FX] combinations in general.

I was looking for ways of adjusting brightness from the command line, but none of the methods I could find works. For example;

xbacklight

returns "No outputs have backlight property" when running KMS (kernel mode settings), and if I remove KMS it returns "nan".

At various places it was suggested that

xrandr --output LVDS --set BACKLIGHT_CONTROL legacy

would do the trick. This trick does something good as now I'm able to use xbacklight -get and xbacklight -set Y (not running KMS), without getting any error messages. Nothing happens to the screen though.

I also checked my Fn-[FX] buttons with keycode and xev, and as it turns out all Fn-[Fx] combinations (which should do something) are detected except for Fn-F11 which is supposed to increase the brightness level?

What's wrong here, and how is Ubuntu able to get all this working out-of-the box?
 
Old 09-07-2009, 03:18 AM   #2
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,509

Rep: Reputation: 571Reputation: 571Reputation: 571Reputation: 571Reputation: 571Reputation: 571
I know nothing about arch linux and what acpi scripts they provide.

in /etc/acpi, there is an 'events' directory. It is instructive to open a terminal and type 'acpi_listen' in it and you will first see if your video buttons are recognized. Try them with the terminal open, likewise the lid button and the AC supply. You should get an output like this
bash-3.1$ acpi_listen
button/lid C1F0 00000080 00000003
video C163 00000087 00000000 # video brightness down
video C163 00000086 00000000 # video brightness up
ac_adapter C1EB 00000080 00000000
thermal_zone TZ1 00000081 00000000
battery C1ED 00000080 00000001
battery C1ED 00000080 00000001
battery C1ED 00000080 00000001
battery C1ED 00000080 00000001
ac_adapter C1EB 00000080 00000001
thermal_zone TZ1 00000081 00000000

OK, these events are seen. The gibberish after that is model specific. The entry in events is a script in /etc/acpi which tells acpi what to do when it sees this event.

bash-3.1$ cat video_brightnessup
# /etc/acpi/events/video_brightnessup
event=video.* 00000086
action=/etc/acpi/video_brightnessup.sh

If you only have one or two scripts, download the debian acpi scripts (most comprehensive I have seen) or fedora (also good). I had slamd (1 script for me to build)
 
Old 09-08-2009, 09:00 AM   #3
OMGitsUGOD
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the help, it helped me with some of my problems. I couldn't really find the debian script you were referring to. I found one here
http://packages.debian.org/en/lenny/acpi-support,
but I couldn't figure out how it works. This is video_brightnessup.sh for example
Code:
#!/bin/sh
[ -f /usr/share/acpi-support/key-constants ] || exit 0

. /usr/share/acpi-support/key-constants
acpi_fakekey $KEY_BRIGHTNESSUP
Well googling FOR video_brightnessup.sh I found this http://www.ubuntugeek.com/fix-your-l...-in-hardy.html
and the scripts provided there lead me to a solution that sort of works.

I post my modified bash script here if someone has a similar issue, this is eg video_brightnessup.sh
Code:
#!/bin/bash

CURRENT=$(grep "current:" /proc/acpi/video/GFX0/LCD/brightness |awk '{print $2}')
LEVELS=$(grep "levels:" /proc/acpi/video/GFX0/LCD/brightness | sed 's/levels://')

for level in $LEVELS
do
	if [ "$level" -gt "$CURRENT" ]
	then
		echo -n $level > /proc/acpi/video/GFX0/LCD/brightness 
		exit 0	
	fi
done
exit -1
This works fine and I'm able to adjust brightness from the command line. The thing is once I've changed the brightness from being 100 the Fn-[FX] combinations work again, but they don't really step the brightness but just either put it to 100 or to 0 without any intermediate steps. Once the brightness is back to 100 I can't control it anymore with these buttons. Adding the scripts as acpi events does help me from being stuck at 100 but it still steps through from 100 to 0 without intermediate steps. It is as though something else is also listening to the Fn-[FX] events apart from acpi?

I know these got kind of confusing, and I'm sort of ready to give up and see if this is fixed when the new kernel comes out. But if you have anymore ideas let me know!
 
Old 09-09-2009, 03:33 AM   #4
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,509

Rep: Reputation: 571Reputation: 571Reputation: 571Reputation: 571Reputation: 571Reputation: 571
Quote:
Originally Posted by OMGitsUGOD View Post
Thanks for the help, it helped me with some of my problems. I couldn't really find the debian script you were referring to. I found one here
http://packages.debian.org/en/lenny/acpi-support,
but I couldn't figure out how it works. This is video_brightnessup.sh for example
Code:
#!/bin/sh
[ -f /usr/share/acpi-support/key-constants ] || exit 0

. /usr/share/acpi-support/key-constants
acpi_fakekey $KEY_BRIGHTNESSUP
Yeah, I have one of those as well. I do not have /usr/share/acpi-support at all, but the thing works. I did spot this(below), but don't have the manpage. I gather it's some system call that does the magic.
http://www.digipedia.pl/man/acpi_fakekey.1.html

There is another way to do suspend. Try this
cat /sys/power/state
Mine says 'mem disk' Then you suspend/hibernate with
sync; echo -n mem > /sys/power/state, (or disk)
 
Old 09-09-2009, 01:46 PM   #5
OMGitsUGOD
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Original Poster
Rep: Reputation: 0
So you are not really using the acpi script at all then? First line says that if /usr/share/acpi-support/key-support doesn't exist then exit, right?
 
Old 09-10-2009, 03:27 AM   #6
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,509

Rep: Reputation: 571Reputation: 571Reputation: 571Reputation: 571Reputation: 571Reputation: 571
Quote:
Originally Posted by OMGitsUGOD View Post
So you are not really using the acpi script at all then? First line says that if /usr/share/acpi-support/key-support doesn't exist then exit, right?
/Looks
You're right. It's all being done behind my back :-o
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Configureing volume buttons on a Lenovo 3000 N100 Aleksandersen Linux - Laptop and Netbook 2 02-25-2007 02:57 PM
Broken suspend and hibernate on Lenovo 3000 N100 running Ubuntu rune.evjen Linux - Laptop and Netbook 6 02-23-2007 06:31 PM
Lenovo 3000 N100 - config PC cam or fingerprinting jokerv Linux - Laptop and Netbook 3 06-24-2006 05:29 PM
Lenovo 3000 N100 debian unstable aschmi Linux - Laptop and Netbook 0 06-08-2006 02:24 AM
Lenovo 3000 N100 setup issues mngmd Linux - Laptop and Netbook 3 05-23-2006 09:15 AM


All times are GMT -5. The time now is 01:56 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration