# Inspiron 8x00, ACPI & Nvidia drivers. [edit: They work!]

## Zeddicus

Yeah -- quite a specific setup, I know  :Wink: 

I'm just fishing around...  has anyone gotten power management working on a laptop like this?  I've used APM in the past, but it's flaky at best.  I was able to suspend, but ~50% of the time, it wouldn't resume properly.

So... now I'm eyeing ACPI for my next install (AFTER exams!  :Wink: ).  I've found fixed DSDTs for my laptop/BIOS, and am looking at swsusp.  Anyone know if that will work with the BINARY nvidia drivers?  Also, what is your general experience with ACPI on a laptop like this?  In the past (~2.6.5 was the last time I played with ACPI), I was able to get plenty of info from ACPI, but suspending was hopeless... and the screen wouldn't turn off when I closed the lid!

----------

## planet-admin

 *Zeddicus wrote:*   

> Yeah -- quite a specific setup, I know 
> 
> I'm just fishing around...  has anyone gotten power management working on a laptop like this?  I've used APM in the past, but it's flaky at best.  I was able to suspend, but ~50% of the time, it wouldn't resume properly.
> 
> So... now I'm eyeing ACPI for my next install (AFTER exams! ).  I've found fixed DSDTs for my laptop/BIOS, and am looking at swsusp.  Anyone know if that will work with the BINARY nvidia drivers?  Also, what is your general experience with ACPI on a laptop like this?  In the past (~2.6.5 was the last time I played with ACPI), I was able to get plenty of info from ACPI, but suspending was hopeless... and the screen wouldn't turn off when I closed the lid!

 

On my Inspiron 8600 ACPI works almost flawlessly, screen goes off, power stepping occurs, it works fine when the lid is closed, though I've yet to play with the suspend to disk, and I hear that nvidia w/suspend to disk is still very broken. Fans come on on the machine, batteries are reported correctly, as are temperatures.

(Are you a Goodkind fan?)

Michael

----------

## Zeddicus

 *planet-admin wrote:*   

> I hear that nvidia w/suspend to disk is still very broken. Fans come on on the machine, batteries are reported correctly, as are temperatures.
> 
> (Are you a Goodkind fan?)
> 
> Michael

 

Mmm, guess I'll have to see how my 8200 deals with it.

And yeah, I've been a fan since I found the hardcover Wizard's First Rule on a bargain rack for $5.  :Smile: 

----------

## planet-admin

 *Zeddicus wrote:*   

>  *planet-admin wrote:*   I hear that nvidia w/suspend to disk is still very broken. Fans come on on the machine, batteries are reported correctly, as are temperatures.
> 
> (Are you a Goodkind fan?)
> 
> Michael 
> ...

 

I love the way my 8600 handles ACPI, and all the 8x00 use the same stuff.

I'm sad to see Goodkind ending the series, or at least the storyline of the war with the Order within the next 3 books. His writings are simply....incredible.

Michael

----------

## Zeddicus

Well, I'll be damned -- after a little playing, everything works!

I can suspend/hibernate via Software Suspend2, with the nvidia module loaded!

Okay!  Here's what was needed:

First off, a little info on my setup, just in case it's helpful.  My laptop is a Dell Inspiron 8200 with an Nvidia GeForce4go (32MB) video card.  I have the binary nvidia drivers installed (version 6629-r1), and am running Xorg 6.8.0 and Gentoo-Dev-Sources-2.6.9-r12.

With that out of the way, I first went to http://softwaresuspend.berlios.de/#2.1.5 and grabbed the latest swsusp2 and unpacked it.

Then, to apply the patches: 

```
cd /usr/src/linux

/path/to/software-suspend-2.1-for-2.6.9/apply

```

Then I set the following in my kernel config:

```

Power management options (ACPI, APM)  --->

      [*] Power Management support

      <*> Software Suspend 2 

      <*>    Swap Writer

      --- Page Transformers 

      <*>    LZF image compression

      --- User Interface Options

      <*>   Text mode console support

      --- General Options

     (/dev/hda4)    Default resume device name (where hda4=my swap partition)

     ACPI (Advanced Configuration and Power Interface) Support  --->

                         [*] ACPI Support 

                         [*]   Sleep States (EXPERIMENTAL)

                         <M>   AC Adapter

                         <M>   Battery

                         <M>   Button

                         <M>   Fan

                         <M>   Processor           (May work for you...)

                         <M>     Thermal Zone
```

You'll want to add the modules to /etc/modules.autoload/kernel-2.6 (assuming you compile them as modules, but be aware, on my laptop and BIOS (A10), loading the Processor/Thermal module causes a really high freq sqeal to come from the keyboard.  YMMV, but I don't modprobe it, as I find it REALLY annoying.  :Wink: 

Recompile the kernel, reboot, then.

```
emerge hibernate-script

emerge acpid

rc-update add acpid default
```

You then need to create a /etc/hibernate/hibernate.conf .  There are instructions here: http://softwaresuspend.berlios.de/HOWTO-4.html#ss4.1 , but this is what worked for me:

```
##/etc/hibernate/hibernate.conf

UseSwsusp2 yes

## Powerdown method - 3 for suspend-to-RAM, 4 for ACPI S4 sleep, 5 for poweroff

## 4 is the only one that always works for me, but it works excellently!

PowerdownMethod 4  

UseSysfsPowerState disk

Verbosity 0

LogFile /var/log/hibernate.log

LogVerbosity 1

SaveClock yes

UnloadBlacklistedModules yes

LoadModules auto

GentooModulesAutoload yes
```

Next, edit your grub/lilo.conf and add

```
resume2=swap:/dev/hda4
```

 to your kernel line. (substituting in your swap partition, of course).

At this point, hibernate should be set.  Run 'hibernate' as root, and see what happens.

Only other thing worth mentioning is that under ACPI, the backlight doesn't like shutting off.  You can get around this (in X, at least) by using dpms as described in this thread:  

https://forums.gentoo.org/viewtopic.php?t=101074

(you may also find this one  helpful)https://forums.gentoo.org/viewtopic.php?t=80077

To summarize from those threads, I just had to make my /etc/acpi/default.sh read as follows:

```
#!/bin/sh

# Default acpi script that takes an entry for all actions

set $*

group=${1/\/*/}

action=${1/*\//}

group=${1/\/*/}

 action=${1/*\//}

case "$group" in

        button)

                case "$action" in

                        power)  /sbin/init 0

                                ;;

                        lid)

                                lidstate="`cat /proc/acpi/button/lid/LID/state | awk '{print $2}'`"

                                case "$lidstate" in

                                        open)   /usr/X11R6/bin/xset -display :0.0 dpms force on

#                                               logger "LCD panel is $lidstate" 

                                                ;;

                                        closed) /usr/X11R6/bin/xset -display :0.0 dpms force off

#                                               logger "LCD panel is $lidstate" 

                                                ;;

                                esac

                                ;;

                        *)      logger "ACPI action $action is not defined"

                                ;;

                esac

                ;;

        *)

                logger "ACPI group $group / action $action is not defined"

                ;;

esac
```

And add

```
Option "dpms"
```

To the videocard and screen sections of my xorg.conf. (not sure if both are needed, but... they work.  :Wink: )

I think that's everything, but feel free to let me know if you think I left anything out/have a better way of doing something :-p

A way of turning off the backlight from the console (without X running) would be really nice, too!

----------

## planet-admin

 *Zeddicus wrote:*   

> Well, I'll be damned -- after a little playing, everything works!
> 
> I can suspend/hibernate via Software Suspend2, with the nvidia module loaded!
> 
> [[[ PAGEHOLDER for later explanation of what was needed ]]]

 

Ain't it cool what open source can do?

----------

## tkoster

Bummer, you got me slow close, but not quite there. Everything seems to work fine until the final stage and then the screen goes blotchy and starts spreading white out from the bottom corners. It looks like the nvidia module failed to load.

Here is the hibernate file in case it offers you some clues on how to resolve my problems:

Starting suspend at Sun Jan 9 21:58:52 CST 2005

hibernate: [01] Executing LockFileGet ... 

hibernate: [10] Executing EnsureSwsusp2Capable ... 

hibernate: [10] Executing EnsureSysfsPowerStateCapable ... 

hibernate: [70] Executing ClockSave ... 

hibernate: [89] Executing SaveKernelModprobe ... 

hibernate: [91] Executing ModulesUnloadBlacklist ... 

hibernate: [97] Executing ChangeToSwsuspVT ... 

hibernate: [98] Executing Swsusp2ConfigSet ... 

hibernate: [99] Executing DoSwsusp2 ... 

hibernate: Activating suspend ...

hibernate: [99] Executing DoSysfsPowerStateSuspend ... 

hibernate: Activating sysfs power state disk ...

hibernate: [97] Executing ChangeFromSwsuspVT ... 

hibernate: [91] Executing GentooModulesAutoload ... 

Loading modules listed /etc/modules.autoload.d/kernel-2.6

Loading ndiswrapper

Loading i8k

hibernate: [90] Executing ModulesLoad ... 

hibernate: [89] Executing RestoreKernelModprobe ... 

hibernate: [70] Executing ClockRestore ... 

hibernate: [01] Executing LockFilePut ... 

Resumed at Sun Jan 9 21:59:43 CST 2005

Any clues?

Thanks

----------

## Zeddicus

Are you using NvAGP?  If so, try using agpart.  I compiled it as a module, personally, then set nvagp to "0" in my xorg.conf.

----------

## tkoster

Still getting no where. I had compiled the apgart and nvagp modules right into the kernel initially. Figuring that was my problem, I took them out completely. It didn't help. Then reading your stuff I put them back in as modules. Still no dice. I had the Option set to 0 in the xorg file in every instance.

Each time it hibernated fine, and the resume seems to go well too, until I hit the "cleaning up" stage. That's when the screen began to "bloom", slowly turning from black to white starting in the bottom corners and spreading out. Rather unnerving. So if you have any other ideas, I'd be grateful for them.

----------

## tkoster

Still getting no where. I had compiled the apgart and nvagp modules right into the kernel initially. Figuring that was my problem, I took them out completely. It didn't help. Then reading your stuff I put them back in as modules. Still no dice. I had the Option set to 0 in the xorg file in every instance.

Each time it hibernated fine, and the resume seems to go well too, until I hit the "cleaning up" stage. That's when the screen began to "bloom", slowly turning from black to white starting in the bottom corners and spreading out. Rather unnerving. So if you have any other ideas, I'd be grateful for them. 

One difference I did notice is that I'm still working with BIOS A4, while you said something about using a later BIOS version. Would that make any difference? I would doubt it based on the comments that accompany all of the different versions. None of them seemed to address video issues, but I'm grasping for straws right now.

----------

## Zeddicus

I think the BIOS had some ACPI-related fixes ~A07 or so, might want to upgrade.  Only other things I can think of... how big is your swap/how much RAM do you have?  Also, you're using the same kernel as I am?

----------

## tkoster

I'll have to try the BIOS update then. Do you know if that requires working the DSDT again?

On the other issues. I've been using 2.6.9 vanilla kernel. I have 512 M of ram and double that in swap. I don't think a lack of space is the problem or at least I suspect it would exhibit a different set of symptoms.

----------

## Zeddicus

No manual changing of the DSDT was needed -- I just got the BIOS floppy from Dell and it took care of it.

I'm not sure if Gentoo-Dev-Sources has any ACPI-related fixes, but it may be worth a shot, as that is the kernel that works for me.

----------

## tkoster

I just updated the BIOS. It made no difference. So I guess I'll have to dig deeper into the logs to see what I find. Thanks for your help. You've got me closer than ever.

----------

## tkoster

One more question for you: Did you take nvidia out of the list of blacklisted modules or leave it in?

----------

## tkoster

A few more questions, if you are still listening. As I study the logs in greater detail, it appears that the only modules that are reloading are those in the modules.autoload.d folder. The regular modules don't appear to becoming back at all (unless they typically don't show up in the hibernate log), nvidia being one of them. 

Where does Gentoo typically place the commands to load the modules? 

Where does the hibernate script reload them? 

Right now, my hibernate script has:

### modules

# UnloadModules snd_via82cxxx usb-ohci

# UnloadAllModules yes

UnloadBlacklistedModules yes

LoadModules auto

# LoadModulesFromFile /etc/modules

### modules-gentoo

 GentooModulesAutoload yes

Does that match yours?

Do you have Alsa compiled into your kernel or as a module? 

Do you do anything with networking in the hibernate.conf?

Enough for now.

As always, thanks.

----------

## Zeddicus

This is literally my entire hibernate.conf

```
##/etc/hibernate/hibernate.conf 

 

 UseSwsusp2 yes 

 ## Powerdown method - 3 for suspend-to-RAM, 4 for ACPI S4 sleep, 5 for poweroff 

 ## 4 is the only one that always works for me, but it works excellently! 

 PowerdownMethod 4  

 UseSysfsPowerState disk 

 Verbosity 0 

 LogFile /var/log/hibernate.log 

 LogVerbosity 1 

 SaveClock yes 

 UnloadBlacklistedModules yes 

 LoadModules auto 

 GentooModulesAutoload yes

```

 *Quote:*   

> Do you have Alsa compiled into your kernel or as a module?

 

Modules.

 *Quote:*   

>  Did you take nvidia out of the list of blacklisted modules or leave it in?

 

nvidia is still in the blacklist.

----------

