Around 6 months ago, my beloved Dell XPS M1330 died, firstly of a bad power jack, and then due to a bad motherboard (the GPU overheated for a second time, outside of the extended warranty Dell granted after its first demise). So, I’ve been on a notebook hunt ever since, trying to find the perfect PC that’ll do me for the next 2-3 years – until it inevitably breaks or gets swallowed whole by a particularly vicious grue.
Several purchases-and-returns later (a Lenovo T410, a Dell XPS16 and a Sony Vaio F11), I managed to snag a Sony CW2 (VPCCW2C5E) off Sony’s clearance section meeting my requirements: an i5, a good nVidia GT330M GPU (read: GT325M GPU), a high-res 1600x900 14" LED screen, only a little bigger than my old M1330 for less than £800. A decent upgrade from my old laptop, and a significant upgrade from the Dell Mini 1012 netbook I’d been using in the intervening months.
Having somehow trashed the Windows 7 install by turning the machine on, I got to work on installing something better, and so, for later reference (should the Sony warranty cover hungry grues), here’s the process I went through in getting it all to work.
Installation
I had opted for Ubuntu 10.10, it being only a week or two old at this stage and being what I used on my other systems. The first hurdle was to get the installer displaying anything – easily resolved by selecting F6 on the boot screen and enabling the ‘nomodeset’ kernel parameter. The installation went rather smoothly once going, although I (fortunately) chose not to download and update with the latest packages while installing.
To cut a long-story short, the first problem came while trying to install the nVidia drivers. Despite being a 64-bit machine, I initially downloaded and installed the live x86 32-bit version. However, this led to issues with the nVidia driver and nouveau driver not leaving enough memory for each other (I had various vmalloc and ‘bad RIP value’ errors in the kernel log when starting X). nVidia’s proposed solution: go 64-bit.
Having heard about the issues of going 64-bit, I then read this Phoronix article of 32-bit vs 64-bit benchmarks. Convinced, I grabbed the 64-bit DVD, and started again.
Out-of-the-box
On first boot, nearly everything seemed to work – I had a display, audio, working touchpad, and I was even able to connect to my WiFi network. But those were minor issues, “easily fixed”, I figured…
Immediate issues
However, there were also some major issues. To even get to the desktop, I’d had to again add the ‘nomodeset’ kernel parameter while booting to get anything on the screen. When booted, the display was low-resolution and refused to budge up to the native 1600x900 of my panel. The WiFi connection was incredibly slow, loading pages even slower than my Nexus One on the same WiFi network. I couldn’t change the display brightness, and suspending didn’t work – it just rebooted.
WiFi
While I was able to connect to my WPA2 network as soon as I had logged in, wget was reporting download speeds of ~50kb/s at best, rather than the 1-2Mb I typically get on my other machines. This was going to make updating my system very very very slow indeed unless fixed, and I had no desire to tether myself to the router via a rather unsexy grey ethernet cable.
Nor did I want to spend the rest of the evening swapping out the mini-PCI Atheros AR9285 card for the Intel one in my netbook, so I opted for the proper solution – obtaining an updated ath9k module which contained a fix for this issue. I downloaded the latest source tarball from the Linux Wireless website, compiled, installed, and rebooted (for good measure). Instantly speedy.
Graphics
Next task was to get rid of the ugly 1024x768 scaled desktop and get the 1600x900 the panel was capable of. I headed to Ubuntu’s “Additional Drivers” app to automatically download and install the latest nVidia drivers in the Ubuntu repository, which turned out to be 260.19.12. With the WiFi fixed, these downloaded and installed rather promptly, but after rebooting I got barely more than a blank screen and – if I was lucky – the welcome sound. I rebooted with ‘nomodeset’ again (bypassing the newly-installed nVidia module), and downloaded the latest drivers from nVidia’s site to install manually. Rebooted. Same issue.
I suspected the nouveau issues were causing the problem, based on forum reports, but I did not want to blacklist nor remove them since they can be useful for the text-mode TTYs. I consulted the forums again.
Fortunately, the problem was not the nouveau drivers, but rather the version of the nVidia driver I was using (thanks to Mrnelson1986). For some reason, 260.19.12 simply did not want to play nice. I rebooted with ‘nomodeset’ again and headed to the nVidia website to download the 256.53 drivers (which they very fortunately keep archived for cases like these).
Before installing them, I did some preparation:
- Uninstalled my manually-installed nVidia drivers by re-running the same install script with ‘—uninstall’
- I ran ‘
sudo apt-get remove --purge nvidia-*’ to remove the existing nvidia drivers I had installed from the PPA
- Noted down the values I’d need to put in
xorg.conf (apparently not needed on 260.19.12 drivers)
- Downloaded the
SNY06FA.BIN EDID file and threw it in /etc/X11 (again, apparently not needed on 260-and-later drivers)
I then proceeeded to install the newly-downloaded 256.xx drivers from nVidia. I did it like this:
- Dropped to a terminal
- Stopped X with ‘
sudo service gdm stop’
- Ran the nVidia installer (‘
chmod +x nvidia-installer.run; sudo ./nvidia-installer.run’)
- Edited
xorg.conf to add the EDID and monitor declarations (see below)
- Rebooted!
And, astonishingly, it worked. The default Ubuntu desktop at 1600x900 looked lovely, although the default ‘tulip’ wallpaper required replacement to really shine.
Here’s the Device section of my xorg.conf (based on the xorg.conf that nvidia-xconfig generated for me)
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
Option "ConnectedMonitor" "DFP-0"
Option "CustomEDID" "DFP-0:/etc/X11/SNY06FA.bin"
Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection
Backlight
It was quite late in the evening at this point, and the bright display was starting to irritate my eyes, so I attempted to reduce its brightness. Unfortunately, it’s impossible to alter the backlight on a fresh install – either via the labelled Fn-F5/F6 keys or poking around – so I had to do further digging.
First was to confirm whether the keys were working and being recognised. acpi_listen proved they were, there was just nothing responding to them.
Half the solution is to install the nvidia_bl module, handily provided in the mactel-support PPA. This added an entry to the proc filesystem that lets me manually adjust the brightness – but by default, its maximum allowable brightness was ‘2048’, which is just bright enough to see in a dark room, but I needed brighter.
The backlight module didn’t seem to know about my particular model, so was setting a low value as a precaution. This was easily overidden by adding the line ‘options nvidia_bl max_level=0x10000 shift=9’ to /etc/modprobe/nvidia-bl-dkms.conf to tweak the range of exposed values. A ‘modprobe -r nvidia_bl; modprobe nvidia_bl’ later, and screen brightness could be controlled with ‘echo 100 | tee /sys/class/backlight/nvidia_backlight/brightness’.
Fixing the Fn-F5/Fn-F6 keys to work as labelled took a little more work, and the solution I’m now using isn’t exactly ideal as it doesn’t use Gnome’s own brightness controls (so there’s no on-screen display when the brightness is changed). The workaround involved identifying the appropriate keycodes using acpi_listen, and then use these to create 2 custom ACPI events, as well as a pair of scripts that would increase/decrease screen brightness as needed using the method described in the last paragraph.
The first task involved writing two bash scripts that would increase or decrease the screen brightness when executed by retrieving the current brightness value, adding or subtracting 10, and then setting to the new value. These were to be executed when the keys were pressed, and saved in /etc/acpi with names of ‘sony-brn-up.sh’ and ‘sony-brn-down.sh’ in line with the other scripts in the same directory.
Secondly, I created two additional files in /etc/acpi/events named ‘sony-brightness-up’ and ‘sony-brightness-down’ which are read by ACPI to identify a key code to listen for and the associated action (event) to execute when they occur. They were basically copies of the existing scripts in that directory, modified accordingly to reference the sony-brn-up.sh and sony-brn-down.sh scripts respectively.
Turns out there are similar scripts available for the Sony F11 which do the same as mine, better, and I should probably use instead.
Suspend
Easy to fix by adding ‘acpi_sleep=nonvs’ as a kernel parameter (source). Best done by editing /etc/defaults/grub and running update-grub to propagate the changes through to grub.cfg.
Miscellany
- Attempting to run L4D2 under Wine gave me various errors about not being able to initialise OpenGL. The solution was to install
ia32-libs, boot into text-mode (‘text’ boot parameter) and then re-run the nVidia installer, making sure to select to install the 32-bit compatibility OpenGL libs when prompted. L4D2 ran after this step, albeit with significant mouse lag that I’ve yet to investigate.
- Battery life seemed short (1-2 hours), but was resolved by installing
cpufreqd and enabling the on-demand power governor to enable dynamic CPU clocking. Now sits at 2-3 hours, which still seems remarkably short. I’ve been spoilt by the netbook, curse it.
- Currently, using 64-bit Ubuntu has thrown up only one, minor, easily solved issue regarding installing Adobe Air – which is 32-bit only. Other than that, completely plain sailing – even Flash works!
- The lid really is a smudge magnet. I need jeweller’s gloves…
- The BIOS is extremely sparse – hardly anything can be tweaked besides the date, time and boot order. I’m sure there must be a way to get at all the juicy stuff but fortunately I don’t need or want to… yet.
- It was 4 weeks between ordering the thing and Sony UK actually shipping it. Even worse, they took payment immediately after the order was placed (rather than on day of dispatch), so I was £800 poorer for nothing to show for it for nearly a month. Not impressed by that at all, which was apparently caused by them refurbishing their warehouse in preparation for Christmas… (they’re obviously planning to sell a lot of “3D” tellies and glowing magic wands this winter.)
03/01/11 ‘Laptop battery critically low’
After unplugging the machine from charge, I would frequently get an on-screen Gnome dialog telling me the battery was critically low, and then going into hibernation unless I pressed ‘Cancel’ quickly enough. This is a known bug and can be worked around using ‘gconftool-2 --type bool --set /apps/gnome-power-manager/general/use_time_for_policy false’ (only retained for the duration of each Gnome session).
17/01/11 nVidia drivers
Fed up with having to reinstall the 256.19 drivers every time I updated my kernel, and running several revisions behind the latest driver release, I’ve found a better way. sudo add-apt-repository ppa:ubuntu-x-swat/x-updates && sudo apt-get update && sudo apt-get nvidia-current does the trick. (Remember to uninstall the nVidia drivers using ./NVIDIA-Linux-x86_64-256.19.sh --uninstall first.
Remaining issues
The biggest remaining issue is the corrupt display when accessing a text-mode TTY. Minor issues include the screen corruption on suspend/restore, the hacky brightness control, and powertop reports a high frequency of kernel wakeups, which may be affecting the battery life somewhat.
I’ll update this post if/when I discover solutions to these issues, and with anything else that pops up.
I admit to being slightly disappointed to find the Vaio rather hostile to Linux, but this seems largely due to the Vaio’s various proprietary bits and bobs and Sony’s own deviations from the normal components. My Dell M1330 ran beautifully, as does the Mini 1012, with absolutely minimal post-install tweaking. Perhaps it’s simply the Dell machines have had more attention from Linux hackers than this Vaio, but in the end, it’s working well enough for me not to worry about it.