Archive for July 24th, 2009

Ubuntu 9.04 on the Sony Vaio P – with desktop effects!

Posted in Hardware, linux on July 24th, 2009 by Richard Walker – 22 Comments

Picked up one of these fantastic pieces of hardware earlier in the week. It came with Vista Home Basic, which ran… poorly (refraining from use of expletives and vulgar metaphors).

I promptly wiped the lot and put on Ubuntu but then ran into the issue of hardware support… turns out the graphics chipset used in this little beast (Intel GMA500) is actually a weird mutation of a PowerVR chipset with some 2D/mpeg acceleration thrown on top. And until recently, the driver support under Linux for this chipset (moniker “Poulsbo”) was horrific…. the best you could ask for was either running under VESA or fbdev, and *maybe* getting the nice 1600×768 resolution (and weird aspect ratio that goes with it) but it was dog slow. Others had success using the “psb” driver, but only under 2D.

Today, I’m going to show you how to run it with full 3D support and composite/desktop effects under Ubuntu.

First obviously, you need to install the damn thing… seeing as the P doesn’t have an optical drive, you either need to use uNetBootin to create a bootable flash drive, or do what I did, get lazy and use an external USB optical drive.

Success. I went with XFS for the root filesystem simply because the benchmarks showed it outperforms both Ext3 and Ext4, and considering the P comes with a 4200rpm IDE drive (running in UDMA5, or 100MB/sec) I wanted the best filesystem performance possible… yes, I could have partitioned judiciously to keep seek times down etc etc but honestly… I couldn’t be bothered. I have a 32GB solid state drive in the mail, and that’ll take care of seek times.

Everything runs perfectly with the install, and there are no freaky drivers needed for any devices except the graphics card. You should end up booting into Ubuntu, but the screen res will be lower (it still has the right aspect ratio however, so it won’t look squished).

Now…. fire up Synaptic (System -> Administration -> Synaptic Package Manager) and go to Settings -> Software Sources. Under the “Third-Party Software” tab you need to add these two repositories:

deb http://ppa.launchpad.net/ubuntu-mobile/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/ubuntu-mobile/ppa/ubuntu jaunty main

Thanks to Brian White for this step as it negates the need to copy/paste keys around the place…. drop to a terminal,  then do the following:

gpg –keyserver keyserver.ubuntu.com –recv C6598A30
gpg –export –armor C6598A30 | sudo apt-key add -

Back to Synaptic! Click “reload” and it should go off and fetch a whole bunch of new package info. When it’s done, type “poulsbo-driver” into the quicksearch field. From the narrowed down list, select poulsbo-driver-2d, poulsbo-driver-3d, and I *think* it should be already selected as a dependency, but also select psb-kernel-headers, psb-firmware, psb-kernel-source and xserver-xorg-video-psb. I’m uncertain here because I went a slightly roundabout way to get to this point, but still had success.

Click “Apply”.

Open up Terminal (Applications -> Accessories -> Terminal) and edit (using vi, nano, whatever editor you like) /boot/grub/menu.lst.

You should find a line that looks like this (your root UUID and kernel version will/may vary)

kernel /boot/vmlinuz-2.6.28-13-generic root=UUID=c34d1d57-59d3-4f6f-abc1-fd83aea4 ro quiet splash

Change it to this (bold is to emphasise what needs changing)

kernel /boot/vmlinuz-2.6.28-13-generic root=UUID=c34d1d57-59d3-4f6f-abc1-fd83aea4 ro quiet nosplash mem=1500mb

This tells grub to force the kernel to recognise only 1500mb of the installed 2GB, leaving 500mb free for the graphics adapter to use. The “nosplash” option prevents any sexy graphics being displayed during boot. I’m not sure if this is *essential* but it was in another write-up that I followed. I may try removing it to see what happens.

Also, edit /usr/bin/compiz and around line 62 you should see something like this:

WHITELIST=”nvidia intel ati radeon i810 fglrx”

Change it to this:

WHITELIST=”psb nvidia intel ati radeon i810 fglrx”

This is so compiz will *actually start* and not just die because it feels like it.

Save that file, and reboot… if all has gone well, you should see GDM firing up in hi-res goodness. If not and you get some message whinging about video settings… click Ctrl+Alt+1, login with your usual creds, type “sudo bash” to get root access (password is the same as your user password) and type “/etc/init.d/gdm stop” to kill GDM, then “modprobe psb”. If the psb module wasn’t loaded before, you will see the difference… the screen res on the console will suddenly go native and the text will be *tiny*. Then just type “gdm” to get gdm to start up again.

If you’re back in, and things look good, and the res is nice and sharp, log in, click System -> Preferences -> Appearance and click the Visual Effects tab. I chose “Normal” just to get things started… if it goes well you should get a message like “Do you want to keep these settings” etc… say yes! If any windows you had open appear to have lost their borders, don’t fret… just close whatever app it was and reopen and everything should be fine.

I also installed compizconfig-settings-manager to fine tune the compiz setup… so I get the rotating desktop etc, and it all looks really nice. All in all, it performs really well on what is a sub-$1000 netbook that uses about 6 watts of power under normal load, so I’m really impressed.

Some things that worked for me out of the box were wifi (with WPA) and my 3G USB modem… plugged it in, selected a carrier, and it worked straight away. I think the guys at Ubuntu have really gotten their act together making this a polished OS… if the only thing needed is a bit of tinkering/tweaking to get a new, poorly supported graphics chipset working… that’s pretty good. It performs better under Ubuntu than it did under Vista.