ok, as a follow-up on this i want to explain a bit more in-deph what i did to get this working in maverick.
first: (to avoid any confusion)
Hot switching of the intel vga and the nvidia vga is currently not possible. The reason is that the open source intel i915 driver can't be unloaded once it's running.
This is because it produces nasty memory leaks when rmmoding so the kernel devs "locked" the i915 module once its loaded. This might get fixed in the upcoming 2.6.38 but i havn't checked.
So the only way to switch vga's is to reboot.
If you want to use the nvidia vga there is no special action and acpi_call required. just use current maverick kernel and get the nvidia binary driver as described on the wiki.
The disadvantage is that the nvidia GT218 chip will draw a lot of power and shorten the battery life of your netbook to about 4 hours.
To save enery you can use the acpi_call module and use 2 calls to:
- enable the intel GMA3150 for next boot
- disable the nvidia chip
This method will double the battery life of the netbook. With turned off nvidia chip (and some other power tweaks) my Eee runs for approx 8 hours with normal surfing .
Unfortunately the acpi_call module triggers the kslowd bug in current maverick kernel so i used the kernel from lucid to work around this.
A short howto:
1.) get the kernel image, headers and alsa modules (either the 32bit or amd64 version, depending on your install)
-32 bit
Code:
wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-2.6.32-28_2.6.32-28.55_all.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-2.6.32-28-generic_2.6.32-28.55_i386.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-image-2.6.32-28-generic_2.6.32-28.55_i386.deb
wget https://launchpad.net/~ubuntu-audio-dev/+archive/ppa/+files/linux-alsa-driver-modules-2.6.32-28-generic_2.6.32-28.201101311053_i386.deb
wget https://launchpad.net/~ubuntu-audio-dev/+archive/ppa/+files/linux-headers-alsa-driver-2.6.32-28-generic_2.6.32-28.201101311053_i386.deb
-64 bit
Code:
wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-2.6.32-28_2.6.32-28.55_all.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-2.6.32-28-generic_2.6.32-28.55_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-image-2.6.32-28-generic_2.6.32-28.55_amd64.deb
wget https://launchpad.net/~ubuntu-audio-dev/+archive/ppa/+files/linux-alsa-driver-modules-2.6.32-28-generic_2.6.32-28.201101311053_amd64.deb
wget https://launchpad.net/~ubuntu-audio-dev/+archive/ppa/+files/linux-headers-alsa-driver-2.6.32-28-generic_2.6.32-28.201101311053_amd64.deb
2.) install the deb's
cd into the folder where you downloaded the kernel packages and install them with
3.) reboot in the new kernel, cd in the folder where you saved the acpi_call module and rebuild it for the current kernel:
Code:
cd /path/to/acpi_call
make clean
make
sudo insmod acpi_call.ko
4.) now pass the 2 calls
Code:
sudo -s
echo "\OSGS 0x03" > /proc/acpi/call
echo "\_SB.PCI0.P0P4.DGPU.DOFF" > /proc/acpi/call
5.) check dmesg to see if it was successful
dmesg | grep acpi_call
Code:
[ 532.962061] acpi_call: Module loaded successfully
[ 535.966319] acpi_call: Calling \_SB.PCI0.P0P4.DGPU.DOFF
[ 536.021541] acpi_call: Call successful: 0x0
[ 536.021843] acpi_call: Calling \OSGS
[ 536.024617] acpi_call: Call successful: 0x1
If it worked create a script to preform those steps automatically and configure grub to boot the 2.6.32-28 as default grub-customizer makes this easy)
A very basic script for this would be:
Code:
#!/bin/bash
# Disabe Nvidia Chip and enable intel glx on Asus EeePC 1015pn
# check if we are root, else exit
if [[ $EUID -ne 0 ]]; then
echo "This script needs to be run as root"
exit 1
fi
# is the acpi module loaded?
if lsmod | grep -q acpi_call; then
echo '\_SB.PCI0.P0P4.DGPU.DOFF' > /proc/acpi/call
echo "\OSGS 0x03" > /proc/acpi/call
#set intel xorg.conf
cd /etc/X11
cp xorg.conf.intel xorg.conf
# fiddle with glx and libgl
rm /usr/lib/xorg/extra-modules/libglx.so
# fix: ln -s /usr/lib/xorg/extra-modules/libglx.so.260.19.29 /usr/lib/xorg/extra-modules/libglx.so
update-alternatives --set gl_conf /usr/lib/mesa/ld.so.conf
ldconfig
exit 0
else
cd /path/to/acpi_call
insmod acpi_call.ko
sleep 3
echo '\_SB.PCI0.P0P4.DGPU.DOFF' > /proc/acpi/call
echo "\OSGS 0x03" > /proc/acpi/call
#set intel xorg.conf
cd /etc/X11
cp xorg.conf.intel xorg.conf
# fiddle with glx and libgl
rm /usr/lib/xorg/extra-modules/libglx.so
update-alternatives --set gl_conf /usr/lib/mesa/ld.so.conf
ldconfig
exit 0
fi
edit the line /path/to/acpi_call to reflect the full path on your system. Also note that i have 2 xorg.conf files one for nvidia (named xorg.conf.nvidia) and the other one for intel (named xorg.conf.intel) see attachment... place them in /etc/X11
another script i use that might be useful to you is to check current power consumption. it queries /proc/acpi/battery/BAT0/state and uses notify-osd to display current power usage. if it's around 600-700 mA you've successfully turned off the nvidia chip
Code:
#!/bin/bash
POWER=$(grep rate /proc/acpi/battery/BAT0/state | cut -c 25-32) && REMAINING=$(grep remaining /proc/acpi/battery/BAT0/state | cut -c 25-34) && DISPLAY=:0.0 notify-send -t 6000 -i /usr/share/notify-osd/icons/gnome/scalable/status/notification-gpm-battery-100-charging.svg "Battery Information" "current power rate: $POWER \n remaining capacity: $REMAINING"
i use a keyboard shortcut to run the script with a keypress (use gnome-keybinding-properties for this)
Cheers and Good Luck!
Bookmarks