Arch Linux on a Sony Vaio SZ 6
If you somewhat follow this blog, you probably know that I’m running Arch Linux as my primary operating system. I’m using this on my Sony Vaio SZ 6 for +/- 5 months now. I’m very pleased with both Arch Linux and the laptop and they happily work together. This article is about how I set up Arch on this Sony Vaio. There were made several models in the SZ series and the instructions should more or less apply to most of them. If you are an owner of this laptop and you tryed out these instructions, I’d be happy to get your feedback on it.
Change Log
21-02-2010:
- Added nouveau driver as alternative to official nvidia driver
- Mention the use of KMS
27-06-2009:
- Added ftp install disk to installation notes
- Mention the use of module auto-detection
- Arch now uses /etc/modprobe.d/modprobe.conf
- Had a change to test the mic, it works
- No need to add dbus if hal is specified
- Brightness works as is now
- Added FN-keys section
Table of Content:
1. Hardware Specifications
2. Installation
3. Arch Linux
4. Processor
5. Wired Network
6. Wireless Network
7. Sound Card
8. Graphic Cards
9. Keyboard
10. Touchpad
11. Bluetooth
12. Webcam
13. Brightness
14. Modem
15. Card Reader
16. Suspend & Hibernate
17. FN Keys
Appendix:
A. CPU Info
B. Intel X Configuration File
C. Nvidia X Configuration File
D. Keyboard Configuration File
E. Touchpad Configuration File
F. Lspci Output
G. Lsusb Output
Hardware Specifications
Here are the relevant hardware specifications for the Sony Vaio SZ61 XN/C:
- Processor: Intel Core 2 Duo T7500 @ 2.2GHz
- Memory: 2048MB @ 533Mhz DDR2
- Hard Disk: 160GB 5400rpm
- Graphics: nVidia GeForce 8400M GS + Intel GM965 Integrated Graphics
- Sound Card: Sigmatel CXD9872 Intel High Definition Audio Codec
- Wireless Network: Intel PRO/Wireless 3945ABG
- Wired Network: Marvel 88E8055 PCI-E Gigabit Ethernet
- Bluetooth: Cambridge Silicon Radio
- Webcam: Ricoh r5u870 (05ca:183a)
- Touchpad: AlpsPS/2 ALPS Touchpad
Installation
The installation is pretty straight forward following the Arch Linux Beginner’s Guide. You shouldn’t encounter any problems if you read the guide’s instructions carefully. I recommend using the Intel GM965 graphic card during the installation and a wired network if it’s at your disposal. You can then configure the other graphic card and the wireless network afterwards. Nevertheless, the installation should work with whatever you chose to use but it might require some extra steps. From now on I will be assuming you followed my recommendation. For the record, I’ve used both the 2008.06 x86_64 core and ftp install disk with success. In the end they aren’t any different from eachother. When using the ftp install disk, you’ll end up with the most recent packages available in the repositories at once. When using the core cd, you need to issue a system wide update to acquire the same result.
Arch Linux
This tutorial is written while using a snapshot of Arch Linux, dated on 28 february 2009. This snapshot includes the following versions of important packages:
- Arch Linux 64 bit fully updated
- Kernel 2.6.28.7 SMP PREEMPT
- X.org 7.4 (xorg-server 1.5.3-4)
- Alsa 1.0.19
- Nvidia driver 180.22
- XF86-video-intel 2.4.3-1
As you may have noticed, I’m using a 64 bit operating system. Some people are afraid of it, thinking it is somehow more difficult or that it is missing some important software packages. Others are just opposed to 64 bit. I can tell you there is no reason not to use 64 bit. There is no important software missing (there is a native 64 bit version for both java, its browser plugin and flash) and in few specific scenarios you’ll get a significant performance increase.
Processor
The dual core processor is, obviously, recognized out of the box. By installing cpufrequtils, you can enable cpu frequency scaling:
sudo pacman -S cpufrequtils
To start the cpu frequency scaling daemon on startup, add cpufreq to the DAEMON array in /etc/rc.conf:
DAEMONS=(syslog-ng @cpufreq ... )
The available scaling governor is cpufreq_ondemand. You will have to load this module together with acpi-cpufreq on startup by adding it to the MODULES array in /etc/rc.conf:
MODULES=(acpi-cpufreq cpufreq_ondemand ... )
You can set the desired governer (ondemand) in /etc/conf.d/cpufreq along with the minimum and maximum cpu frequency:
governor="ondemand" min_freq="0.8GHz" max_freq="2.2GHz"
The full output of /proc/cpuinfo can be found in Appendix A. More information about cpu frequency scaling can be found on the Arch Linux CPU Frequency Scaling and Cpufrequtils page.
Wired Network
The Marvel 88E8055 PCI-E Gigabit Ethernet network card should have been detected during the installation, together with the appropriate module. It uses the sky2 module. Add it to the MODULES array:
MODULES=(sky2)
For a while now, Arch Linux is able to auto-detect the required modules by setting
MOD_AUTOLOAD="yes"
in /etc/rc.conf. There is no need to specify all the modules in the MODULES array anymore. Only to explicity prohibit something from loading, the MODULES array is useful. In a limited number of cases, it doesn’t detect the modules like the ones from cpu scaling. I simply list the modules for reference.
Wireless Network
First, you will need the wireless_tools package. If you have a wired network connection available, it’s as easy as:
sudo pacman -S wireless_tools
The package is also included in the Arch Linux install disc. If you want to use the wireless network during the setup, don’t forget to install it.
Apart from wireless_tools, you will also need the firmware for the wireless network card, in our case the Intel 3945/ABG. Install iwlwifi-3945-ucode:
sudo pacman -S iwlwifi-3945-ucode
Now add the iwl3945 module to the modules array. I also recommend blacklisting the older propriatary module ipw3945 to avoid any conflicts:
MODULES=(!ipw3945 iwl3945 ... )
For more information on setting up a wireless network card, especially during the installation, see the Arch Linux Wireless page.
Sound Card
The sound card should be detected during the installation, together with the necessary modules. In case something goes wrong, here are the modules you have to load:
MODULES=(!snd_pcsp snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd snd-hda-intel soundcore ..)
I also disabled the pc speaker (!snd_pcsp and !pcspkr) because it really irritates me and probably you as well. The headphone jack doesn’t work without an extra line in /etc/modprobe.d/modprobe.conf:
options snd-hda-intel model=vaioRecording sound using the microphone input works out of the box.
Graphic Cards
As mentioned before, this laptop comes with 2 graphic cards: one on board Intel card and one dedicated Nvidia card. You can get each single one to work without ever using the other. You can also set up Arch Linux to use both, but only one will be active at the time of course. You should already have one card working with the Arch Linux installation. I’ll explain how to get both working. Apart from installing xorg and mesa, you need a libgl implementation. Open source drivers use the libgl package from the repositories, propriatary drivers come with their own libgl implemenation. Now here’s the bad news: when installing both drivers from the repositories, these two libgl implementations will conflict and pacman will refuse to install both. We’ll install the Intel driver first if you haven’t already done that during the installation:
sudo pacman -S xorg mesa libgl xf86-video-intel
That shouldn’t give you any problems since the Nvidia driver is not installed yet. My xorg.conf file for the Intel card can be found in Appendix B.
The Intel card and its driver fully support kernel mode setting (KMS) and with a more recent kernel and Intel driver, KMS is required. The most noteworthy features of KMS are full resolution virtual terminals and fast switching between virtual terminals. For more information about KMS, see the Arch Linux KMS page.
Now we move on to the Nvidia card. Reboot your laptop and use the speed mode switch on the laptop. The X server will refuse to start. No problem, login using the console after you cancelled the X server messages. Instead of installing the Nvidia drivers with pacman, we’re going to install it manually to avoid pacman conflicts. It won’t harm the system. Open up a terminal, make sure you’re in the home directory and get the driver from the Nvidia website:
cd ~/ wget http://us.download.nvidia.com/XFree86/Linux-x86_64/180.22/NVIDIA-Linux-x86_64-180.22-pkg2.run
You can always change the version number if you want an older or more recent driver.
Switch to run level 3 to make sure X isn’t running:
sudo telinit 3
Go back to where we downloaded the driver (home directory) and launch the installer:
cd ~/ sudo sh NVIDIA-Linux-x86_64-180.22-pkg2.run
From now on, simply follow the installer’s instructions. Afterwards you’ll have the Nvidia driver installed. You can find my /etc/X11/xorg.conf file for the Nvidia card in Appendix C. You can already start X to see if it’s also working with your Nvidia card:
startx
Now it’s simply a matter of using the right xorg.conf configuration file for each graphic card. To automatically use the correct one on boot, you can use this script:
#!/bin/bash VIDEO=`/usr/sbin/lspci | grep -c nVidia` if [ "$VIDEO" = 1 ]; then cp -f /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf echo "Nvidia Card Detected" else cp -f /etc/X11/xorg.conf.intel /etc/X11/xorg.conf echo "Intel Card Detected" fi
Make sure you have /etc/X11/xorg.conf.nvidia and /etc/X11/xorg.conf.intel or change the paths in the script to the correct ones. Save the script somewhere and make it executable. Now add the path of the script to /etc/rc.local:
/path/to/xorg/switch/script
One downside of this method is that you can only use the 3D mode with one graphic card, in this case the nvidia card. I figured you’d want the better card of the two to be able to use the 3D mode. Another downside is that you won’t be able to change the brightness of your screen (maybe you can but I didn’t look into it). Changing the brightness does work when you only use the Intel card. You’ll have to decide for yourself if the advantages outweigh the disadvantages.
An interesting alternative to the official binary NVIDIA driver is the open-source nouveau driver. It has excellent 2D support and supports KMS. If you don’t need 3D support (which is still in development), I even recommend nouveau over the official driver. To install the nouveau driver:
sudo pacman -S xf86-video-nouveau nouveau-firmware
Keyboard
Since X.org 7.4, hal takes care of your keyboard/mouse/touchpad, also known as hot-plugging. Therefore you don’t have to put a keyboard input device section in your xorg.conf file as you can see in the one I provided (see Appendix B or Appendix C). Make sure you have the xf86-input-evdev package installed and that you have the hal service running. Then you can use my file found in Appendix D. Save it to /etc/hal/fdi/policy/10-keymap.fdi and restart the hal service.
More information on hot-pluggable input devices can be found on the Arch Linux Xorg Input Hotplugging page.
Touchpad
The touchpad is similar to the keyboard: you will need a fdi file to get it to work. Tapping, right mouse click in the corner, horizontal and vertical scrolling, … it all works. My fdi file can be found in Appendix E. Save it to /etc/hal/fdi/policy/11–x11-synaptic.fdi and restart the hal service.
Bluetooth
You need the linux bluetooth protocol stack. To install, run
sudo pacman -S bluez
You need to start dbus and bluetooth in that order. You could add it to the DAEMONS array:
DAEMONS=(dbus bluetooth ... )
but I only start the bluetooth service when needed. That way I save some battery time. Note that hal already starts the dbus daemon by itself so if you have hal listed in the DAEMONS array, you don’t need to add dbus anymore. Gnome also has a nice applet you can load for bluetooth. I also strongly recommend blueman, a GTK+ bluetooth management utility. For more information, again see the Arch Linux Bluetooth page.
Webcam
Some time ago, the developper of the drivers for this webcam switched to a userspace tool instead of using kernel modules. This is how you get webcam working:
Get mercurial:
sudo pacman -S mercurial
Set up a directory where we will build the driver:
mkdir ~/r5u870
Get the source:
cd ~/r5u870 hg clone http://bitbucket.org/ahixon/r5u87x/
Build the driver:
cd r5u87x make
Load the driver with the correct firmware:
cd ucode/ sudo ../loader -f r5u87x-05ca-183a.fw
You will probably have to reload the uvcvideo module to get your webcam working in the current session:
sudo rmmod uvcvideo && sudo modprobe uvcvideo
Every time you want to use the webcam, you have to use loader. A more convenient way is to create an alias for this rather long command. To do so, add the following to your .bashrc file (located in your home directory):
alias webcam='sudo /home/user/r5u870/r5u87x/loader --reload -f /home/user/r5u870/r5u87x/ucode/r5u87x-05ca-183a.fw'
Don’t forget to replace user with your user name. There are sevaral programs you can use for your webcam. The most popular ones are cheese (gnome), xawtv and skype.
Brightness
For a while now, brightness works without any hacks for the intel card. I’ll leave the hack here to get it to work in older arch linux installations: It relies on xbacklight and acpid to change the brightness of the screen. xbacklight is included in the xorg-server-util package. The latter one is probably already installed, but xbacklight might not. Be sure to add acpid to the DAEMONS array:
DAEMONS=(@acpid ... )
Now create a brightness script named sonybright.sh in /etc/acpi/actions containing:
#!/bin/bash if [ "x$1" = "xdown" ]; then xbacklight -time 100 -steps 10 -dec 10 2>/tmp/sonybright.log elif [ "x$1" = "xup" ]; then xbacklight -time 100 -steps 10 -inc 10 2>/tmp/sonybright.log else echo >&2 Unknown argument $1 fi
This script is supposed to be executed whenever you press the brightness up and down key. To do so, you will need to create two more files in /etc/acpi/events: sonybright-up and sonybright-down
sonybright-up:
# /etc/acpi/events/sony-brightness-up event=sony/hotkey SPIC 00000001 00000011 action=/etc/acpi/actions/sonybright.sh up
sonybright-down:
# /etc/acpi/events/sony-brightness-down event=sony/hotkey SPIC 00000001 00000010 action=/etc/acpi/actions/sonybright.sh down
the event SPIC key should be the same, however it is best to verify this with the acpi_listen command:
acpi_listen
Modem
Not tested.
Card Reader
Works out of the box. Nothing extra is required.
Suspend & Hibernate
Suspending and hibernating the laptop works hassle free. It only works with the Intel card out of the box though. I take you could also make it work for the Nvidia card by editing some files, but then I assume it wouldn’t work for the Intel card. Since you probably want to use suspension and hibernation for saving power, you’d want to Intel card as it consumes less power to start with.
FN Keys
The most important fn keys are working: volume up/down, mute, brightness up/down, switch monitor. The fn-keys rely on acpi. Make sure acpi and acpid are installed and add acpid to the DAEMONS array:
DAEMONS=(@acpid ... )
You should be able to get other fn keys to work in a way similar to the old brightness hack as listed in the Brightness section.
A. CPU Info
Here‘s the full output of /proc/cpuinfo. You can also verify that cpu frequency scaling is enabled and working (cpu MHz 800.000).
B. Intel X Configuration File
Here‘s my Intel X Configuration File.
C. Nvidia X Configuration File
Here‘s my Nvidia X Configuration File.
D. Keyboard Configuration File
Here‘s my Keyboard Configuration File. Don’t forget the change the keyboard layout to correspond with your language.
E. Touchpad Configuration File
Here‘s my Touchpad Configuration File.
F. Lspci Output
Here‘s the output for lspci. The nvidia card isn’t listed because I’m using the Intel card right now.
G. Lsusb Output
Here‘s the output for lsusb.
Very neat :) I just installed arch-i686 on a SZ2XP and worked out some things myself (just installed the r5u870 driver straight, worked just fine using Skype) – just before I found your page. The cpufreq and brightness tips are very useful, thanks alot!
Dit is de reden waarom Linux niet populair kan worden.
Arch Linux is inderdaad een technisch iets moeilijkere distributie, hun opzet is dan ook niet om een populaire distributie worden maar om vanuit een ontwerpstandpunt eenvoudig te zijn (Mocht je er meer over willen weten, zie http://wiki.archlinux.org/index.php/The_Arch_Way). De moeilijkheid ligt niet zozeer in deze laptop met arch linux te laten werken, maar om arch linux zelf te installeren. Met meer bekende distributies zoals Ubuntu werkt deze laptop op de webcamera na onmiddellijk zonder extra configuratie.
Verder zie ook geen reden waarom linux populair zou moeten worden zolang ik maar kan doen wat ik er wil mee doen. Dingen die (helaas?) met Windows of OS X niet zo snel gaan.
Hi!
A great guide, and i guess it will help me, when i install Arch soon on my new notebook. Do you think, your solution for the graphic-card-switch will also work on the newer Z-series? I heard Sony changed that switch from a “cold”(hardware) to a “hot”(software) switch.
Well, anyway, thanks in advance. ;)
Not sure about that switch. There is no harm in trying of course :) From what I’ve seen from a friend who owns a Z-series laptop, it pretty much looks the same. I might be wrong though, I never paid attention to it.
in my sz6 xorg dont work :(
Apologies for the late response, I’m on vacation and didn’t notice your reply rightaway.
Hopefully hou have already solved the issue but in case you haven’t, here are some tips:
- Did you install the xorg group?
- Did you install as video driver? (intel or nvidia)
- Did you start the hal service before running?
To possibly figure out what’s wrong, look at the /var/log/xorg.conf.log file for errors (EE).
Hi!
Nice article you wrote, most of the stuff you explain apply to my sz61 too. But i thought i need a more elegant solution for switching the graphic adapters. Therefore i wrote a little startscript like yours but it does not only change the xorg.con file, it also changes some packages so i can have 3d acceleration with both cards.
You can find the script and my installation “guide” here: http://www.twisted-artwork.de/private/vaio_sz61mn.html
Currently its only available in german, but i hope i will have the time to translate it soon!
regards
sebastianp
Thank you for pointing out your solution. It is indeed a better and more elegant one. I’ve thought of it myself but never got to it as I basically use the intel card only. Nice article by the way.
I have a Vaio FZ240E, which has a 05ca:183a ricoh webcam.
Using the uvcvideo driver and the appropriate firmware, the webcam is able to work at 640×480, but not at 320×240, which is required by kopete, and other programs.
I remember that the old r5u870 driver worked at 320×240 without a hiccup.
Do you also have this problem with your webcam?
I will see if I experience this problem with kopete later today. For now I can already tell you that the webcam works with both skype and cheese. You’ll hear back from me.
I just got my webcam working for the very first time after two years of using Ubuntu without it!! Many thanks (Now on Karmic Koala 9.10)
@Pepe I installed kopete today and I do have video from my webcam working in kopete, but the quality is very low.
Hi there. I’m using another pc: HP Pavillion dv1635la and I have the 05ca-1870 webcam model and I’ve installed the loader but I keep getting the following error:
oscar@oscar-laptop:~/r5u87x/ucode$ ../loader -f r5u87x-05ca-1870.fw
r5u87x firmware loader v0.2
Searching for device…
Error: Failed to find any supported webcams.
oscar@oscar-laptop:~/r5u87x/ucode$ ls
r5u87x-05ca-1803.fw r5u87x-05ca-1834.fw r5u87x-05ca-183b.fw
r5u87x-05ca-1810.fw r5u87x-05ca-1835.fw r5u87x-05ca-183e.fw
r5u87x-05ca-1812.fw r5u87x-05ca-1836.fw r5u87x-05ca-1841.fw
r5u87x-05ca-1830.fw r5u87x-05ca-1837.fw r5u87x-05ca-1870_1.fw
r5u87x-05ca-1832.fw r5u87x-05ca-1839.fw r5u87x-05ca-1870.fw
r5u87x-05ca-1833.fw r5u87x-05ca-183a.fw
oscar@oscar-laptop:~/r5u87x/ucode$ ../loader -f r5u87x-05ca-1870.fw
r5u87x firmware loader v0.2
Searching for device…
Error: Failed to find any supported webcams.
oscar@oscar-laptop:~/r5u87x/ucode$ ../loader -f r5u87x-05ca-1870_1.fw
r5u87x firmware loader v0.2
Searching for device…
Error: Failed to find any supported webcams.
Note that I use both the 1870 and 1870_1 files. I’m not an expert, actually I’m kind of challenged in computer skills but still I love Ubuntu (using KarmicKoala 9.10) and I’d like to use my webcam on it. Any help will be highly appreciated. Thank you.
Are you sure the device is recognized by the operating system? Run lsusb and see if there’s an entry for it. (It’s usually looks something like [..] 05ca:183a Ricoh Co., Ltd [..]). It also lists the exact model.
Uploading firmware also requires having root privileges but it usually gives another error if you’re not running it as root. Prefix the command with sudo.
I did that. The model I have is the 1870, here’s the output from lsusb:
oscar@oscar-laptop:~$ lsusb
Bus 001 Device 004: ID 05ca:1870 Ricoh Co., Ltd Webcam 1000
Bus 001 Device 003: ID 4971:cb08
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 046d:c016 Logitech, Inc. M-UV69a/HP M-UV96 Optical Wheel Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth + WLAN) Interface [Integrated Module]
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Notice it’s the first device listed. I ran all commands with sudo. The exact model of my camera is r5u870, I think. How do I check that and the kernel version? It appears to be important. Thank you.
This is the model: Bus 001 Device 004: ID 05ca:1870 Ricoh Co., Ltd Webcam 1000. So it is recognized and the model number is correct. You can figure out the kernel version with the command “uname -m”.
Hmm. The only possible problem I can think of is that you forgot to reload the uvc video module. You can do so by executing “sudo rmmod uvcvideo && sudo modprobe uvcvideo”. If that doesn’t work, I’m running out of ideas. It may be possible there is some sort of problem with the r5u87x software itself.
I run sudo rmmod uvcvideo and it says
ERROR: Module uvcvideo does not exist in /proc/modules
What does it mean? I’ll try running all the steps from the top, see what happens. Thank you very much for your help.
O.k, I found the drivers at this site: http://linux.softpedia.com/progDownload/ricoh-webcam-r5u870-Download-30296.html There are two .deb files and I installed them both. Now the driver manager recognizes the driver, but neither cheese nor emesene recognize the webcam, although when I go to setting in emesene I can select the webcam and use it. It really puzzles me. What do you think I should do?
The error is not really that significant. It just means that the module wasn’t loaded yet. Hence you can’t remove it either.
Are you saying that the webcam works when you select it in emesene? (p.s. independently of wether the webcam works or not, there are still many issues with programs using webcams).
Maybe you should also look for help at ubuntuforums.org. There are many more users that can possibly help you out and they might have encountered your problem already.
Hi Nepherte,
First things first. Thank you for your tutorial, nice one indeed.
I just installed arch on my SZ6, everything works fine.
However, there’s a problem with iwl3945. Wireless goes up and down continuously. I already experienced this issue with different *nix flavours.
I know ipw3945 works, however it’s not available in the repos now.
How did you fix it?
Thank you.
I’m afraid I didn’t have to solve anything as I don’t really have a problem with wireless. The only problem I had is that, when I don’t enable the wireless switch before I boot and turn it on after the laptop has started, I have to remove the software block with rfkill.
Can you describe your problem in detail? Useful information can be extracted from some log files:
dmesg | grep iwl
I have seen a lot more threads on the arch forum recently about problems with the iwl driver. Perhaps your problem is related to one of those.
i am using Sony VAIO CR 313-H and webcam wasnt working, i followed what you’ve written above in the webcam section and it just worked fine but the picture quality is very poor. It shows very less brightness and lines across the picture window.
and yes archlinux is indeed a wonderful OS, i am using it too!
thanks for this great tutorial!