Linux on an Asus z71v

(Specific information for Ubuntu Hoary 5.04 and Gentoo)

Listed on TuxMobil - Linux on Laptops, Notebooks, PDAs and Mobile Phones

Updates:

2006-05-04:
  • Josh fixed a bug with the asus-acpi - patch. Please update if you have version 2.6.16-v3
  • 2006-04-09:
  • Josh updated his asus-acpi - patch for kernel 2.6.16
  • The new nvidia-driver (1.0-8756) supports Suspend-To-Ram properly again and it officially supports Suspend-To-Disk
  • 2005-12-30:
  • Update to the display-section
  • Josh updated his asus-acpi - patch
  • Info on new problems with Suspend-To-Ram on kernels >=2.6.14
  • 2005-10-17:
  • Finally got the Suspend-modes working on Gentoo
  • Some minor changes and corrections
  • 2005-09-27:
  • Corrected the "temperature readings" section
  • Updated the "LCD/Light Sensor" section
  • TwinView works
  • Josh updated his asus-acpi - patch
  • Some minor changes and corrections
  • 2005-07-08:
  • I've uninstalled Ubuntu and now use Gentoo instead, so I will try to keep updates as general as I can
  • Added Speedstepping information
  • Added a section about temperature readings
  • Added general and gentoo specific information about suspend-to-ram and suspend-to-disk
  • Some minor corrections


  • Introduction

    The Asus Z71V is a Barebone-System and is sold under various names, the ones I know of (from german vendors) are: Wortmann Terra Aura 8300, Centobil 8300 and Cyber System Z71. The last is the one I have, but most components are the same in all Models. As far as I know, it's also mostly identical to the Asus M7V

    There is another great article by Josh Green about Linux on this Laptop so I will refer to it on some occasions. The author of that article also wrote a patch to acpi4asus that enables some features that were unavailable before. Check it out here: http://resonance.org/~josh/laptop.html
    The distributions I used are Ubuntu (5.04) and Gentoo, but I will try to keep this article as generic as possible.

    Overview
    DeviceStatusDriver/ModuleNote
    Pentium M 1600MHzOkspeedstep_centrinoSpeedstep works out of the box, Temperature readings are strange
    GeForce 6600GTOknvidiaRequires binary drivers from NVIDIA for 3D Support (and propably for TV-Out + TwinView). Twinview works.
    LCDOk-Resolution for my SXGA+ Display (1400x1050) was detected correctly. Enabling brightness-adjustment may take some work
    Light SensorOkasus_acpi (patched)Requires some work
    TV-OutNot tested-IF it works, it propably requires the nvidia-driver
    WLANOkipw2200To get WPA, driver has to be updated to a more recent version.
    EthernetOksk98lin or skgeBoth drivers work for me
    ModemNot tested-Propably doesn't work
    SoundOksnd-hda-intelRequires alsa-drivers >=1.09. Mic (intern/extern) is untested, but according to Josh, they work.
    Batterie-IndicationOkacpi, battery, asus_acpi-
    Suspend-to-ramusableacpi, asus_acpiWorks only if X is running.
    Suspend-to-diskusableacpi, asus_acpiTakes a little work (only tested with binary nvidia-driver). Works only if X is running.
    TouchpadOkevdev, psmouse?To make it switchable, extra work is needed
    MMC-/SD-Card ReaderNot tested-SD Cards don't work in Linux at all, MMC Cards might work
    PCMCIAPropably worksyenta_socketI didn't have the chance to test it, but according to Josh's article, it works. See the link above for instructions.
    FirewireNot tested-Should work
    CD/DVD WriterOk-This devices propably varies depending on model. Mine (Toshiba) worked fine out of the box. (Including burning)
    Fn KeysOkacpi, asus_acpiRequires a lot of work

    As you can see, there is a lot of green in the above table and no red so I'd say this is a pretty good Laptop for Linux.


    Instructions

    Speedstep
    Speedstep allows a system to regulate the frequency the cpu works with and thus reduce energy consumption, temperature and noise. It works perfectly in Ubuntu, so you can just leave it as is. Ubuntu uses the userspace-governor in conjunction with the powernow-deamon but the ondemand-governor works too and it doesn't require a daemon.
    In Gentoo, I didn't get any userspace-daemon to work properly and I have no clue why, but ondemand works nicely.
    Linux 2.6.12 adds another governor: conservative. It works similar to ondemand (as in: no additional software needed), but while "ondemand" immediately sets the frequency to maximum when cpu-load is high, "conservative" increases the frequency slowly. Therefore its nicer to the battery, especially when you only got short peaks of cpu usage, but your system might become a bit less responsive.

    Temperature readings
    In the last version of this document, I said here that the temperature readings of this Notebooks are wrong because I couldn't believe temperature would rise so quickly and so high under load. Well, I was wrong. The idiots who put my NB together forgot to remove the plastic foil from the heat sink of my cpu so it really got very very hot. This means the temperature you get with cat /proc/acpi/thermal_zone/THRM/temperature is absolutely correct.
    In case you're interested: The temperature on my NB (after fixing the cooling) ranges between 42°C (idle) and 57°C (heavy load)
    Also, with the current version of nvclock (0.8) you can read the GPU temperature. For some reason, this temperature is 15 higher than in Windows (77°C). Might be the fan is running slower?
    If you know something about that, please contact me. Besides, I'd advice against doing anything with this version of nvclock except reading information as PCI Express-Cards aren't properly supported and you might very well damage something. I tried increasing the fan-speed and instead it seemed to turn off completely.

    Video
    To use the nvidia-module for X, you first need to install the nvidia-kernel and nvidia-glx.
    In Ubuntu, the kernel-module is already preinstalled (its part of linux-restricted-modules), so you just have to do sudo apt-get install nvidia-glx
    In Gentoo, install both with emerge nvidia-kernel nvidia-glx
    Please note, that all recent versions of nvidia-kernel and nvidia-glx are masked, so you might get a very old driver. You can install packages that are not marked stable in gentoo by adding something like this to the file /etc/portage/packages.keywords (create that file if it doesn't exist):
    =media-video/nvidia-glx-1.0.7174-r5 ~x86
    =media-video/nvidia-kernel-1.0.7174 ~x86

    Two more things: a) These drivers have been released by nvidia as stable, so they should work ok.
    b) There is a reason I used the version 1.0.7174 of the packages. It's the only version I got suspend working with. If you don't need suspend (and hibernate), you can get the newest driver.
    EDIT: The newest nvidia-drivers as of 2006-04-06 (1.0.8756) work (at least) as well as 1.0.7174, so it should be safe to use these instead of 7174 from now on.
    Note for all other distributions: As stated in the gentoo-specific section: There seems to be a bug in versions of the nvidia-driver between (but not including) 1.0.7174 and 1.0.8756 that prevents suspendmodes from working with this NB. This affects all distributions I've tested: suspend didn't work correctly in SuSE 10.0, Mandrake 10.1, Knoppix 4.0 and even the new version of Ubuntu (Breezy). If your Distribution uses one of these drivers, you might want to update to at least 1.0.8756. Please also read the Suspend-to-Ram Section for further information.

    After installing the driver edit "/etc/X11/xorg.conf". Go to the Device-Section for the video card and change the Driver from "nv" to "nvidia". You might also want to add Option "NoLogo" "1" to the same section to get rid of the nvidia-logo that would otherwise pop up everytime you start X.
    Next, you should add Option "NvAGP" "0" or Option "NvAGP" "1", because the other options (including the default-value) will load the agpgart-module which isn't only useless with a PCI Express card, it will also prevent Suspend-to-Disk (and maybe Suspend-to-Ram) from working.
    In the "Module" section, comment out the Load "dri"-line. Since this dri-driver doesn't support the nvidia-driver, it can't do any good.
    TwinView works too (using the nvidia-driver) though it's a lot of work to set up (and I won't explain it in detail, there are howtos for that). Just know that, when you have an external monitor plugged in, the attached display becomes the secondary monitor.
    Also, I didn't get framebuffer working out of the box in Ubuntu. For some reason vesafb doesn't seem to initialize at all. To get it to work, I had to use the vesafb-tng patch (http://dev.gentoo.org/~spock/projects/vesafb-tng/), but then the Laptop doesn't properly recover from Suspend-to-ram anymore.

    LCD / Light Sensor
    As mentioned before, I didn't have to configure anything to get my SXGA+-Resolution working, but the Z71V is also sold with WSXGA+- and WXGA-Displays, of which at least the former requires some adjustments to the Modelines. Please refer to Josh's website for that. UPDATE: I've been made aware that SXGA+ doesn't work out of the box after all. It's working for me because I'm loading the DDC-Module with X, which retrieves the modelines directly from the LCD. To use this module, just add Load "ddc" to the "Module"-Section of your /etc/X11/xorg.conf. This will propably also work with WXGA/WSXGA+-Displays. The asus_acpi-Module of recent kernels (2.6.12 and 2.6.13 at least) support changing the display brightness through the file /proc/acpi/asus/brn. Just echo a value between 0 and 15 to it to set the brightness (0 is darkest, 15 is brightest). To get the Light Sensor working, you have to update and patch the kernel, which is a bit complicated, so I will only outline the steps needed. If you don't know how to recompile your kernel, I really advice against doing this. 1. download and install a recent kernel that is supported by the patches (currently those are 2.6.12, 2.6.14 and 2.6.16. Please check out Josh's site for the newest info on this patch). Depending on your distribution, you might want to get a patched kernel for your distribution, but you might then run into problems applying the patch.
    2. download the patch from the page mentioned above (direct link: asus_acpi_M7V-2.6.12-v2.patch)
    asus_acpi_M7V-2.6.14-v3.patch)
    asus_acpi_M7V-2.6.16-v3a.patch)
    3. apply the patch to the new kernel
    4. If you don't want to reconfigure the kernel (or don't know how), you can find the configuration of your current kernel in /boot/config-2.6.10-5-386 (or something like that) for Ubuntu 5.04 or /proc/config.gz in many other distributions. Copy that to your kernel-sources, unpack if required and rename to ".config". Then do a make oldconfig (this will ask you a few questions, default values are usually fine)
    5. compile, make modules_install, copy the kernel to /boot, adjust "/boot/grub/menu.lst" or "/boot/grub/grub.conf" so it can boot the new kernel
    6. reboot.

    After that, the files "lssw" and "lslvl" are available in /proc/acpi/asus. Sending 0 to lssw disables the Light Sensor, anything else enables it, a value between 0 and 15 sent to lslvl changes the Light Sensor Level, though I don't exactly know what that does.
    WARNING: Although this patch works great for me, it should propably be considered experimental and of course neither the original author nor me will take responsibility if something goes wrong on your system. Use at your own risk!

    WLAN
    Ubuntu specific:WLan without encryption works out of the box. I didn't test WEP, but it should work too. To make WPA work, you have to update the ipw2200-driver (including firmware) and install wpa_supplicant (A nice howto for ubuntu can be found at the Ubuntu forum. Please note that wpasupplicant is part of the universe-repository, so you have to enable that first)

    Update: After I installed kernel-2.6.13 I wasn't able to get wpa_supplicant to work with the ipw-driver. Instead, I now use the generic wireless extension. (So instead of calling wpa_supplicant with -Dipw I now call it with -Dwext. Nothing else changed)
    There is something else you might try to do: Get the wlan-led to work.
    (WARNING: The following causes a Kernel Panic for me when I unload the driver, so use at your own risk!) This is easily achived by setting led=1 as a module-parameter ("modprobe ipw2200 led=1").
    Ubuntu specific: To set this parameter automatically at boot time, type echo "options ipw2200 led=1" > /etc/modprobe.d/ipw2200"
    Gentoo specific: To set this parameter automatically at boot time, open /etc/modules.d/ipw2200 and add led=1 to the options-line (or add the line options ipw2200 led=1 if it doesn't exist)

    Sound
    The alsa-driver for this card is snd-hda-intel which is only available in alsa 1.0.9 and up. You can simply download the packages (alsa-driver, alsa-utilities, alsa-oss, alsa-lib) and install them manually: For alsa-driver: ./configure --with-oss=yes --with-cards=hda-intel
    make
    make install

    For the rest:
    ./configure
    make
    make install

    Josh pointed out, that there is a problem with the alsa-device "default" producing crackling and synchronisation problems, which can be fixed by using the "plughw:0" device. I didn't test sound much, but I think he is right. You should be able to achive the same effect by using the alsa configuration-file to use that device. Oh, and while you're at it: Why not set up a dmix (software mixing) so you can play multiple sounds at the same time? Here is the file I'm using:
    pcm.dmixer {
            type dmix
            ipc_key 1025
            ipc_perm 660
            slave {
            	pcm "hw:0"
            }
    }
    
    pcm.!default {
            type plug
            slave.pcm "dmixer"
    }

    Name it "/etc/asound.conf" to set this up for all users or "~/.asoundrc" for the current user only.

    Suspend-to-RAM
    To put your system to sleep, all you have to do is "echo mem > /sys/power/state", but there is a good chance it won't wake up again.
    The reason are modules and daemons that don't suspend properly. You could write a script around that like
    modprobe -r ipw2200
    /etc/init.d/mysql stop
    echo mem > /sys/power/state
    /etc/init.d/mysql start
    modprobe ipw2200

    (in case the ipw2200 module and mysql-daemon are causing trouble. This is an example, I don't think it will work!)
    I believe most current Distributions have way better scripts for that.
    In Ubuntu, these scripts are installed by default. All you have to do is to edit "/etc/default/acpi-suppport" and set ACPI_SLEEP to true to enable suspend-to-ram (other options seemed to only make a difference for Suspend-to-Disk). To activate it, run /etc/acpi/sleep.sh
    In Gentoo, you can emerge "hibernate-script" which does the same. The configuration-file for Suspend-to-Ram is /etc/hibernate/ram.conf, to run it type hibernate-ram
    Debian seems to use the same hibernate scripts. Also note that I commented out nvidia from /etc/hibernate/blacklisted-modules because newer versions of the driver suspend fine, only the old ones (as in 6xxx) had problems there.

    Important: As stated in the Video-section, I have trouble with this (and Suspend-to-Disk) if I don't use the 7174 or 8756-version of the nvidia-packages (Ubuntu Hoary uses 7174, so it's working fine). The problem is, that although the system suspends and wakes up ok, the graphics card doesn't recover properly (screen stays black) if a console was active. With the working driver, I can switch to X and back and the console is ok. (This obviously means X HAS to be running for suspend to work) With all other drivers, I can still switch to X and it works fine, but somehow this seems to mess up the text-mode, so when I switch back to console afterwards, all I see is funny-colored lines and the system often hangs.
    This happens without Framebuffer or with vesafb. Using vesafb-tng, vgafb or nvidiafb, the system doesn't wake up at all
    If your Distribution doesn't provide packages for one of the working versions of the nvidia-driver and you're running into the problem above, you can still install the nvidia-package manually. Get one of the previously mentioned drivers from http://www.nvidia.com and run the file (its a shell-script).
    UPDATE: There is a new problem with STR on kernels >=2.6.14. In this kernel-version, some event-numbers related to Powermanagement have been changed. Because the nvidia-driver still expects the old values, it will cancel suspend with an error-message: "NVRM: ACPI: unsupported event: 2". This bug is documented in this thread:http://www.nvnews.net/vbulletin/showthread.php?t=59214, which includes some solutions, involving either a patch to the kernel or the driver...
    UPDATEThis should be resolved in the newest driver

    Suspend-to-Disk
    To execute a suspend to disk, type "echo disk > /sys/power/state", but as with Suspend-to-Ram, some modules and daemons may act up and keep the system from waking up correctly. Instead, use the appropriate script that comes with your Distribution. In Ubuntu, set SAVE_VBE_STATE, POST_VIDEO and USE_DPMS in "/etc/default/acpi-support" to false and add the line Option "NvAGP" "0" or Option "NvAGP" "1" to "/etc/X11/xorg.conf" in the Device-Section for your video card (the two are basically equivalent because the video card is a PCI-Express Device so it doesn't support AGP anyway, but using a different agp-driver might cause problems) For Gentoo, the same applies as with Suspend-to-ram (see above), except that the config-file for suspend-to-disk is called "/etc/hibernate/hibernate.conf" and the script you run is called hibernate

    Touchpad
    The Touchpad works right away (the xorg-driver-synaptics package is required), but to make it switchable, we have to make some changes to "/etc/X11/xorg.conf". Add Load "synaptics" to the Section "Module" and Option "SHMConfig" "1" to the Section "InputDevice" with Identifier "Synaptics Touchpad". There are further options that can be added to this section to customize the Touchpad. (for a list of parameters, check out /usr/share/doc/xorg-driver-synaptics/README.gz) With SHMConfig enabled, you can set the same options with synclient. To disable the touchpad, use synclient TouchpadOff=1.

    Fn Keys
    The Fn-Key combinations don't produce scancodes as usual keys, so you can't use the usual ways to bind them to actions (like xbindkeys) But if you have the acpi4asus-module loaded and the acpi-daemon running (default in Ubuntu Hoary) they produce acpi-events. This means you can run acpi_listen and see the textual description of the event produced. Now, to bind an action to a key, create a file in /etc/acpi/events with the following content:
    event=(expression)
    action=(action)

    (expression) is a regular expression that matches the text "acpi_listen" produced for the key. For example hotkey.*5d[[:space:]].* matches the event for the wifi-key.
    (action) is a command that should be executed when the key is pressed.
    The following table lists the keys, matching expressions for the events and commands I run for them:
    KeyEventCommand
    Sleepbutton[ /]sleep/etc/acpi/sleep.sh
    WiFi (there are 2 of these, producing the same event)hotkey.*5d[[:space:]].*/etc/acpi/wireless.sh
    Light Sensorhotkey.*7a[[:space:]].*echo $((`cat /proc/acpi/asus/lssw` ^ 1)) > /proc/acpi/asus/lssw
    Brightness-hotkey.*26[[:space:]].*echo $((`cat /proc/acpi/asus/brn`-1)) > /proc/acpi/asus/brn
    Brightness+hotkey.*17[[:space:]].*echo $((`cat /proc/acpi/asus/brn`+1)) > /proc/acpi/asus/brn
    LCDhotkey.*34[[:space:]].*This button does produce a hotkey-event, but it is also hard-wired to turn the LCD very dark
    Displayhotkey.*61[[:space:]].*Nothing yet
    Mutehotkey.*32[[:space:]].*/etc/acpi/mute.sh
    Volume-hotkey.*31[[:space:]].*/etc/acpi/vold.sh
    Volume+hotkey.*30[[:space:]].*/etc/acpi/volu.sh
    Pause/Playhotkey.*45[[:space:]].*/etc/acpi/play.sh
    Stophotkey.*43[[:space:]].*/usr/bin/mpc stop
    Nexthotkey.*41[[:space:]].*/usr/bin/mpc next
    Previoushotkey.*40[[:space:]].*/usr/bin/mpc prev
    Mailhotkey.*50[[:space:]].*/usr/bin/mozilla-thunderbird
    Nethotkey.*51[[:space:]].*/usr/bin/mozilla-firefox
    Touchpadhotkey.*6b[[:space:]].*/etc/acpi/touchpad.sh
    Power4hotkey.*5c[[:space:]].*Nothing yet
    Lidbutton[ /]lid/etc/acpi/sleep.sh

    Instead of creating one file for each event, you could also put one event-file into /etc/acpi/events that catches all events and call another script with the event-description as a parameter, like this:
    event=.*
    action=/etc/acpi/default.sh %e

    In /etc/acpi/default.sh you can then parse the expression (that has been passed as parameter 1) and act accordingly. See Josh's site for an example.

    /etc/acpi/mute.sh

    /usr/bin/amixer set Front toggle
    /usr/bin/amixer set Headphone toggle


    /etc/acpi/vold.sh

    /usr/bin/amixer set Front 1-
    /usr/bin/amixer set Headphone 1-


    /etc/acpi/volu.sh

    /usr/bin/amixer set Front 1+
    /usr/bin/amixer set Headphone 1+


    /etc/acpi/play.sh
    if [ `mpc |grep playing -c` = 1 ]; then
            mpc pause
    else
            mpc play
    fi


    LED
    There is only one LED that is not hardwired or controlled by a driver: The mail-led. If you have acpi4asus loaded, you can easily switch it on with echo "1" > /proc/acpi/asus/mled and off with echo "0" > /proc/acpi/asus/mled You'll have to figure out yourself, how to teach your mail-client to use it. For Mozilla Thunderbird, you can install the "moztraybiff"-Extension which has feature to do just that.

    This concludes my review for this Notebook. As I said: I think its a pretty good NB for Linux, so enjoy!

    If you find an error in this article (I'm sure there are some), want to add something or need help, please send me a mail (english or german only please): sherb@gmx.net