Sony

Installing Slackware Linux on a Sony Vaio TZ21MN

Posted August 21st, 2008 by Maarten

Since I needed to have my Vaio prepped for use fast, I first installed Kubuntu on it, with which it functioned reasonably well. Now that I have had some more time to figure things out I equipped it with my favourite Linux distribution, Slackware (version 12.1). Because of the choices I make for the installation, the software selections and versions are quite specific. Therefore I will write this guide step by step. In case you want to use other versions of the software (kernel version for instance), you can still use this guide as a reference.


My Sony Vaio.


Basic installation

I kept one 100 megabyte NTFS partition at the start of the hard disk for use of the Instant On software. Read more about this in the Kubuntu guide. The second partition is a Linux swap partition, not specifically because I need swap memory, but for use during the machine's hibernation. I used cfdisk to create a partition of approximately 1050 megabytes for it to be very slightly larger than the total of present memory. Double it if you have 2048 megabytes of RAM. Next I created a system partition of about eight gigabytes of space, and the rest, more than 90 gigabytes, I used to create the /home partition. I installed almost all software including KDE and its translations, since this is my favourite graphical desktop.
Back to contents


Audio

To be able to configure audio and mount storage devices as a regular user, add your user account to the groups audio, plugdev and cdrom. The latter two have nothing to do with audio, but will enable you to use removable media properly. You need to log out and in again to apply the changes. A very convenient way to do this is by using kuser. Start kmix or alsamixer to lower your notebook's volume settings, because the KDE startup sound can be quite loud. Execute alsactl store as root to store the mixer settings.

Edit /etc/modprobe.d/sound as root and append options snd-hda-intel model=hippo. An easy way of editing configuration files in Slackware in a terminal is by using jed, but beware of the backup files it creates. By adding this line to this file which loads your sound module, the correct or at least properly working sound card model will be selected. It will prevent you from having to plug in and out headphones to enable sound from the speakers, as is the case with the default configuration. After having made this change you could reset your mixer settings and you will have to execute alsactl store again to save them. Remove the /etc/asound.state file if you get any errors about non existing mixer settings during startup.
Back to contents


ACPI

Branded Slackware.To enable support for hibernation and CPU frequency scaling (lowering the processor clock rate to save power) you will have to compile a new kernel. I have included a kernel configuration file for the default Slackware 12.1 kernel in case you want to see which options need to be enabled. In it I have selected the correct processor and CPU frequency settings, but have not yet enabled support for hibernation, because you should enter your default resume partition. On all accounts be sure to enable the "ACPI Processor P-States driver" option to enable frequency scaling.

Hibernate
Once your modified kernel is running you will be able to activate hibernation by executing echo disk > /sys/power/state as root. Chmod this file 646 (possibly automatically at boot time) to do the same as a regular user. I added an entry to the KDE menu and bound it to a key combination to enable hibernation by pressing certain keys. The shell script below which is then executed works well for me. The sleep intervals are needed to prevent the notebook from entering sleep mode right after having woken up. The dcop command starts the KDE screensaver right before the notebook starts saving its memory to disk, so after starting up again it will be password protected. After having stored the memory on the swap partition and having shut down in about 30 seconds, the machine can revert to a fully operational state again in about 45 seconds.


#!/bin/sh
if [ ! -e ~/.sleepenabled ]; then
touch ~/.sleepenabled
dcop kdesktop KScreensaverIface lock
sleep 2
echo disk > /sys/power/state
sleep 2
rm ~/.sleepenabled
fi

Back to contents


Wireless network

Because I have a negative experience using the iwlwifi drivers (non-working WPA support at school), I installed the ipw3945 drivers, which in turn require a kernel version earlier than the 2.6.24 kernel (I am currently using 2.6.23.17). Installing this driver requires following these steps:

  • Compile and install the ieee80211 subsystem. I used the default options (aka pressing the enter key a couple of times).
  • Compile and install the IPW driver. I had to use the IEEE80211_IGNORE_DUPLICATE=y option to make it compile, probably because I installed ieee80211 manually.
  • Copy the regulatory daemon to /sbin.
  • Make /etc/rc.d/rc.M execute /sbin/ipw3945d by adding a line near the network initialisation (the starting of rc.inet1). This way the daemon will be started at boot.
  • Copy the microcode to /lib/firmware.

Back to contents


Video and Compiz

Edit the /etc/X11/xorg.conf file and add the video mode 1366x768 to set the proper resolution. Change the Driver setting in the videocard aka Device section from vesa to intel for proper acceleration.

The core Compiz package is already installed by default. I recommend installing additions and Compiz Fusion from SlackBuilds.org. To start Compiz when starting KDE, create a shell script containing the following, make it executable and place it in ~/.kde/env (create that directory if necessary):


#!/bin/sh
KDEWM=$HOME/.kde/startcompiz.sh
export KDEWM

The startcompiz.sh file contains the following:

#!/bin/sh
LIBGL_ALWAYS_INDIRECT=true compiz --replace --indirect-rendering ccp

You may not need the parts about indirect rendering, but Compiz wouldn't run without that on my notebook. Be sure to start kde-window-decorator somehow to have window decorations. It's convenient to start the programs you need to have started and save your KDE session (see KDE session management in kcontrol, KDE components, session manager).
Back to contents


Touchpad

To get the touchpad to scroll by using the right side of the pad, installation of the synaptics touchpad driver is needed. There also needs to be some special configuration in xorg.conf to make the pad work properly. Below are mine, I set my touchpad sensitivity reasonably high so I won't have to move my fingers a lot.


Section "InputDevice"
Identifier "Touchpad"
Driver "synaptics"
Option "Protocol" "auto-dev"
Option "Device" "/dev/psaux"
Option "SHMConfig" "true"
Option "MaxSpeed" "1"
Option "MinSpeed" "0.6"
Option "AccelFactor" "0.05"
Option "LeftEdge" "100"
Option "RightEdge" "900"
Option "TopEdge" "76"
Option "BottomEdge" "680"
Option "MaxTapTime" "180"
EndSection

Back to contents


Webcam

The R5u870 webcam driver seems to work quite well at this point. Simply compiling and installing it as root will do the trick.
Back to contents

Installing Kubuntu Linux on a Sony Vaio TZ21MN

Posted March 9th, 2008 by Maarten

I have installed Linux on this VGN-TZ21MN/N subnotebook several times to get it right. At first I tried Debian which worked reasonably well, but a Kubuntu 7.10 (Gutsy Gibbon, derived from Debian/Lenny) installation adds more comforts such as properly working brightness keys, a properly working power manager and even most media buttons on the front work correctly (these are useful for controlling applications such as Amarok). Be sure to visit the Ubuntu forums for some additional useful information. This page is listed on TuxMobil.


My Sony Vaio.


Instant On

Needed files for the Instant On application.By default this notebook comes with Windows Vista Business pre-installed which in turn comes with a recovery partition. Considering this a complete waste of space I instantly decided to remove it (actually, I repartitioned the whole hard disk). By doing this I unfortunately also removed the Instant On functionality that this Vaio series sports. This small application allows for the notebook to start within seconds by pressing only the AV mode button on the front. The system can then play DVDs and audio CDs.

Since there were no CDs whatsoever included with this Vaio TZ notebook (recovery CDs can be created), I "found" a Vista copy and temporarily reinstalled it. This allowed me to install the Instant On functionality by downloading the file SOAOTH-01531100-UN.exe from the Vaio website (possible source here, last checked 23 June 2009). I tried several other Instant On setup files under Windows XP and also tried to run it using Wine, but they were able to detect that I wasn't using Vista or that I had the wrong brand of notebook, so if you're looking for a proper installation file, you do need the one that exactly matches your notebook and its version of Windows. The Instant On application only needs less than 100 megabytes, so after reinstalling it can be copied off the Vista partition and onto a tiny 100 megabyte NTFS partition at the beginning of the hard disk. After copying the necessary files there should be a file structure present on the NTFS partition as shown in the screenshot.
Back to contents


Partitioning

Because I haven't gotten suspend to disk to work properly and I rarely need a swap partition (I use a swap file if I need swapping at all), my disk only contains three partitions:

/dev/hda1 100MB NTFS
/dev/hda2 / 10GB ReiserFS
/dev/hda3 /home 90GB ReiserFS

Back to contents


Wireless network

Using the default (2.6.22.14) kernel the wireless module seemed to work well. After compiling a new 2.6.23.14 kernel and installing the new iwlwifi modules the wireless connection seemed to work at home using WEP. But only after trying to connect to the secured wireless network at school I found out that this new daemonless module didn't seem to function all the way. This caused me to revert back to the "old" ipw3945 modules, including the daemon which is started automatically when the ipw3945 module is loaded.
Back to contents


Video

The video card works fine with the "intel" module for the Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller. I won't include an xorg.conf file here because X.Org seems to figure out the configuration by itself, even though the screen has a size of 1366 by 768 pixels. Even 3D acceleration seems to work automagically with this module. I'm not sure what the graphics card should be achieving but glxgears gives me around 695 frames per second. This allows for games such as Torcs, Open Arena and Planet Penguin Racer to run. Compiz seems to run in Kubuntu and it looked even cooler in Debian (its repository probably included another version of Compiz), but I'm not using it on a regular basis because it requires the notebook to run in performance mode and needs to be configured properly (something which I haven't committed an awful lot of time to as of yet).

Because I wasn't able to get the frame buffer that is shown at start up, as well as the other five terminals that spawn at boot to use a higher resolution than (probably) 640x480, I enabled the frame buffer and the Tux logo in the kernel (2.6.23.14) after which these small imperfections were undone.

The external VGA port can be put to use by executing xrandr --output VGA --auto --mode mode here.
Back to contents


ACPI

Due to the small screen and the power saving abilities of the Intel processor, this machine lasts for about five hours or longer without plugging it in. As said before, the brightness keys (Fn combinations) work fine in Kubuntu. The notebook is able to suspend to memory successfully, but for some reason it tends to hang on wake up after doing this several times. I have yet to find out which device prevents the machine from waking up properly.
Back to contents


Sound

The line "options snd-hda-intel model=hippo" needs to be added to /etc/modprobe.d/alsa-base to make the sound work including the jack sensing. Several other lines could also work, but this is the only one that seems to make it work the right way. Alternatives that may have less functionality or affect other hardware:
options snd-hda-intel model=auto
options snd-hda-intel model=sony-assamd
Back to contents


Camera

The built in camera worked by installing the r5u870 module into the default kernel (don't forget to install the kernel sources and the full gcc before trying), but it seemed to conflict with the sound card configuration or another setting for some sinister reason. So in short; it does work, but not like a breeze. I got it working in Kopete using an MSN account. I haven't tried installing the webcam module with the 2.6.23.14 kernel yet.
Back to contents


Miscellaneous

  • Try to set the installer resolution to 1024x768x16 when getting a garbled screen.
  • Remove the package named dolphin to get Konqueror back in KDE.
  • Install the package libncurses5-dev to be able to run make menuconfig.
  • Install the packages libxine1-ffmpeg and w32codecs from debian-multimedia.org to get proper video playback in Xine and Kaffeine.
  • Note: in Kubuntu the touchpad works automatically, including the ability to scroll using the right side of the pad.

Back to contents


Status

Tested and working (one way or another): wireless network interface, normal network interface, processor powersave and performance settings, video acceleration, vga out, cd writing, dvd writing, dvd playing, touchpad, Fn keys, media buttons, power button, lid switch, suspend to memory, sound output, internal microphone, external microphone, built in camera, usb ports, bluetooth (tested with phone).
Not tested: Sony card/stick (MagicGate), modem.
Not working: SD card reader.
Back to contents