ACPI Problems with Ubuntu Hoary

Steelerz37

Senior member
Feb 15, 2003
693
0
0
I recently switched to Ubuntu linux, Hoary Preview version. I think it is an excellent distro, especially for a beginner like me. I have been able to fix many of the annoyances I had when first installed. I love the apt-get feature as well.

My 2 problems are are that I can not get my inspiron 8600 to resume from standby or hibernate. Both standby and hibernate start fine, but neither will resume correctly and I am forced to hard reboot. I have played with the settings in /etc/default/acpi-support to no avail.

The second problem I have is with my wireless roaming. Not sure if there is anyway to set this up for multiple wireless networks with WEP. Nothing I have tried has worked very well for this problem.


Edit:
I've been working on this for a while now and finally stumbled on to something i feel is important to note, both suspend and hibernate work when X is not running. When I run the scripts from the console and then resume, it seems to work great.


Thanks for any help.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
waproamd should fix the second problem.

As for the first, a lot of boxes have broken ACPI implementations because they only test with the MS compiler and not the Intel one, there's not much you can do in most cases. Sometimes a new kernel will fix the problem, sometimes a firmware update for the machine will take care of it and sometimes you just have to ditch ACPI completely. You might be able to get by with APM instead of ACPI, depends on the hardware.
 

Need4Speed

Diamond Member
Dec 27, 1999
5,383
0
0
as nothinman said, ACPI support in laptops is far from what I would call dependable. Some people have success others don't. On my 600m it works half the time. sometimes it wont resume, the touchpad wont work, or X needs a reboot. I find it easier just to use AC or shut the laptop down when not in use. If you need to use wireless and ACPI, linux would not be my first choice.

There are some decent ACPI scripts over on the gentoo forums that you might want to search for and read through.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
There's also a feature called "software suspend" that used to be an add-on, but is now built into some kernels (not sure which distros, though). It's not quite as good as real hardware ACPI/APM power management, but sometimes it can be used as a fallback when the hardware just won't work. Basically, it's a hibernate-type of thing where it writes the RAM to swap, powers off, and then restores when you reboot. So the machine still has to POST, but it at least doesn't need to go through all the init sequences.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
swsusp is in stock 2.6, has been for a while. There's also swsusp2 which is still an external patch but has more supported features and is being worked into something suitable for merging.

And it's not a replacement for ACPI/APM power mangement, it's a supplement. At the end of the day I hibernate my notebook and take it home, when I turn on my notebook next it resumes in ~20s with everything I had open still running. It's a huge time saver.
 

calyco

Senior member
Oct 7, 2004
825
1
81
I had a Inspiron 1150 that didnt work well with acpi either, its a little better now with my Thinkpad.
 

Steelerz37

Senior member
Feb 15, 2003
693
0
0
thanks for all the advice guys, sorry i havent checked this sooner but i've been really busy with school this week.

I havent messed with the ACPI problem this week too much, but rather been focusing on my wireless issue. I still cant seem to get it to work reliably. I've noticed that at my house when I reboot I will always pickup and gain access to my network. But as soon as I try messing with any wireless programs, the connection is dropped and I am unable to bring it back up and a reboot is required to gain access again. I think this may be my partial problem at getting some of these programs working.

What happens when ubuntu boots that allows it to work that I am not doing when trying to reconnect after it is already booted?
I also am unsure that I am getting waproamd setup correctly, I dont know anything about scripting and that seems to be necassary in the "essid:WLANname" files.


Oh I also forgot to mention, in suse 9.2 when I was using that for a little while, it did work quite well with the standby features. Not sure what they did different but maybe that will spark an idea in someone :) thanks for all the help guys
 

Steelerz37

Senior member
Feb 15, 2003
693
0
0
I've been working on this for a while now and finally stumbled on to something i feel is important to note, both suspend and hibernate work when X is not running. When I run the scripts from the console and then resume, it seems to work great.
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
http://acpi.sourceforge.net/---see if they have a DSDT for your system. If not, the site tells you how to extract the DSDT, disassemble it, fix the errors the stupid MS AML assembler misses (and why not warnings too?), and reassemble it (using Intel's tools), and there's a kernel patch that lets you load the patched DSDT from an initrd.
 

Steelerz37

Senior member
Feb 15, 2003
693
0
0
Originally posted by: bersl2
http://acpi.sourceforge.net/---see if they have a DSDT for your system. If not, the site tells you how to extract the DSDT, disassemble it, fix the errors the stupid MS AML assembler misses (and why not warnings too?), and reassemble it (using Intel's tools), and there's a kernel patch that lets you load the patched DSDT from an initrd.

I got the IASL compiler working, my DSDT had 5 warnings when recompiling, and the custom one from the site you gave me had 4 warnings, so we'll give it a shot. The instructions are wanting me to apply the patch to the kernel at /usr/src/linux-2.6.0, I dont have a /usr/src/linux-VERSION, instead I have /usr/src/linux-headers-2.6.10-4-386, is this where I apply the patch to?

I also am unsure as to what these steps (3,4,5)require:

3. Make sure that ramdisk and initrd support are compiled statically into the kernel
Code:
Device Drivers --->
Block Devices --->
<*> RAM disk support
[*] Initial RAM disk (initrd) support

4. Make sure that the new "Read DSDT from initrd" option is selected under the ACPI menu
Code:
Power management options (ACPI, APM) --->
ACPI (Advanced Configuration and Power Interface) Support --->
[*] Read DSDT from initrd

5. Recompile the kernel

Great! Now the kernel is ready to accept a DSDT as an initrd. Next, we need to copy the fixed DSDT.aml file to /boot and edit our grub.conf to point to the DSDT.




I think if I can get through these steps I should be good to go and hopefully it will work :)
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Originally posted by: Steelerz37
Originally posted by: bersl2
http://acpi.sourceforge.net/---see if they have a DSDT for your system. If not, the site tells you how to extract the DSDT, disassemble it, fix the errors the stupid MS AML assembler misses (and why not warnings too?), and reassemble it (using Intel's tools), and there's a kernel patch that lets you load the patched DSDT from an initrd.


I can't seem to get the intel compiler to compile. I think I found a good DSDT from there. My old one was compiled with MSFT. There problems I have when trying to "make" as the intel site where I dowloaded said to do are:

root@ubuntu:/home/ben/Desktop/acpica-unix-20050309/compiler # make
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -D_ACPI_ASL_COMPILER -I../include -c -o aslcompilerlex.o aslcompilerlex.c
aslcompiler.l: In function `comment':
aslcompiler.l:847: error: `yytext_ptr' undeclared (first use in this function)
aslcompiler.l:847: error: (Each undeclared identifier is reported only once
aslcompiler.l:847: error: for each function it appears in.)
make: *** [aslcompilerlex.o] Error 1


I'm new to linux so I'm not very good at troubleshooting these things :(

Do you not have flex and (byacc or bison) installed? And maybe I didn't make things clear enough: if there's already a fixed DSDT in the repository, you don't need the Intel compiler. All you need then is a kernel patch from here.

:beer:
 

Steelerz37

Senior member
Feb 15, 2003
693
0
0
i fixed it, check above, i edited my post

Also the fixed DSDT i found is an asl file only, so that does need to be compiled correct? When i did that it spit out a new DSDT.aml file

I think they may not have a fixed DSDT for me. I didnt notice this before, but do the BIOS revisions of the fixed DSDT's need to match the BIOS revision of my laptop? I'm assuming they do. So I may actually need to try to fix my current DSDT instead.
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
ASL is a source file, which does need to be assembled. BIOS revisions may slightly change the tables, but unless something changed in a major way, it's usually alright.
 

Steelerz37

Senior member
Feb 15, 2003
693
0
0
Originally posted by: bersl2
ASL is a source file, which does need to be assembled. BIOS revisions may slightly change the tables, but unless something changed in a major way, it's usually alright.


Ok, one more question, I havent got to that point yet, but how do I recompile the kernel?
Also the instructions are wanting me to apply the patch to the kernel at /usr/src/linux-2.6.0, I dont have a /usr/src/linux-VERSION, instead I have /usr/src/linux-headers-2.6.10-4-386, is this where I apply the patch to, and this would be what I recompile? I also downloaded the newest kernel from kernel.org, so maybe it would be best to use that instead of my current kernel?

I just want to say thanks, you have been a lot of help so far, even if this doesnt work, I really appreciate the time and effort your putting in to help me :)
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Ubuntu has a kernel-source package, apparently. You can use that or the latest vanilla 2.6 source. I wouldn't know what extra patches are applied to the distro package, or if the DSDT/initrd patch will apply cleanly to the Ubuntu-packaged source, so using the vanilla source is probably safer.

Just apply the initrd patch and the swsusp2 patch, which have instructions on their respective webpages.

Check to see if a file exists called /proc/config or /proc/config.gz. If so, copy it into the top directory of the kernel as .config (notice the leading dot). Unless you want to remove all the cruft that gets put in a kernel that has to support as many systems as it can. :D

Either way, now run make menuconfig. If you want to keep the current config, goto Power management -> ACPI support -> load DSDT from initrd and type 'Y'. Keep selecting exit until it asks to save your settings, say yes. Type make. Go watch the grass grow. :thumbsup:

I don't know how Ubuntu likes its kernels installed, since it's a derivative of Debian, and I don't know if it uses "the Debian way" for installing kernels.
 

Steelerz37

Senior member
Feb 15, 2003
693
0
0
well it seems I have got it to work, I am unsure what did it, it could either have been the newest updates, or my video drivers, I unistalled them via Synaptic and changed my xorg.conf to use Driver "nv", one of those seemed to fix it. So i need to reinstall the nvidia drivers and see if i can no longer resume again.

A new problem arose from the updates I think, nothing major, should be an easy fix. It used to be when i closed the lid on the laptop the screen went completely off, now it just does that funky screensaver type screen that it did before when I froze up from a failed suspend attempt, but I can recover from this easily. I tried to change my /etc/acpi/lid.sh script but it didnt help to make it blank, any other ideas?

A problem with the suspend now is that when I come out of resume I lose my "tapping" the touchpad for a click ability. I tried rmmod -f mousedev, which kills the mouse totally, then modprobe mousedev to bring it back, but i dont get my mouse back until I reboot. xorg.conf says my mouse is at /dev/input/mouse. Can I add to the resume script to stop the mouse, then configure it like a fresh reboot somehow?
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Originally posted by: Steelerz37
well it seems I have got it to work, I am unsure what did it, it could either have been the newest updates, or my video drivers, I unistalled them via Synaptic and changed my xorg.conf to use Driver "nv", one of those seemed to fix it. So i need to reinstall the nvidia drivers and see if i can no longer resume again.

You were using the nVidia proprietary drivers before? Now you know why we like open-source drivers too. And getting documentation from hardware companies is like pulling teeth. :(

A new problem arose from the updates I think, nothing major, should be an easy fix. It used to be when i closed the lid on the laptop the screen went completely off, now it just does that funky screensaver type screen that it did before when I froze up from a failed suspend attempt, but I can recover from this easily. I tried to change my /etc/acpi/lid.sh script but it didnt help to make it blank, any other ideas?

(You applied the ACPI fix, right?) ACPI transfers more of the power-saving control to the OS compared to APM, and the previous behavior sounded like typical APM behavior. Attach the contents of that lid.sh file.

A problem with the suspend now is that when I come out of resume I lose my "tapping" the touchpad for a click ability. I tried rmmod -f mousedev, which kills the mouse totally, then modprobe mousedev to bring it back, but i dont get my mouse back until I reboot. xorg.conf says my mouse is at /dev/input/mouse. Can I add to the resume script to stop the mouse, then configure it like a fresh reboot somehow?

How you would script this would depend on how you initiate the suspend. But according to the swsusp2 FAQ, unloading all usb modules prior to suspending should solve those problems. In fact, read the whole FAQ. It could solve a few more minor issues. Yay documentation! :cookie:
 

Steelerz37

Senior member
Feb 15, 2003
693
0
0
******************************************************
lid.sh

#!/bin/sh
# /etc/acpi/lid.sh
# Scales down CPU freq when lid is closed, up when opened.
/etc/acpi/screenblank.sh (I added this line myself)

LID=`grep -c open /proc/acpi/button/lid/LID/state`
if [ $LID -eq 1 ]; then
echo -n "0%0%100%performance" > /proc/cpufreq
else
echo -n "0%0%100%powersave" > /proc/cpufreq
fi

*************************************************************

********************************************************
screenblank.sh

#!/bin/bash

. /etc/default/acpi-support
. /usr/share/acpi-support/power-funcs

getXuser;

. /usr/share/acpi-support/screenblank

*****************************************************


I reinstalled the Nvidia drivers again and suspend didnt work again, so this is my problem :) But when I did install the drivers again it fixed the blanking problem, but when I took them off again, the blanking doesnt work.

I'm not sure which acpi fix your referring to? If its the one where I was recompiling the kernel, I never finished that :( So i didnt get the initrd patch loaded or the swsusp2 patch loaded either. I'll check out that FAQ and see what I can find. Thanks.


Edit:
Hrmm, all of a sudden its not going into suspend at all. When I run the script this is what I get:

sit0: unknown hardware address type 776
sit0: unknown hardware address type 776
Listening on LPF/eth0/00:11:43:6b:53:3c
Sending on LPF/eth0/00:11:43:6b:53:3c
Sending on Socket/fallback
ifdown: interface eth1 not configured
Warning: Interface name is `eth0' at line 2, can't be mapped reliably.
Error: cannot change name of eth0 to eth1: Device or resource busy
Error: cannot change name of eth1 to eth0: File exists
xscreensaver-command: not active: idle timer reset.




 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Eh... I think this is the point where solving the problem in a non- or minimally-kludgy way requires more intimate knowledge of Ubuntu. Have you tried the official Ubuntu forums yet?

Specifically, I think that only the open "nv" driver will work with suspending, while the proprietary driver (Damn You, nVidia!®) won't. The Ubuntu forums people could probably come up with a solution for fixing the other problem that is more integrated with the distro than I would (all Slack, all the time :thumbsup: ).
 

Steelerz37

Senior member
Feb 15, 2003
693
0
0
Yea, I posted in the Ubuntu forums as well but didnt get much of a response, definitly more luck from here. I think what I will do is wait until they release the final Hoary and do a clean install of that, since I should be able to get it back to the state this is in now fairly easily and quickly, then see what still needs to be done. Atleast I found out that that was the problem though. Thanks for all your help :)