ThinkPad T520/W520, NVIDIA, Wide Gamuts, and You!

Update: Linking to a better color profile below.

Update 2: I narrowed down the ACPI issues, and have a better solution.

I recently purchased a brand new, maxed out ThinkPad T520. My old laptop was 4 years old, and while I absolutely loved it (and still do!), an opportunity came up to get a T520 with a nice discount. So I took advantage of that. I like large screen resolutions, as I tend to have a few thousand windows on screen at any given point in time, so I went with the 1920×1080 option, and put Ubuntu Linux on it.

And let me tell you, for an Ubuntu-certified laptop, it sure didn’t work out of the box.

Optimus!

It took a lot of effort to get Ubuntu working, due to some hardware problems. The biggest issue was the display adapter. The T520/W520 (and I believe the T420, etc.) come with two graphics chipsets: An Intel something-or-other, and an NVidia 4200M. By default, this is in “Optimus” mode, meaning that the OS can essentially switch between the cards for performance/power savings reasons, depending on use.

Not surprisingly, this does not work on Linux.

Your system will try to use the Intel card. You won’t have any 3D, and try as you might, that NVIDIA card just will not work. It’s maddening, but there’s a solution. One with its own set of problems, but at least it gets you there..

The trick, it turns out, is to go into the BIOS, go into the video settings, and switch to “Discrete Graphics” and disable auto-detection of Optimus. Once you do this, your NVIDIA card will work! You’ll get 3D, and it’ll be fast and smooth and so wonderful.

If you can boot, that is.

Once I switched over, I found I could no longer boot. Now this was 4:30 in the morning and my brain stopped functioning, so I wasn’t making all the connections. All I know is that booting locked up, and when I went into recovery mode, I started seeing I/O errors on my brand new 160GB SSD. Figuring it was just my luck, I decided I’d call Lenovo in the morning and get a new one. If this sounds at all familiar, stay calm! It’s not your SSD, and your system is not hosed. It’s ACPI.

(Of course it’s ACPI… Nobody ever said it was the Year of the Linux Laptop.*)

Update: I previously said that passing acpi=off in grub would fix things. That disabled battery and other stuff, though. The new solution below is far better. Suspend/resume and brightness work!

So, to fix that, go back to Intel graphics, edit your /etc/default/grub file, and set GRUB_CMDLINE_LINUX_DEFAULT to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=noirq"

Unfortunately, you won’t get Suspend/Resume, and I think the battery monitor is busted, but you’ll get Hibernate. It’ll mostly work. Sometimes. It’s Linux, afterall.

I’m not sure if this is needed anymore, but you may also need to add this to the “Device” section in your xorg.conf:

Option "RegistryDwords" "EnableBrightnessControl=1"

Once you have a working X/Unity/Compiz/3D/Minecraft setup working, you may notice some problems with colors….

Wide Gamut

The T520/W520/T420/etc. line of ThinkPads have a new 95% Wide Gamut LED display. It makes everything all bright and nice. And it butchers your colors.

Applications that support color management should in theory compensate for this. Not all apps do, though. What bothered me was my web browsing experience. Every color was broken, and as someone who writes webapps, I needed accurate colors. I was about to throw out this laptop before I managed to figure out a solution.

Modern Ubuntus should come with a Color Profiles control panel under System -> Preferences. From here, you can load ICM profiles and get things working. That will solve some of your issues, so let’s start there. Note that this is in Ubuntu 11.04 (I think), but I’m running 10.10 (I thought originally 11.04 was the source of my problems), so for me I had to:

apt-get install gnome-color-manager

And here, I the Color Profiles applet was causing problems, and I couldn’t directly use it, so I installed dispcalGUI, which allowed me to load in a profile and install it into Color Profiles, and activate it.

On some site, I found a working color profile (ICM file). I don’t know where I originally found it, but you can download it here. Note that this is only tested on my 1920×1080 display, so YMMV.

I’m not confident that this profile is 100% correct, but it’s close. At least as far as I can tell.

You’re free to try that profile, but I found a better one which preserves the crispness of the display with the actual accuracy you’d want on the web. WordPress is even looking correct now.

NotebookCheck’s review of the ThinkPad W520 links to a color profile that works much better.

Firefox Color Profiles

Now, you’ll still notice problems with Firefox and Google Chrome. Chrome doesn’t seem to understand color profiles, but Firefox does. You just have to tweak it.

In Firefox, go to about:config. In there, search for gfx.color_management. Set gfx.color_management.mode to 1, and then set gfx.color_management.display_profile to the path of that ThinkPad ICM file I linked to earlier.

Restart Firefox. You should now see more or less correct colors!

Now it’s not perfect. The ThinkPad screen is very bright, and some things can get a bit washed out and perhaps slightly tinted. As I type this, I’m noticing that the WordPress UI is a bit off, and things blend together more than they should (lots of light grays on a bright screen). But it should be much better than it was!

If you use a T520/W520/T420/etc. and have other solutions or tips for color management on Linux, I’d love to hear about them! And hopefully this saved someone else hours or days of rage.

* Thanks to James Farwell for the “Year of the Linux Laptop” snark.

IBM Woes, Take 3

I foolishly thought things wouldn’t get any worse than the entire system shutting down (not even locking up, but shutting down, and not through the OS, just, boom, dead) on any ACPI call, but I was wrong. It turns out that the battery doesn’t charge unless the power cable is plugged in AND the laptop is off. If the machine is on, the power cable won’t be used, and the battery will just drain.

Gee, that’s the best $700 motherboard I’ve ever been forced to purchase..

My laptop is useless right now. The work I planned for Galago and the notification stuff this weekend will not get done, and I won’t be available for contact much until after next week (assuming IBM can get it right this time.)

Update: Tacking on another wonderful issue. The laptop just stops recognizing the keyboard and trackpoint randomly, requiring a complete shut down. Unfortunately, the On/Off button, which you normally hold down to force a shut-off, doesn’t seem to always work, especially not when the keyboard isn’t working, so you have to pull out the battery.

IBM’s not winning points

So it seems that the new motherboard IBM made me pay $700 for is locking up, and Linux is giving me confused ACPI errors I never had before. Furthermore, Linux no longer detects that I’ve plugged in the laptop power cable until over a minute after I plug it in. This is the exact same install as before they upgraded the motherboard. I didn’t even send them the hard drive, so I know it’s not the install. Nothing’s been upgraded, software-wise. I paid $700 for a faulty motherboard (it seems) and warped plastic.

I’m not happy.

Don’t cry over spilled soda

A little bit of explanation as to why people haven’t been able to get ahold of me much lately…

Last week was a crappy week, and I won’t get into all the details of it, except for one part that’s needed for this little story. I was at work, with my laptop sitting next to my monitors, and I was dealing with some annoyances. During this, I had my earphones on, listening to some music on my Rio. I stood up for a second, I can’t remember why exactly. Since I had my earphones on, the cord of course pulled up with me. What I wasn’t aware of at the time was that it was wrapped around a full, newly opened can of Mountain Dew, which proceeded to spill over my keyboard.

This didn’t ease the day any. I cleaned up what I could, knowing that the keyboard was going to be sticky in a couple of days. The next day, I called IBM, whose tech support was superb from past experiences. I told them that the keyboard was sticking and also that my monitor is leaving these vertical light streaks. They sent me a box and I sent it back to them with the laptop.

So I was without a laptop for a few days. My desktop computer wasn’t even configured for a dual-head X session, didn’t have anything except a default Ubuntu desktop on it, and barely any non-base packages. I essentially made my laptop the main computer. Rather than deal with configuring the desktop fully, I decided to relax during the nights and play World of Warcraft and such.

So on Wednesday, I got a call from IBM about the laptop. They said they detected a spill inside the laptop and would have to replace the keyboard and motherboard. They said they would have to bill me $700 for this. I was in shock. It was under warranty and I certainly didn’t expect a fee like this. I asked if it was necessary, and they said liquid could short circuit it later. BS, I thought, it was working for days. They could just wipe whatever off, and there wasn’t that much that spilled in. However, they informed me that either they fix everything and I pay the money, or they don’t fix anything and they just send it back. In which case, my warranty would be useless. After a bit of grumbling, I gave them the billing info.

Today, I received my laptop. I looked at the check list. Replaced the plastic, the motherboard, and ran a virus scan. Huh, virus scan.. I didn’t leave a hard drive in there. Oh well. Wait, nothing about the screen? I had to check, so I performed my usual test. I powered it on and opened up a window. Streaks. Great. I used it a bit longer and realized something else. The right-hand side of the laptop’s plastic is warped. If I put my hand on it to type, I can hear and feel it creak. Too annoying to ignore.

So once again, I called up IBM and explained my frustration. They wanted me to duplicate the problem on Windows, thinking it was a Linux problem, but I assured them I already went through all this with the last person and we confirmed it was the LCD. They’re going to send me a box and I’ll be sending the laptop back to them, again. They tell me I won’t be billed for this one, so I’m going to hold them to that. What was interesting is that they claimed that they were going to escalate my problem to a higher priority division where it would get better care. They’re probably just saying that to ease concerns, and I hope that’s the case, because the idea of them having a division that would handle hardware better than the default level worries me.

I won’t be online much again for a week after Tuesday. This means no Galago, notifications, etc. development, unless I get things running on my desktop box (which is the plan). I will be checking e-mail while at work. If people want to send patches, please do :) Otherwise, I’ll get back to development on stuff when I have a working system put together.