Debian GNU/Linux on Vaio SR

Motivation

After receiving my Sony Vaio SR11M, I decided to write a full-featured review about the laptop itself and how to install a GNU/Linux distribution on it, configuring every hardware resource, one by one.

This is as important to me as to the rest of the Internet community. Daily, GNU/Linux users buy laptops loaded with technology which cannot be fully used due to the lack of information about how to use a GNU/Linux on that very computer. Indeed, drivers are usually under heavy development and new computers include cutting-edge technology which is not supported at all by the software.

Luckily enough, there exist people willing to help each other and share their experiences with these issues, allowing other people to run GNU/Linux on their computers without major problems. There are a couple of websites which include a list, sortened by manufacturer, of laptops and a link to a review that someone has published before, so that people can follow those reviews and base their GNU/Linux installations and configurations on them. This websites are TuxMobile and Linux-on-Laptops.

Technical Specifications

[1]

Installing Debian GNU/Linux

Debian Installer Overview

Installing Debian GNU/Linux on a computer is no longer tedious nor boring. The guys from Debian GNU/Linux have taken care of the text-driven installation issues and now it is possible to install Debian GNU/Linux using a graphical installer. As a matter of fact, I downloaded the latest Debian GNU/Linux Lenny amd64 ISO, which included the graphical installer both in guided and expert mode.

If you have previously installed any other Debian GNU/Linux distribution, you will notice that the installation process is the typical one (according to the Debian GNU/Linux standards) and that the graphical interface is just an add-on which follows the same simple steps of the normal installation.

Choosing 64bit over 32bit

One thing I have to say is that installing the amd64 version of Debian GNU/Linux is much better than installing the classic i386. This is due to some facts that denote an important improvement in performance when using Debian GNU/Linux on a 64bit system. Here are some of the goodies:

Language and Keyboard

It is interesting to note here that configuring the language and the keyboard layout during the installation will save some time in the future. Please notice that the language has nothing to do with the keyboard layout and the locales.

I selected American English from the languages selection menu and then I configured the Spanish keyboard layout as a personal preference. About the locales, it is important to pick the ones that will give support for the character sets that we will use in the future. For instance, since I lived in Finland and I am spanish, I chose the following ones: en_US.UTF-8, es_ES.UTF-8, fi_FI.UTF-8 and sv_SE.UTF-8.

Network

Since I am a Debian GNU/Linux Sid user (a.k.a. Debian GNU/Linux unstable), I decided to add some network sources to the installation process, so that I could later upgrade to Debian GNU/Linux unstable.

One problem is that the Intel Pro/Wireless 5100AGN does not work (yet), so you will have to connect a working Internet connection through the Ethernet port, so that Debian GNU/Linux can connect to the Internet and do what it has to do. Nevertheless, you may download the full ISO (not the small netinst), which contains many packages, but it is recommendable to configure the Internet during the installation, since Debian GNU/Linux will be able to install the latest security updates and the Internet connection will be further configured for start using it when the installation is finished.

Pre-installed Software

After the installation process, which is fully guided (even in expert mode), the installer will ask you for installing software packages depending on the type of use you want to give to your computer (e.g. desktop, server, and so forth). My personal recommendation is to uncheck every option, so that the installer fetches the fewest possible data. In fact, it is more precise to install, manually, every package we may need using the good-old apt-get command present in all Debian-based distros.

Boot Loader

After the installation process is finished and the selected packages have been installed and configured properly, the Debian GNU/Linux installer will ask for configuring the boot process by installing grub2. There are three alternatives:

The best option is to install grub2 at the beginning of the disk, in the MBR. Fortunately, Debian GNU/Linux Lenny will install the latest version of grub, which is able to display high-definition graphical interfaces and supports for many new features (over the classic grub1). In fact, grub2 seems quite difficult to install manually, so I hardly recommend you to install it from the Debian installer.

First Boot

Once the boot loader has been installed and configured, you will be able to boot your system and log in with any user account you had created during the installation. However, for now, I suggest you to log in as root, since we need to configure a lot of stuff before the end of this document. Good luck!

Configuring and Tuning Hardware

Before using our Vaio SR11M, it is important to configure all the hardware. Although Debian GNU/Linux Lenny provides a kernel up to version 2.6.26, many hardware components are still not recognized by the system, and so we will have to wait for several kernel versions to come in order to have all the devices working properly. However, we can already see some basic stuff by running certain commands. I strongly recommend to write down a list of all devices and all the information provided in the following sections, so that we can easily recognize which drivers we will need for making it work properly.

List of Devices

Here is the output of the lspci command:

00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03)
00:1c.3 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.3 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation ICH9M/M-E SATA AHCI Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
01:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8040 PCI-E Fast Ethernet Controller (rev 12)
04:00.0 Network controller: Intel Corporation Wireless WiFi Link 5100
06:03.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
06:03.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
06:03.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)

Before reading the following table, it is useful to check the kernel version we are using and the kernel version present in this paper. Due to the fast development in the Linux kernel tree, drivers may be included and improved in only several days. So please make sure that you kernel version matches the kernel version presented below, or that it is even on a higher version (never lower).

This is the Linux compatibility as of: Linux 2.6.30

Device Functionality Comments
Intel P8400 processor It works Out of the box
X-Black LCD Display It works Out of the box
Intel X4500 Graphics It works Out of the box (from version 2.6.2 of xf86-intel driver)
High-Definition Audio It works Out of the box
SysKonnect Gigabit Ethernet It works Out of the box
Intel ProWireless 5100AGN It works Out of the box
BCM204x Bluetooth Adapter It works Out of the box
Serial-ATA Hard-Drive It works Out of the box
Sony Dual-Layer DVD It works Out of the box
Firewire (Sony iLink) It works Out of the box
ExpressCard Expansion Slot Not tested No time nor hardware to test it yet
Memory Card Reader It works, partially MMC/SD works, MemoryStick experimental
Motion Eye Webcam It works Out of the box
Suspend to RAM It works Out of the box
Suspend to Disk It works Out of the box
Sony Hotkeys It works Out of the box

Processor

The processor of the Sony Vaio SR11M is an Intel Centrino 2 (Core 2 Duo) P8400, with 3MB of L2 cache, running at 2.267GHz. It provides a bus speed of 1066MHz, and it is manufactured using 45nm technology. Its maximum consumption power is stated at 25W (Thermal Design Power), and it functions at 1.25V at its maximum. [2]

To use this processor properly on Debian GNU/Linux-amd64, we'll need the following options on the kernel configuration:

CONFIG_EXPERIMENTAL=y
CONFIG_SMP=y
CONFIG_X86_PC=y
CONFIG_MCORE2=y
CONFIG_SCHED_MC=y
CONFIG_PM=y
CONFIG_SUSPEND=y
CONFIG_HIBERNATION=y
CONFIG_ACPI=y
CONFIG_ACPI_SYSFS=y
CONFIG_ACPI_PROC_EVENT=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=y
CONFIG_ACPI_FAN=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_THERMAL=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_CPU_IDLE=y

With these options, the new kernel should detect the proper CPU and there should be full 64-bit support with powersave properties, thermal control, automatic CPU frequency scaling (on-demand), multi-core support and both suspend-to-RAM and suspend-to-disk support.

At a glance, the P8400 processor (included in the Vaio SR11M) stands up to 105 celsius degrees, although it normally performs hard work staying at 40 degrees. Moreover, the frequency scaling driver in the kernel provides three different scaling frequencies: 2.26GHz, 1.6GHz and 800MHz. Further, two cores are detected (Core 2 Duo, Penryn) and both work independently and Linux will switch off a core if it is not in use.

It is also important to denote that the processor cannot get higher than 64 celsius degrees when running any burning test such as sprime. Also, note that the fan has automatic hardware-based velocity regulation and it is never turned off when the AC is online. However, when running on battery power, the fan is automatically switched off when not needed.

Display

The display is a superbright X-Black LCD (LVDS output) with LED technology, which trully enhances the quality of the image and it is visible from any angle of view. The screen supports up to WXGA resolution (1280x800 pixels) with a color depth of 24 bits (16 million colors).

In order to be able to adjust the brightness of the display, you have to make sure that your kernel includes the following options:

CONFIG_MISC_DEVICES=y
CONFIG_SONY_LAPTOP=y
CONFIG_SONYPI_COMPAT=y

After including these settings in the kernel, the display will be configurable through the /sys interface, where information can be read or set.

Graphics Card

The graphics card included in this laptop is the Intel X4500HD (Intel GM45 Express chipset), which supports up to 384MBytes of video memory (mapped on the actual RAM). This chip supports vertex shader model 4.0, up to 12.8GB/s transfer speeds, OpenGL 2.0 and video decoding hardware acceleration. [3]

In order to get the framebuffer working at 1280x800@24, you will need the following kernel options:

CONFIG_FB=y
CONFIG_FB_VESA=y

Then, in your /boot/grub/grub.conf or in your /etc/lilo.conf, you will have to pass to the kernel boot line the following option: vga=866. With that option, the kernel will boot with a framebuffer of 1280x800 at 24bit of color.

As for the X Intel driver, there is not much to say. This laptop starts to work nicely from the version 2.6.2 of the Intel driver, which includes a critical fix for the LVDS and includes support for GEM and kernel mode-setting (KMS). The xorg.conf should not include much information, since the Intel driver is totally configured automatically.

Audio

The audio card is an Intel High-Definition, as found in many other laptops, with a controller chip by Realtek (the model ALC262, more concretely). In order to have proper support for the audio, we have to enable the following options in our kernel configuration:

CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_SEQUENCER=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_PCI=y
CONFIG_SND_HDA_INTEL=y
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=10

Please note that you have to install several applications in order to be able to configure the settings for the audio. Hence, install, at least, the following packages:

user@host:~$ sudo apt-get install alsa-base alsa-oss alsa-utils libasound2-plugins

Overall, the audio quality is quite good and the values of the mixer are highly configurable. In fact, the quality of the built-in speakers is somewhat good, and the strength of the amplifier is not bad at all.

Furthermore, in the Vaio SR11M there is support for Virtual Surround 5.1, which is enabled by creating the file ~/.asoundrc and adding the following lines: [4]

# ALSA Configuration file
pcm.!surround51 {
    type vdownmix
    slave.pcm "default"
}

pcm.!surround40 {
    type vdownmix
    slave.pcm "default"
}

Ethernet

The ethernet card included in the SR11M is a SysKonnect, which uses the PCI Express bus. The card is supposed to be limited to 100MB/s (FastEthernet), however the kernel driver is the sky2, which tells that the card is able to use up to 1Gigabit ethernet networks. These are the following options for the kernel configuration to enable the ethernet card:

CONFIG_NETDEVICES=y
CONFIG_NETDEV_1000=y
CONFIG_SKY2=y

Finally, I have to say that I tested it once with another Gigabit Ethernet computer, but the cable didn't give more than 100Mbps, so I guess the hardware is probably limited. When I make further tests, I will publish here the results. Otherwise, the ethernet card works properly, with no problems at all.

Wireless

The wireless card is the Intel 5100AGN (included in Intel Centrino 2 chipsets). This device is supported from 2.6.27 onwards. Here are the following options for the kernel configuration:

CONFIG_NET=y
CONFIG_WIRELESS=y
CONFIG_CFG80211=y
CONFIG_NL80211=y
CONFIG_WIRELESS_EXT=y
CONFIG_MAC80211=y
CONFIG_MAC80211_LEDS=y
CONFIG_RFKILL=y
CONFIG_RFKILL_INPUT=y
CONFIG_NETDEVICES=y
CONFIG_WLAN_80211=y
CONFIG_IWLCORE=y
CONFIG_IWLWIFI_RFKILL=y
CONFIG_IWLAGN=y
CONFIG_IWLAGN_LEDS=y
CONFIG_IWL5000=y

After selecting these options, the kernel will recognize the wireless card and it will work properly. However, please notice that, before configuring the device with the iwconfig command, the interface has to be brought up using ifconfig wlan0 up.

In fact, any change of mode with the iwconfig command (such as managed, ad-hoc or monitor) has to be done by bringing down the interface (ifconfig wlan0 down) and bringing it up back again (ifconfig wlan0 up). Otherwise, if you try to change the mode on the fly (iwconfig wlan0 mode XXX), the driver will give an error.

Another important step is to download the proper firmware for the device. Otherwise, the kernel will recognize but will be impossible to use. For that, you need to find the file iwlwifi-5000-1.ucode, which contains the corresponding firmware. The firmware can be found fom here.

One problem in the SR11M is that the Wireless cannot be switched ON and OFF independently from the Bluetooth. There is a switch labeled "Wireless" in the front of the laptop and it turns both devices ON or OFF at the same time. The drawback is that the Bluetooth module consumes a lot of resources, and if we are not using it, we still have to let it run, if we are using the wireless card.

Bluetooth

The bluetooth chip is a BCM2046, which uses the USB bus and works with the BCM203x kernel driver. Here are the options for the kernel configuration to make the Bluetooth work under Linux:

CONFIG_NET=y
CONFIG_BT=y
CONFIG_BT_L2CAP=y
CONFIG_BT_SCO=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y
CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIBCM203X=y
CONFIG_BT_HCIVHCI=y

Once these options are included in the kernel, the bluetooth device will appear as an USB device and it will be usable. In order to use it, you will have to install some bluetooth packages on your Debian GNU/Linux system. Here is my recommendation:

user@host:~$ sudo apt-get install bluetooth bluez-utils

If you use GNOME, then you may want to install the following packages: gnome-bluetooth and bluez-gnome. If you use KDE, then you may want to install kdebluetooth.

The Bluetooth can be switched ON and OFF using the "Wireless" switch on the front of the SR11M. However, the flaw is that switching ON and OFF switches also the status of the wireless card, which is somewhat inconvinient. If you want to use the bluetooth but not the wireless, there is a software fix you may want to try:

user@host:~$ sudo echo "1" > /sys/class/net/wlan0/device/rfkill/rfkill0/state

Hard Drive

The hard disk is a Fujitsu MHY2250BH, with 250GB of capacity, spinning at 5400rpm. The disk is uses a serial-ATA interface and provides a buffer size of 8192kB (according to hdparm). The options in the Linux kernel to use the Serial-ATA interface are the following:

CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_SCAN_ASYNC=y
CONFIG_ATA=y
CONFIG_ATA_ACPI=y
CONFIG_SATA_AHCI=y

The hard drive is really quiet and it works quite nicely. Nevertheless, the transfers are not at their best, since they don't reach the 60MB/s. Two important programs for monitoring and configuring the hard disk in GNU/Linux are hdparm and hddtemp. Here are some results from hdparm:

user@host:~$ sudo hdparm -tT /dev/sda

/dev/sda:
Timing cached reads: 3720 MB in 2.00 seconds = 1911.70 MB/sec
Timing buffered disk reads: 150 MB in 3.02 seconds = 56.68 MB/sec

One thing to notice is the fact that the hard disk doesn't get higher than 42 celsius degrees even on full loads for many hours. Finally, here you are the full information details from hdparm about the hard disk:

user@host:~$ sudo hdparm -i /dev/sda

/dev/sda: Model=FUJITSU MHY2250BH, FwRev=0000000B, SerialNo=K41LT862GS3M
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=?16?
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=488397168
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
AdvancedPM=yes: mode=0x80 (128) WriteCache=enabled
Drive conforms to: unknown: ATA/ATAPI-3,4,5,6,7

* signifies the current active mode

Trick: In order to maximize the capacity of the hard disk, it is possible to manually specify the amount of data read at once when the header is fetching information. This property is called readahead and it can be set in /etc/hdparm.conf, so that it is set at every boot:

/dev/sda {
    read_ahead_sect = 2048
    spindown_time = 6
}

The spindown_time is a factor of 5 that tells hdparm when to put the disk to sleep. In this case, 6 means that the disk will be put to sleep after 30 (5x6) seconds of no usage.

Dual-Layer DVD

The dual-layer DVD is a tray-kind DVD whose vendor is Sony. The model is an Optiarc DVD RW AD-79105S. It is a normal drive that supports multisession burning, UDF and other common features. The following programs are basic for recording CDs and DVDs under GNU/Linux:

user@host:~$ sudo apt-get install wodim genisoimage dvd+rw-tools

In order to watch DVDs on Debian GNU/Linux, you will need the following lines on your /etc/apt/sources.list:

# Multimedia
deb http://www.debian-multimedia.org unstable main
deb-src http://www.debian-multimedia.org unstable main

After saving that file with the new lines, do the following operation:

user@host:~$ sudo apt-get update
user@host:~$ sudo apt-get dist-upgrade
user@host:~$ sudo apt-get install libdvdread3 libdvdcss2

For watching DVDs, I strongly recommend either mplayer or totem. The latest is integrated in GNOME, but mplayer can be installed without GUI, which is quite useful for keyboard users.

For burning CDs and DVDs from a graphical environment, there are three nice programs, depending on the type of desktop you are using: k3b (for KDE users), serpentine and brasero (for GNOME users) and xfburn (for XFCE users).

FireWire

The firewire controller is a Ricoh R5C822, and the port is a Sony iLink (S400), which is typically called mini-Firewire. Due to time constraints, I haven't had time to test it properly yet, but the device is fully recognized when enabling the IEEE 1394 (FireWire) stack on the kernel.

More information to follow...

ExpressCard Slot

Due to time constraints and the lack of specific hardware, I haven't tested yet this device, but I have read on the Internet that it works for sure. I will post details about how to set it up and use it as soon as I have some time.

Memory Card Reader

The Vaio SR11M ships with two memory card readers: a MMC/SD reader and a MemoryStick reader. On GNU/Linux, only the MMC/SD reader works by now, whereas the MemoryStick reader is partially supported by an experimental driver, but my tests confirm that it doesn't work, at least with the SR11M yet. Here are the kernel options to support these devices:

CONFIG_MMC=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PCI=y
CONFIG_MMC_RIOCH_MMC=y
CONFIG_MEMSTICK=y
CONFIG_MSPRO_BLOCK=y
CONFIG_MEMSTICK_TIFM_MS=y

When the memory card is inserted, hal detects it and it can be mounted automatically, typically using an integrated desktop environment, such as XFCE, GNOME or KDE.

Motion Eye Webcam

The webcam included in the SR11M is a Motion Eye with 1.3Mpixels resolution (1280x1024). It is a nice camera, quite elegant, and it works out of the box on GNU/Linux. In order to make it work, you don't need any rare driver, but you only have to enable a couple of options in the Linux kernel:

CONFIG_VIDEO_DEV=y
CONFIG_VIDEO_V4L1_COMPAT=y
CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
CONFIG_V4L_USB_DRIVERS=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y

In order to use the webcam, you will need some software able to communicate with other users or generate pictures and videos from your webcam. I just used cheese, a program included in GNOME 2.22 which allows you to record videos and take snapshots. It works perfectly with the SR11M.

NOTE: Skype doesn't work yet, since it is compiled for ia32 and the binary emulation doesn't support the video feature.

Suspend to RAM

Suspend to RAM works out of the box, both from the console and from the X-Window system. In order to put the computer to sleep, we need the following options in the kernel:

CONFIG_PM=y
CONFIG_SUSPEND=y
CONFIG_ACPI=y
CONFIG_ACPI_SYSFS=y
CONFIG_ACPI_PROC_EVENT=y
CONFIG_ACPI_BUTTON=y

After setting these options and booting the new kernel, it is possible to perform the following operation to sleep the computer:

user@host:~$ sudo echo "mem" > /sys/power/state

However, you probably want to automatize your SR11M so that it goes to sleep when the LID is closed. Therefore, you have to do the following: first, install the acpid package; then, create the file /etc/acpi/events/lid and put the following contents:

event=button/lid.*
action=/etc/acpi/actions/lid.sh "%e"

Now we will create the file /etc/acpi/actions/lid.sh and we will give execution rights to it: sudo chmod +x /etc/acpi/actions/lid.sh. The, you may do whatever you want in your script, but this is my simple example:

#!/bin/sh

# Easy way to send the laptop to sleep
echo "mem" > /sys/power/state

Please notice that you may perform any operation when the LID is closed, but for this article, it is enough to send "mem" to /sys/power/state, in order to put the laptop in sleep mode.

Suspend to Disk

Suspend to disk also works out of the box. When putting the laptop into suspend to disk mode, you will need as much swap as RAM memory, since the whole memory is written as an image in the swap partition. For instance, I have 4GB of RAM, so I created a swap partition with 4GB, so that the suspend to disk can be performed properly. In the kernel, you will need the following options:

CONFIG_PM=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION=/dev/sda2

/dev/sda2 should be changed by the device of your swap partition. Also, in the kernel, at boot time, an option must be passed so that the kernel resumes from the swap, instead of booting a fresh system. The option is the following: resume=/dev/sda2, where sda2 has to be changed for the name of your swap partition (the one you set up as the default one in the kernel configuration).

Finally, in order to suspend the whole system into the disk, you have to write the word "disk" into /sys/power/state. This operation will write the whole system in your swap partition and shut down the computer. The next time you boot, the system will appear as you left it the last time, including games, graphics, audio, network, etcetera.

Sony Hotkeys

The SR11M has several hotkeys in the frontal panel, such as "mode", "setting" and four more keys for personal customization. These keys work out of the box from the kernel 2.6.30 onwards, and they are all recognized under the Xorg.

Further Configuration

Besides the typicall hardware review and its configuration, I actually would like to talk about miscellaneous configuration steps that are more or less mandatory for every laptop user in daily life. So check out the following sections for specific configurations on your Vaio SR11M.

Touchpad in Xorg

The SR11M's touchpad works out of the box, as it should be. However, you have to set several options in the kernel for ensuring the functionality is proper:

CONFIG_INPUT=y
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=y

First, in order to let the USB mouse and the touchpad cohexist along with the Xorg server, you have to install the following packages:

user@host:~$ sudo apt-get install xserver-xorg-input-mouse xserver-xorg-input-synaptics

NOTE: If you want to disable the touchpad when connecting the USB mouse, then you have to compile the MOUSE_PS2 driver in the kernel as a module. Having it as a module, you can write a rule in your /etc/udev/ that unloads and loads the module according to the status of the external USB mouse (unload when attach an external mouse and load when disconnecting it). So far, I haven't tried this solution yet, since I sometimes use both of them.

Power-saving Settings

The power-saving settings are important not only because they just make your laptop to consume less power but because, due to less consume, your laptop doesn't get as hot as when using performance settings. This may extend the life of your laptop for even several extra months, which is to be appreciated nowadays.

For checking the power consumption and which power settings may be enabled, you have to install the useful tool from Intel, powertop:

user@host:~$ sudo apt-get install powertop

After you install it, you will have to run it as root or using sudo. It will collect the data every certain time interval and tell you which options you should enable in your kernel and which settings you should apply in your /etc and /sys files. For the SR11M, here is a list of things you can do:

First, modify the /etc/fstab file and append the option noatime to your system partitions. All the data partitions should have this option, which reduces the number of write cycles on the hard drive. For instance, I have:

/dev/sda1 / ext3 noatime,errors=remount-ro 0 1

Second, you should delay hard disk writes as much as possible, so all the information will be retained in the main memory for the longest time possible. This can be done by adding the following lines to your /etc/sysctl.conf:

# Power saving
vm.laptop_mode = 5
vm.dirty_expire_centisecs = 60000
vm.dirty_writeback_centisecs = 60000
vm.dirty_ratio = 60
vm.dirty_background_ratio = 1
vm.swappiness = 10

Then, it is also interesting to disable all the logging functionalities that we don't use. On Unix systems, daemons are running listening to events that happen all the time and these daemons generate detailed reports, typically on /var/log, which leads to many writes to the hard disk. These can be avoided modifying the file /etc/syslog.conf and sending every type of log to /dev/null. For instance, I have disabled the following logs (but you may disable all of them if you want):

auth,authpriv.* /dev/null
*.*;auth,authpriv.none -/dev/null

Furthermore, there exists many files that can be tunned, where kernel information is stored. The kernel usually reads the /sys directory checking for configuration values. Here are some of the commands that highly improve your SR11M's battery life:

echo "1" > /sys/module/usbcore/parameters/autosuspend

echo "800000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

hal-disable-polling --device /dev/cdrom

echo "min_power" > /sys/class/scsi_host/host0/link_power_management_policy
echo "min_power" > /sys/class/scsi_host/host1/link_power_management_policy
echo "min_power" > /sys/class/scsi_host/host2/link_power_management_policy
echo "min_power" > /sys/class/scsi_host/host3/link_power_management_policy

Another thing is the Wifi. In GNU/Linux it is possible to tell the wireless card to use different power profiles, using the iwpriv wlan0 get_power and iwpriv wlan0 set_power commands. However, since the Intel ProWireless 5100AGN is not very well supported yet on Linux, we will have to wait some time for that to come, it doesn't work yet.

Finally, I strongly encourage you to synthetize all these saving settings in two scripts, one for high performance (when the AC is connected) and another one for low consume (when the laptop is battery powered). I have a script, at boot time (/etc/rc.local) that checks whether the laptop is running on battery or on AC power, and depending on the result, it will call the high-performance settings script or the low-consumption settings power script. Take a look:


/etc/rc.local:

#!/bin/sh
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# create minimalist environment
mkdir /tmp/mysys
amixer get Master | tail -1 | awk '{ print $4 }' > /tmp/mysys/volume
muted=`amixer get Master | tail -1 | awk '{print $7}' | grep off`
if [ "$muted" = "" ]; then
    echo -n "0" > /tmp/mysys/mute
else
    echo -n "1" > /tmp/mysys/mute
fi
ln -s /sys/class/backlight/acpi_video0/brightness /tmp/mysys/brightness
chmod -R a+rw /tmp/mysys

# brightness
if [ -f "/sys/class/backlight/acpi_video0/brightness" ]; then
    chmod a+rw /sys/class/backlight/acpi_video0/brightness
fi

# CD-ROM polling disable
#hal-disable-polling --device /dev/scd0 >/dev/null 2>/dev/null

# USB autosuspend
echo "1" > /sys/module/usbcore/parameters/autosuspend
for i in /sys/bus/usb/devices/*/power/autosuspend; do
    echo -n "1" > $i;
done

# suspend allowed to every user
chmod a+w /sys/power/state

# speed-up KDE4 for claudio user
sleep 8 && su claudio /home/claudio/bin/desktop_speedup.sh &

# battery care
ac=`acpi -a | grep "on-line"`
if [ "$ac" = "" ]; then
    # if running on battery, enable powersave settings
    /usr/local/bin/gbl --no-gui min
    /usr/local/bin/lowper
else
    # if running on AC, enable performance profile
    /usr/local/bin/gbl --no-gui max
    /usr/local/bin/highper
fi


/usr/local/bin/highper:

#!/bin/sh


# global settings (spindown is in seconds)
disk="/dev/sda"
spindown="300"
spindown=`expr $spindown / 5`


# main program
echo -n "Enabling high-performance settings: "


# SATA minimum power profile select
echo "max_performance" > /sys/class/scsi_host/host0/link_power_management_policy
echo "max_performance" > /sys/class/scsi_host/host1/link_power_management_policy
echo "max_performance" > /sys/class/scsi_host/host2/link_power_management_policy
echo "max_performance" > /sys/class/scsi_host/host3/link_power_management_policy


# hard disk advanced power management (performance)
hdparm -S $spindown -B 255 $disk >/dev/null 2>/dev/null



# EOF
echo "done."


/usr/local/bin/lowper:

#!/bin/sh


# global settings (spindown is in seconds)
disk="/dev/sda"
spindown="30"
spindown=`expr $spindown / 5`



# main program
echo -n "Enabling powersave settings: "


# SATA minimum power profile select
echo "min_power" > /sys/class/scsi_host/host0/link_power_management_policy
echo "min_power" > /sys/class/scsi_host/host1/link_power_management_policy
echo "min_power" > /sys/class/scsi_host/host2/link_power_management_policy
echo "min_power" > /sys/class/scsi_host/host3/link_power_management_policy


# hard disk advanced power management (aggressive saving)
hdparm -S $spindown -B 1 $disk >/dev/null 2>/dev/null



# EOF
echo "done."

One thing I forgot to mention is that you may want to put your hard disk to sleep every now and then. This power-saving settings for sleeping the hard disk are visited in the section Hard Drive.

NOTE: Although powertop keeps saying that you should append usbcore.autosuspend=1 to your kernel line in the boot loader, it won't work. I added it and it does not work, I don't know yet why, but I will research and post here the results.

Overall Impressions

I guess it is time to assest the SR11M overall. First and foremost, it is mandatory to say that the Vaio SR11M is one of the best laptops I have ever had on my hands. It is a low-end laptop, meaning that it doesn't have HDMI or Blue-Ray, but it is built with high-quality materials and the chipsets are quite powerful (while not drawing almost any current).

As about GNU/Linux, it is the neverending story. We all know that buying a brand new laptop (with brand new hardware) and trying to run a GNU/Linux with no problems is almost impossible. I don't blame anybody. Even more, I actually thank all the people behind the Linux project and the GNU software, since they, more or less, work for free, deploying high-quality software without wanting anything in exchange (just recognition).

As a final word, I want to encourage people willing to spend about 1300€ in a laptop to buy the SR11M, since it is a joy to use it with GNU/Linux and therefore with Debian GNU/Linux.

Disclaimer

This document does not guarantee that any Sony Vaio VGN-SR11M will work with GNU/Linux nor with Debian GNU/Linux, and it does not tell a definitively right information about anything. This document gives an overview of a laptop working on an operating system for a certain user (me), and that doesn't mean that it should work for the rest of the people.

Modifying the kernel configuration or installing any program listed during this paper is totally left to your own responsability and at your own risk. I am not responsible for any loss or damage you may cause to your laptop or system by following the instructions on this document.

I hope you really enjoyed the document and that it was useful to certain extent. For more information or further questions, please feel free to contact me.

References

SR Series [online]. Sony Electronics, Inc. 2008.
URL: http://www.sonystyle.com
Accessed 29th August 2008

Intel Core 2 Duo Mobile Processor P8440 [online]. Intel Corporation.
URL: http://processorfinder.intel.com/details.aspx?sSpec=SLB3R
Accessed 30th August 2008

Intel GMA [online]. Wikipedia.
URL: http://en.wikipedia.org/wiki/Intel_GMA
Accessed 4th September 2008

Make it Surround [online]. Ubuntu On Sony Vaio FW Series.
URL: http://vaioubuntu.wordpress.com/2008/09/15/make-it-surround/
Accessed 4th September 2008

Updated on Thursday, 20 August 2009 14:24

[ Valid XHTML | Valid CSS ]

Copyright 2005-2009 Claudio M. Camacho