View previous topic :: View next topic |
Author |
Message |
mpc n00b
Joined: 11 Mar 2004 Posts: 15
|
Posted: Mon Mar 29, 2004 8:03 pm Post subject: Dell laptop lid switch not working |
|
|
I have a Dell Inspiron 5100 running with the 2.6 kernal and the screen does not blank when I close the lid.
I noticed a mention of the lid switch on boot, and dmegs had this to say:
Code: | ACPI: Lid Switch [LID] |
Has anyone else run into this problem?
Any Ideas?
Thank you |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Mon Mar 29, 2004 8:36 pm Post subject: |
|
|
You've got to either enable it in your BIOS or emerge acpid and configure it to react on the LID switch. |
|
Back to top |
|
|
mpc n00b
Joined: 11 Mar 2004 Posts: 15
|
Posted: Mon Mar 29, 2004 8:45 pm Post subject: |
|
|
I have acpid emerged but I can't find a config file for it? |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Mon Mar 29, 2004 11:05 pm Post subject: |
|
|
By default /etc/acpi/default.sh is called for every event.
Here's a little more extended one. Replace ACTION with what you like.
Code: |
#!/bin/sh
set $*
group=${1/\/*/}
action=${1/*\//}
case "$group" in
button)
case "$action" in
power) ACTION
;;
sleep) ACTION
;;
lid) ACTION
;;
*) logger "ACPI group button / action $action is not defined"
;;
esac
;;
battery)
case "$action" in
battery) ACTION
;;
*) logger "ACPI group battery / action $action is not defined"
;;
esac
;;
ac_adapter)
case "$action" in
ac_adapter) ACTION
;;
*) logger "ACPI group ac_adapter / action $action is not defined"
;;
esac
;;
*)
logger "ACPI group $group / action $action is not defined"
;;
esac
|
See [1] for an example on how to use for Power Management.
[1] http://www.stud.uni-karlsruhe.de/~uxhz/gentoo/power-management |
|
Back to top |
|
|
mpc n00b
Joined: 11 Mar 2004 Posts: 15
|
Posted: Tue Mar 30, 2004 6:33 am Post subject: |
|
|
Thanks for your help. Sory about the late reply. Work called and all of that.
Sorry if I'm asking stupid questions but I can't seam to find a way to get the screen to blank. So therefor I can not modify the default.sh script
I tried: Code: | setterm -powersave powerdown |
but all I got was: Code: | cannot (un)set powersave mode |
I know I'm missing somthing realy simple. Sorry.
Thanks for all of your help |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Tue Mar 30, 2004 6:42 am Post subject: |
|
|
Try Code: | xset dpms force off | . Replace off with suspend or standby if you like. |
|
Back to top |
|
|
mpc n00b
Joined: 11 Mar 2004 Posts: 15
|
Posted: Tue Mar 30, 2004 6:47 am Post subject: |
|
|
tried
Quote: | xset dpms force off |
the system takes the command but nothing happens |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Tue Mar 30, 2004 7:49 am Post subject: |
|
|
Do you have Code: | Option "DPMS" "true" | in the Monitor section in /etc/X11/XF86Config? |
|
Back to top |
|
|
mpc n00b
Joined: 11 Mar 2004 Posts: 15
|
Posted: Tue Mar 30, 2004 1:48 pm Post subject: |
|
|
AHHH!!! Wonderfull. By adding: Code: | Option "DPMS" "true" | I was able to get the screen to blank. But...
1) The screen blanks but it looks like the backlight is still on. Any Idea how to kill this?
2) And second, I added the lid line to /etc/aspci/default.sh as follows with no result.
Code: |
case "$action" in
power) /sbin/init 0
;;
lid) /usr/X11R6/bin/xset dpms force off
;;
*) logger "ACPI action $action is not defined"
;;
esac |
Thank you very much for all of your help. |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Tue Mar 30, 2004 2:11 pm Post subject: |
|
|
You can use app-laptop radeontool if you have an ATI Radeon mobility graphics card to turn the backlight off.
For the script: Very likely there's a syntax error inside that causes the script to fail. Try running it by hand and look for useful error messages. |
|
Back to top |
|
|
zerocool_australia n00b
Joined: 31 Jul 2003 Posts: 58
|
Posted: Tue Mar 30, 2004 3:49 pm Post subject: |
|
|
Dell Inspiron 1100 and 5100 series laptops' BIOS does not work with the Linux ACPI implementation currently, the biggest problem is the /proc/acpi/events does not generate any events (from what I can see) ever. I have had both an 1100 and a 5100 and neither will do this. You can get the status of everything from /proc/acpi/[device] but no realtime event generation.
DPMS in X will blank the screen and or power down the backlight also when you have DPMS on. If it is not turning off the backlight it probably isn't actually DPMS doing it. Mess with the xset dpms command sometime. I put an xset dpms 300 300 300 in my flux rc file to turn off the screen totally after 5 minutes and it works. All those acpid scripts you can throw out the window, acpid is dependant on /proc/acpi/events working
David |
|
Back to top |
|
|
mpc n00b
Joined: 11 Mar 2004 Posts: 15
|
Posted: Tue Mar 30, 2004 4:26 pm Post subject: |
|
|
Quote: | All those acpid scripts you can throw out the window, acpid is dependant on /proc/acpi/events working |
That explains a lot
However seeing as Code: | xset dpms force off | still only blanks the screen and does not kill the backlight. I looks as if dpms is enabled implicity when dpms force off is entered. Testing dpms with just put the screen blank but did not kill the backlight. I must me missing somthing
radeontool kills the backlight but I had to turn it back on headless (not somthing I want to do all the time) |
|
Back to top |
|
|
zerocool_australia n00b
Joined: 31 Jul 2003 Posts: 58
|
Posted: Tue Mar 30, 2004 4:51 pm Post subject: |
|
|
Very interesting, for me, xset dpms force off turns off the backlight.
Here is my xset -q, paste yours too please possibly there's another setting I forgot that I set.
bash-2.05b$ xset q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000000
auto repeat delay: 660 repeat rate: 25
auto repeating keys: 00ffffffdffffbbf
fadfffdfffdfe5ef
ffffffffffffffff
ffffffffffffffff
bell percent: 50 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 2/1 threshold: 4
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 600 cycle: 600
Colors:
default colormap: 0x20 BlackPixel: 0 WhitePixel: 16777215
Font Path:
/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/75dpi/,/usr/X11R6/lib/X1 1/fonts/100dpi/
Bug Mode: compatibility mode is disabled
DPMS (Energy Star):
Standby: 300 Suspend: 300 Off: 300
DPMS is Enabled
Monitor is On
Font cache:
hi-mark (KB): 5120 low-mark (KB): 3840 balance (%): 70
File paths:
Config file: /etc/X11/XF86Config
Modules path: /usr/X11R6/lib/modules
Log file: /var/log/XFree86.0.log |
|
Back to top |
|
|
mpc n00b
Joined: 11 Mar 2004 Posts: 15
|
Posted: Tue Mar 30, 2004 6:20 pm Post subject: |
|
|
Here you go Code: | Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000000
auto repeat delay: 660 repeat rate: 25
auto repeating keys: 00ffffffdffffbbf
fadfffffffdffdff
ffffffffffffffff
ffffffffffffffff
bell percent: 50 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 2/1 threshold: 4
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 0
Colors:
default colormap: 0x20 BlackPixel: 0 WhitePixel: 16777215
Font Path:
/usr/X11R6/lib/X11/fonts/local/,/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/75dpi/:unscaled,/usr/X11R6/lib/X11/fonts/100dpi/:unscaled,/usr/X11R6/lib/X11/fonts/Speedo/,/usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/75dpi/,/usr/X11R6/lib/X11/fonts/100dpi/
Bug Mode: compatibility mode is disabled
DPMS (Energy Star):
Standby: 7200 Suspend: 7200 Off: 14400
DPMS is Enabled
Monitor is On
Font cache:
hi-mark (KB): 5120 low-mark (KB): 3840 balance (%): 70
File paths:
Config file: /etc/X11/XF86Config
Modules path: /usr/X11R6/lib/modules
Log file: /var/log/XFree86.0.log |
I did notice that dpms was not enabled when I turned my computer back on, but I enabled it and xset dpms force off still will not kill the backlight
Thanks |
|
Back to top |
|
|
kongit n00b
Joined: 26 Mar 2004 Posts: 35
|
Posted: Tue Mar 30, 2004 9:29 pm Post subject: |
|
|
Quote: | Dell Inspiron 1100 and 5100 series laptops' BIOS does not work with the Linux ACPI implementation currently, the biggest problem is the /proc/acpi/events does not generate any events (from what I can see) ever. I have had both an 1100 and a 5100 and neither will do this. You can get the status of everything from /proc/acpi/[device] but no realtime event generation.
DPMS in X will blank the screen and or power down the backlight also when you have DPMS on. If it is not turning off the backlight it probably isn't actually DPMS doing it. Mess with the xset dpms command sometime. I put an xset dpms 300 300 300 in my flux rc file to turn off the screen totally after 5 minutes and it works. All those acpid scripts you can throw out the window, acpid is dependant on /proc/acpi/events working
|
not entirely true. I have a dell inspiron 5100 and I know that the lids states are changed in the file. It might be because your bios isn't a newer one. I had to upgrade mine to at least a23 to get acpi to work. However I have not been able to get the screen to turn off when shutting the lid but that is most likely due to some error on my part. |
|
Back to top |
|
|
trapperjohn Apprentice
Joined: 11 Nov 2003 Posts: 242 Location: Bremen/Germany
|
Posted: Thu Apr 01, 2004 1:17 pm Post subject: |
|
|
I have an Inspiron 8600 and lid etc. works. I've read somewhere, that newer nVidia Drivers don't work with DPMS - maybe there is a problem with your drivers, too. ATM I have to restart acpid after login, else "xset" doesn't work - still have to investigate this problem.
Another thing is replacing your DSDT with a corrected one - look at http://acpi.sf.net (there's a HowTo in this forum, too).
Good Luck. |
|
Back to top |
|
|
zerocool_australia n00b
Joined: 31 Jul 2003 Posts: 58
|
Posted: Thu Apr 01, 2004 6:03 pm Post subject: |
|
|
Quote: | not entirely true. I have a dell inspiron 5100 and I know that the lids states are changed in the file. It might be because your bios isn't a newer one. I had to upgrade mine to at least a23 to get acpi to work. However I have not been able to get the screen to turn off when shutting the lid but that is most likely due to some error on my part. |
Yes, sigh, I knew that, my point is that the /proc/acpi/event interface does not work and you will not get realtime events. If you want to do anything with the status of the lid, you would have to have a daemon poll the lid state file. I never said this didn't work.
By the way, the newer BIOSes are the reasons this don't work. For lucky people with A02 and other early BIOSes more ACPI seems to work.
Also....as someone else mentioned new DSDTs...there is no new DSDT to fix the event interface and I don't have enough time to write one. |
|
Back to top |
|
|
g3n Guru
Joined: 13 Dec 2003 Posts: 543 Location: México
|
Posted: Wed Jun 02, 2004 6:13 pm Post subject: |
|
|
I have bios a23, is there anything that i can do? i cant understand this _________________ --[G]-- |
|
Back to top |
|
|
_DaMaGe_ n00b
Joined: 12 Jun 2004 Posts: 4
|
Posted: Sat Jun 12, 2004 8:16 pm Post subject: Hey, I had a similar problem |
|
|
Hey guys, I had a similar problem
I just bought a dell inspiron 1150 and the lid switch wasn't working
i don't think any of the events were working
I'm pretty sure the ACPID daemon just isn't compatible with these dells
however, querying the states of the devices seemed to be working fine, as my battery monitor works fine
so i created a perl script to run as a daemon to monitor the lid switch and turn it off with the xset dpms force off command
here is the script, it may work for you too
<CODE>
#!/usr/bin/perl -w
$pid = fork();
if($pid) { exit; }
$last = 1;
while(1) {
sleep 3;
@data = `cat /proc/acpi/button/lid/LID/state`;
$state = $data[0];
if($state =~ /open/ && $last == 0) {
`xset dpms force on`;
$last = 1;
} elsif ($state =~ /closed/ && $last == 1) {
`xset dpms force off`;
$last = 0;
}
}
</CODE> |
|
Back to top |
|
|
DaMaGe n00b
Joined: 12 Jun 2004 Posts: 9
|
Posted: Sat Jun 12, 2004 8:40 pm Post subject: |
|
|
Get your own name. Stop copying other people
Had this name for 7 years on the net. And slowly I start seeing other people using the SAME way of me spelling it. |
|
Back to top |
|
|
_DaMaGe_ n00b
Joined: 12 Jun 2004 Posts: 4
|
Posted: Sat Jun 12, 2004 8:44 pm Post subject: LOL |
|
|
to be truly honest, I never even noticed your nickname
I've been nicknamed damage for most my life because it rhymes with my last name
sorry about that!
i've been trying to think of a new nickname anyways obviously its a decent nickname for my friends to call me , but not on the net where we are running out of 'unique' handles. |
|
Back to top |
|
|
_DaMaGe_ n00b
Joined: 12 Jun 2004 Posts: 4
|
Posted: Sat Jun 12, 2004 8:47 pm Post subject: DaMaGe |
|
|
well, anyways
i'll use this nickname for now
can't go wrong with japanese... |
|
Back to top |
|
|
_DaMaGe_ n00b
Joined: 12 Jun 2004 Posts: 4
|
Posted: Sat Jun 12, 2004 8:50 pm Post subject: Anyways |
|
|
I tried to change it... doesn't seem to work
sorry! |
|
Back to top |
|
|
DaMaGe n00b
Joined: 12 Jun 2004 Posts: 9
|
Posted: Sat Jun 12, 2004 9:09 pm Post subject: |
|
|
lol, not everyday you come face to face with yourself!!!!! |
|
Back to top |
|
|
Voltago Advocate
Joined: 02 Sep 2003 Posts: 2593 Location: userland
|
Posted: Sat Jun 12, 2004 10:12 pm Post subject: |
|
|
Had the same issue with the lid some time ago.
What bugged me was that you seem to need a running X to use the xset tool to control monitor states, also trying it in terminals other than vc 7 where X was running didn't work.
So I figured out how X was doing it and hacked up a tool that does exactly the same directly. Actually, I just altered the 'vbetest' tool a bit, see code comment. OK, here goes:
Code: | /*
Change the dpms mode of your graphics controller.
Version: 0.1
Date: 12.06.2004
This program is derived from the public domain
code of 'vbetest.c' from the 'lrmi' package
available at http://sourceforge.net/projects/lrmi
and is also in the public domain.
Furthermore, this program comes with no warranty for
fitness for any purpose whatsoever and if it reduces
your computer to a smoldering heap I shall not be
held responsible.
To build it, you'll need said lrmi package.
I used version 0.8, the environment is Linux,
the machine is a Dell 510m laptop with Intel's
82852/855GM graphics bloody controller.
Andreas Eckstein, 2004
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#if defined(__linux__)
#include <sys/io.h>
#include <sys/kd.h>
#include <sys/stat.h>
#elif defined(__NetBSD__)
#include <time.h>
#include <dev/wscons/wsconsio.h>
#include <machine/sysarch.h>
#elif defined(__FreeBSD__)
#include <machine/console.h>
#include <machine/sysarch.h>
#endif
#include <lrmi.h>
#include <vbe.h>
#define DPMS_ON ((unsigned int)0x00000000)
#define DPMS_STANDBY ((unsigned int)0x00000100)
#define DPMS_SUSPEND ((unsigned int)0x00000200)
#define DPMS_OFF ((unsigned int)0x00000400)
#define VESA_DPMS ((unsigned int)0x00004F10)
#define DPMS_SET_MODE ((unsigned int)0x00000001)
#define DPMS_GET_MODE ((unsigned int)0x00000002)
#define MASK_LBYTE ((unsigned int)0x000000FF)
#define MASK_HBYTE ((unsigned int)0x0000FF00)
struct {
struct vbe_info_block *info;
struct vbe_mode_info_block *mode;
char *win; /* this doesn't point directly at the window, see update_window() */
int win_low, win_high;
} vbe;
void
usage_and_quit(int error)
{
fputs("Usage: dpmsctl {on|standby|suspend|off|status}\n",
error ? stderr : stdout);
exit(error);
}
int
main(int argc, char *argv[])
{
int retval=0;
struct LRMI_regs r;
#if defined(__NetBSD__)
unsigned long iomap[32];
#endif
unsigned int dpms_mode=-1;
unsigned int dpms_action=DPMS_SET_MODE;
if(argc>1) {
if (strcmp(argv[1], "on") == 0) {
dpms_mode=DPMS_ON;
} else if (strcmp(argv[1], "standby") == 0) {
dpms_mode=DPMS_STANDBY;
} else if (strcmp(argv[1], "suspend") == 0) {
dpms_mode=DPMS_SUSPEND;
} else if (strcmp(argv[1], "off") == 0) {
dpms_mode=DPMS_OFF;
} else if (strcmp(argv[1], "status") == 0) {
dpms_action=DPMS_GET_MODE;
dpms_mode=0;
} else {
usage_and_quit(1);
}
}
if(dpms_mode==-1)
usage_and_quit(1);
//printf("dpms_mode: %d\n", dpms_mode);
if (!LRMI_init()){
fprintf(stderr, "Can't initialize LRMI environment\n");
return 1;
}
vbe.info = LRMI_alloc_real(sizeof(struct vbe_info_block)
+ sizeof(struct vbe_mode_info_block));
if (vbe.info == NULL) {
fprintf(stderr, "Can't alloc real mode memory\n");
return 1;
}
vbe.mode = (struct vbe_mode_info_block *)(vbe.info + 1);
#if 0
/*
Allow read/write to video IO ports
*/
ioperm(0x2b0, 0x2df - 0x2b0, 1);
ioperm(0x3b0, 0x3df - 0x3b0, 1);
#else
/*
Allow read/write to ALL io ports
*/
#if defined(__linux__)
ioperm(0, 1024, 1);
iopl(3);
#elif defined(__NetBSD__)
memset(&iomap[0], 0xff, sizeof(iomap));
i386_set_ioperm(iomap);
i386_iopl(3);
#elif defined(__FreeBSD__)
i386_set_ioperm(0, 0x10000, 1);
#endif
#endif
memset(&r, 0, sizeof(r));
r.eax = 0x4f00;
r.es = (unsigned int)vbe.info >> 4;
r.edi = 0;
memcpy(vbe.info->vbe_signature, "VBE2", 4);
if (!LRMI_int(0x10, &r)) {
fprintf(stderr, "Can't get VESA info (vm86 failure)\n");
return 1;
}
if ((r.eax & 0xffff) != 0x4f || strncmp(vbe.info->vbe_signature, "VESA", 4) != 0) {
fprintf(stderr, "No VESA bios\n");
return 1;
}
r.eax=VESA_DPMS;
r.ebx= dpms_action | dpms_mode;
LRMI_int(0x10, &r);
if(dpms_action==DPMS_SET_MODE)
{
}
if(dpms_action==DPMS_GET_MODE)
{
dpms_mode = (r.ebx & MASK_HBYTE);
printf("active dpms mode: ");
switch(dpms_mode)
{
case DPMS_ON:
printf("on\n");
break;
case DPMS_STANDBY:
printf("standby\n");
break;
case DPMS_SUSPEND:
printf("suspend\n");
break;
case DPMS_OFF:
printf("off\n");
break;
default:
printf("error: received non VESA-compliant DPMS state\n");
printf("but if you can read this, DPMS state should be 'on'\n");
retval = 1;
}
}
int dpms_return = (r.eax & MASK_HBYTE) >> 8;
if(dpms_return!=0)
printf("error code: %d\n", dpms_return);
LRMI_free_real(vbe.info);
return retval;
} |
To build the code, save it as e. g. 'dpmsctl.c', emerge 'lrmi' and type
Code: | gcc -o dpmsctl dpmsctl.c -llrmi |
Oh yes, lrmi-0.8 is not in portage, but you can just rename the 0.7 ebuild.
This should make the perfect tool for use with powermanagement scripts and for driving people mad with mysterious monitor 'malfunctions' you can control per ssh...
Questions, comments and constructive criticism are most welcome!
P. S.: Look, ma, my first piece of OSS! |
|
Back to top |
|
|
|