DrAmor's Blog

The boring stories written by Juanjo Amor

Return to my $HOME  

Wednesday, October 27, 2004

Ubuntu, a Dell D600, and some ACPI adventures (with kernel lockups)

And, finally, I've my new Dell D600 working (almost) correctly with a Ubuntu Linux Warty distribution. Installing Ubuntu did produce some problems, however the most difficult was ACPI related.

The main problem: with Ubuntu installed you cannot close the LCD, or Linux kernel will hang inmediately. Some other ACPI events was affected with this problem. Of course, others worked ok (power button events, for example), but LCD closing was very important for me.

When I booted standard linux kernel provided with Ubuntu (, by closing the LCD the kernel locks up. Always. It's didn't matter if I booted with "acpi=off" command line. Press your lid button and Linux will hang.

Speaking about this problem with Jesús, he recommended us to use a previous kernel, 2.6.7. So we searched the package for Ubuntu and installed it. The problem, magically fixed. ¿Has 2.6.8.x kernel a bug with these laptops? ¿will 2.6.9 hang in my machine? It is not packaged yet for Ubuntu nor Debian sid, so I'll not test it for now.

Next, it's time to test programming ACPI events. It was easy: I wish to disconnect the screen when closing the display, and suspend to RAM when hitting the Sleep key (Fn+Esc). I've not modified other event behaviors: Power button (it will shutdown cleanly the system) and Battery/AC events (which will put part of hardware, such as harddisk, in energy saving mode).

If you wish to know Power or Battery/AC behaviors, please take a look to acpi-support and laptop-mode Ubuntu packages.

For lid button, I've modified the script /etc/acpi/lid.sh. It also disconnects the backlight of display panel to save energy. For that, I use radeontool 1.5. You can download a Debian package here. The script:


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


grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
. /usr/share/acpi-support/screenblank
echo `fgconsole` > $LIDSTATE
chvt 12
radeontool light off
grep -q off-line /proc/acpi/ac_adapter/*/state
if [ $? = 1 ]
su - $user -c "xscreensaver-command -unthrottle"
radeontool light on
chvt `cat $LIDSTATE`

For sleeping the machine, I've needed to shutdown the network. It is important to avoid problems with tg3 driver (Broadcom Gigabit). It was not neccesary to unload (rmmod) the driver. Also, I shutdown hotplug subsystems to automatically unload any module related with USB interfaces (which Linux cannot suspend). The script:


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


grep -q closed /proc/acpi/button/lid/*/state

/etc/init.d/hotplug stop
/etc/init.d/network stop
echo 3 > /proc/acpi/sleep

# wake up
/etc/init.d/hotplug start
/etc/init.d/network start

Some problem that persist: the Broadcom Gigabit does not wake correctly when powering up the network again. However, if I type ifconfig eth0 up in a shell, the device wakes without problems. I do not know why, but in sleep.sh script I can wake eth0 correctly (however, wireless card, with a much more experimental driver, works better).

Another unresolved issue: battery info key (Fn+F3) stops working when Linux boots (in Grub I can poll the battery). The same problem occurs with CRT/LCD (Fn+F8). However, for switch to CRT I use radeontool again (with dac option). It's command line but not a problem.


At 2:17 AM, Blogger cdr said...

c'est cool ya vraiment de l'idée

c'est repris sur http://www.topcddvd.com

At 12:23 PM, Blogger Dave Dumanis said...

Thanks Dr. Amor! I've had problems with my Dell c640's LCD ever since I installed Ubuntu on it. This is the only thing that worked. I love Ubuntu--and now I don't have to give it up.

At 7:10 PM, Anonymous Dell said...

Thanks a lot for this detailed article

At 9:27 PM, Blogger Alumine said...

buy viagra

generic viagra

viagra online

At 1:51 PM, Anonymous Anonymous said...

The first part of starting any new site is picking the niche you want it to be in hotel marrakech. My biggest criteria for this case study was finding a niche that should be fairly easy to get some traction in rapidleech servers, so I went for something pretty obscure pnr status. I don’t know how much money is here, so I’m taking a chance therescrapebox. But all techniques stay the same adwords coupon.

At 4:51 PM, Blogger John Anderson said...

Nice to be visiting your blog again, Generic Toprol 100mg has been months for me. Well this article that i've been waited for so long. Generic Ultracet need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share


Post a Comment

<< Home