Category Archives: hardware

archbang

i pulled the slow magnetic hdd running gentoo from my thinkpad r61i; swapped it with a 2009-era 32GB ssd running archbang, a variant of arch linux.

it’s been several years since i last tried arch, and i wanted a desktop environment installed & preconfigured. archbang offers a minimal openbox desktop with a few basic programs: web browser, terminal, text editor, file manager, etc.

arch is fast. from cold boot to logged-in at the desktop: 5.5 seconds. that’s on an old supertalent ssd, artificially limited to SATA-I speeds by the thinkpad’s BIOS; the hardware is capable of running at SATA-II. even topped out at 150MB/sec read/write, this system is screaming fast. apps execute instantly, queries and searches complete as soon as i hit Enter, and even heavyweight firefox only takes a second or so to load. my experience is vastly improved over the same environment on gentoo, on the magnetic hdd.

gentoo didn’t run this fast on this drive when it was installed in my now-defunct desktop. i switched to a more useful xfce desktop, which didn’t affect boot/login times at all; still under 6 seconds.

so, why arch, and not gentoo? apparently, my music-making environment went through too many upgrades and changes between 2011 and now. i probably should have left it as-is once i got a working setup for live performances and studio production. it mostly doesn’t work anymore. kernel changes, upstream audio package changes, lots of factors. it’s impossible to diagnose, so i’m temporarily without a gentoo system, at least until i swap disks.

the upstream developer of my primary audio software runs arch, so i figured i may get better support & overall user experience by running the same OS and environment. i haven’t yet configured my desktop for realtime/low-latency audio work besides install the ck kernel. arch has most of my usual music stack available as binary packages, so i’ll only have to compile a few apps from the AUR.

i really like installing binary packages, rather than having to spend a whole day building them on this slow 2007-era CPU. and, since this is an exceptionally light flavor of arch, i don’t have the bloat and slowdown i experienced when using ubuntu for music production.

i’m not sure if i’ll keep arch installed or not, but this has been an interesting trip so far.

Scale 9x: Day 3

Sunday

The final day of SCALE 9x arrived far too early, since the Gentoo developers were still recovering from the merriment the previous evening/morning. We congregated in the hotel room Mike & I shared. You know you’re having some good times when hotel security places a call to your room, asking you to keep the noise down.

The hotel experience

The Hilton is a terrible, terrible hotel. I know the organizers needed a bigger venue, and the Hilton provided more rooms. Still. All the Gentoo developers and all the attendees I talked to commented on how much worse the hotel itself was compared to the Westin from previous years. The location is worse compared to what’s in the area, the parking is more limited and expensive, the rooms were more “ghetto,” and the hotel’s prices for everything were ridiculously expensive. $5 for a half-glass of orange pulp, I mean, juice. Next year I may not stay at the Hilton, even though that would be less convenient. The expo actually felt just as packed-to-overflowing compared to previous years at the Westin, so hopefully they’ll have to move SCALE again for next year.

The expo floor

Sunday is usually more sparsely attended at SCALE; Saturday is the “big” day. However, we still had a decent amount of traffic at our booth. We gave away the last couple of LiveDVDs and a bunch more minimal LiveCDs. I just manned the booth all day, since there weren’t any talks that looked particularly interesting. This gave me an opportunity to do some swag-hunting. I picked up some Ubuntu stickers for my laptop, which dual-boots Ubuntu Studio along with Gentoo. I also got to try out the upcoming Unity desktop user interface. I dunno why everyone hates it; in my brief hands-on, it was pretty cool. Plus you can switch back to the “classic” Gnome interface at any time, so there’s no reason to complain.

I picked up some excellent swag from the OpenSUSE booth, including a plush penguin and gecko for my wife. They’re pretty cute. (Side note: I had an awesome chat with their Greek ambassador; we talked about community, and how hard it is to get people to contribute, as well as discussed KDE. I gave him one of our LiveDVDs, since he’s been talking with the Greek Gentoo KDE devs, and in return I got an OpenSUSE 11.3 disc. 11.4 will be released in just a few days!)

The expo floor and conference rooms were much better this year in a key area: wireless internet. This year the SCALE organizers managed to create and maintain a speedy wifi network. I never experienced the dropouts and miniscule bandwidth that plagued previous years. I read somewhere that a 45mbit network was setup, and that it was never oversaturated. The wifi connection, even with over 1000 users, was still faster than my home network. The organizers and admins deserve special thanks for delivering such an awesome experience. I was able to check bugs, upload files, and make CVS commits as I discussed issues with my fellow developers, all without leaving the Gentoo booth.

The machines

Sometime after noon, Robin grabbed me and told me to get my USB stick with the PowerPC ISO. Why? IBM was demoing their massive server, which included a POWER7 blade. They wanted to know if Gentoo would run on it! Our handbook doesn’t list anything more recent than POWER5, so this was a good time to learn more. A few of us headed over to watch Gentoo get loaded onto new hardware. We got a few photos and videos of Gentoo booting on the massive server; here’s one:

Gentoo on POWER7

It made it through nearly all the boot process, but apparently there are some differences in POWER7 console/tty devices or some such compared to POWER5, so it hung at the inittab step, but still! Gentoo on POWER7! It mostly boots; just needs a couple of trivial changes. That’s fantastic, given that it’s an unmodified ppc64 ISO.

We demoed a few different machines at our booth. I forgot to get any pictures of this year’s gear; sorry. Everything ran Gentoo, of course! We displayed a pair of Cr-48 ChromeOS notebooks, my ThinkPad running Xfce 4.8, an ASUS notebook, an ARM-based Nail board by Tin Can Tools, and a tiny blue XXS MIPS-based firewall/VPN cube by MyCable.

The people

Before I drove back down to San Diego, we got a group shot of current and former developers:

Gentoo Developers at SCALE 9x
Left to right: vapier, omp, antarus, dertobi123, wolf31o2, nightmorph, solar, wormo, ramereth, robbat2

SCALE was a blast; it was even better than last year. We chatted with all kinds of users, corporate reps, and people from projects like XBMC. Thanks to all the folks that came by our booth and talked with us — you guys rock. I’m looking forward to next year’s SCALE!

Experiments, adventures, and consequences

I’ve been doing a fair amount of experimentation on my machines. Been playing with XBMC, Boxee, Ubuntu, and bleeding-edge Xfce and Freedesktop software stacks on Gentoo.

HTPC

First, I tinkered with the HTPC. It’s a Zotac MAG, dual-core Atom 330 with nVidia ION graphics. It’s just the thing for at 1080p media center. It was running an experimental community-built version of XBMC, installed back in January or February. While it was nice because it was extremely minimal, with just enough operating system to boot straight into XBMC, it was very buggy, and definitely alpha-quality.

So I wiped the disk and installed straight-up Ubuntu 10.04.1, and then installed XBMC and Boxee. I’m still tinkering with it; I need to setup the remote control I just bought, and I need to configure it to load a media center on boot, rather than the Gnome desktop. There have been a few hardware growing pains, mostly related to getting HDMI sound working correctly, and forcing 1080p output — detected my TV as a 720p device, so I had to fiddle with the nVidia utility to fix that. Also had to do a lot of tweaking in XBMC and especially Boxee to output sound over HDMI.

I’m somewhat familiar with XBMC, but I’ve wanted to try Boxee for awhile now. It’s supposed to be more user-friendly than XBMC, offering a simplified interface based on the XBMC code. It also has that whole “social media” aspect, whatever that’s about. Its real attraction is the user-friendliness; I hate having to do so much manual configuration in XBMC. I need something that my wife and I can just pick up and use; no hassle, no tinkering.

Initial XBMC impressions

It works somewhat better than the version I used several months ago. However, most of the video plugins are buggy and/or completely broken, as are some of the helper programs and utilities. All that’s supposed to change, though, with the next XBMC release. Supposedly there’s an entirely new architecture, so maybe I’ll finally get to watch my favorite shows and stream local media a bit easier, with better content scraper integration.

There are some things that don’t work — nothing on SyFy, and all too often the existing network TV plugins don’t work for all advertised shows. Mythbusters in particular is very buggy, offering only partial listings for 5 or 6 seasons, and those are extremely low-quality Flash streamed from some third-party download site. Still, my wife can watch her crime shows and 80s favorites, while I can get a fair amount of Mythbusters and other Discovery shows.

Initial Boxee impressions

Useless. Slow. Hard to configure. Totally not what I thought it’d be like. Boxee didn’t offer any of the easy internet TV watching I thought it’d have, instead offering a couple hundred useless channels for things I’ve never heard of. I expected it to have better integration with regular network TV, the same ones I can watch in a web browser. I expected a nice presentation of content, with the video wrapped in a full-screen Boxee experience. I expected hi-def streaming content; instead, the few shows I’m interested in are only available in stuttering low-quality Flash. Why bother, when I can watch The Guild in gorgeous 1080p on my Xbox?

At least XBMC has somewhat working plugins for several networks. Apparently XBMC plugins don’t work that well (or at all) on Boxee. I gave up trying to make ‘em work. All too often the shows are streamed from stuttering, blocky Flash videos. I tried using the integrated Boxee web browser to watch things like Hulu, but that turned out to be an even slower, laggier disaster.

On the hardware side, it was harder to get HDMI sound working on Boxee than on XBMC. And even though I have all the right VDPAU libraries installed, and I’m using the latest nVidia driver (195.x), nothing on Boxee seems to be accelerated. Even 720p content streamed from my LAN stutters, with the audio occasionally lagging the video. XBMC doesn’t have this problem, so I know it’s not the graphics stack.

Boxee is definitely beta. Maybe everything will work fantastically on the Boxee Box, but I don’t want to spend another $200+ dollars on essentially the exact same hardware. I want to like Boxee, I really do. But at this point, XBMC works where Boxee fails, and even though its user interface is more cumbersome, it still lets me watch videos and play music.

Initial Ubuntu impressions

Slick. Very slick. Installation from a USB key went very well. While I tried to do everything from the commandline in Gentoo, using syslinux and whatnot, none of the Ubuntu guides on creating LiveUSB media worked. I ended up just compiling Unetbootin and Qt4 on my Xfce laptop. Unetbootin worked perfectly on the first time, giving me a bootable 4GB USB stick loaded with Ubuntu 10.04.1.

Installation was simple and straightforward, with minimal user interaction. I did a bit more, because I wanted to create a custom partition layout, but otherwise the end-user part of the process was done in just a minute. The rest of the install proceeded automatically, booting me into a bright, shiny Gnome desktop. After a minute or so a few notifications popped up, advising me to install the proprietary nVidia driver and install some software updates. That took just a couple of clicks. Sweet! Oh, the joys of binary package management.

Even though the HTPC only runs a lowly 1.6ghz dual-core Atom chip with a mere 2GB RAM, the desktop still feels pretty responsive. Firefox starts up as fast or faster than my 1.5ghz Core2Duo laptop with twice the RAM. In my experience, Gnome is always pretty heavy, feeling fairly clunky and somewhat slow even when backed by speedy CPUs and gobs of RAM. Nautilus and Evolution windows always seem to load much slower than Thunar and Claws Mail, or even PCManFM and Thunderbird. Still, despite the anemic hardware, my Gnome experience in Ubuntu is surprisingly pleasant. Nothing seems particularly slow to start on a fresh login. The boot process itself could be faster, though; it takes more’n'a minute to get logged in. I need to cut that down to 10 seconds or less to get a true HTPC “instant-on” experience.

There are some quirks in most ION devices related to suspend and USB wakeups, and my Zotac MAG is no exception. I need to do some commandline hacking to get the computer to suspend every time, and to wake only when a button is pushed on the remote. And configuring LIRC is a whole ‘nother deal.

But still, I’m liking what I see. Ubuntu 10.10 will be released next month, and it promises even more improvements and nifty app integration than 10.04.

Laptop

In fact, I liked my brief experience with Ubuntu 10.04 enough to download a daily LiveCD beta of 10.10, “Maverick Meerkat.” I plan to create a LiveUSB and install it on my “Linux playground” partition. I’ve gotten just a taste of how Ubuntu works when using it as a special-purpose media center; now I want to see how it works as a mobile desktop OS.

The last time I had Ubuntu on my laptop, it was Ubuntu Studio 8.04 a few years ago. It lacked polish, lacked the cohesive desktop experience Ubuntu is known for. Its sole advantages were that it was optimized for media production, featuring a low-latency kernel and tons of preinstalled music software, with easy access to much more. I experienced numerous issues with JACK and my USB-to-MIDI adapter, though, so my plans for tinkering with music were shelved.

I’ll see how vanilla Ubuntu works on my laptop, and if it goes well, I may look into converting it into a low-latency/realtime audio production environment. I’m very interested in being able to quickly, easily use this machine to create tunes and link up with my piano. There’s been a lot of progress in the Linux audio world in two years.

Gentoo

I turned my Gentoo install into a bleeding-edge hardmasked/~arch/stable Xfce testbed. I decided to dump HAL and setup PolicyKit, ConsoleKit, udisks, upower, udev, that whole stack. Originally I wanted just to try out the experimental PackageKit features for Portage, which was a recent GSoC project. I knew that would require most of the aforementioned software stack, so I thought, “As long as it has to be installed anyway, why not dump HAL, too?”

One thing led to another, and pretty soon I had upgraded to Xserver 1.9, disabled HAL, rebuilt world a few times for USE flag changes, and pretty well screwed my system. Reconfiguring my input devices for xorg.conf.d took awhile, and I’ve been besieged by other difficulties. That’s the problem with a source-based distro, and the problem of running Xfce in particular: nothing is especially integrated, and in a lighter environment like Xfce (compared to Gnome), there isn’t much code that’s designed for a HAL-less system. Apps written for *Kit/udisks/upower are either only available in git, or still unported. A binary distro like Ubuntu would integrate all that stuff forcibly, by writing their own code if need be, so that various actions that require PolicyKit authentication would pop-up windows, prompting for passwords. None of that happens on my Gentoo system.

I ended up adding the Xfce overlay and adding several hardmasked 4.7/live versions of packages just to get udisks/upower support, which helped some. However, several bits of Xfce and other daily applications just don’t have the right code yet. So xfdesktop doesn’t display icons when drives are plugged, cameras won’t always mount and make their photos available, and not all power management options work, even when the user has the right PolicyKit credentials. That’s on top of having to reconfigure pretty much my entire working environment due to changes between 4.6 and 4.7 — everything from panel applets and their configs, to Thunar and window manager preferences. Despite USE="sound" installing libcanberra for event support, and adding sound-theme-freedesktop, event sounds cannot be enabled in the appropriate dialog, because Xfce doesn’t believe libcanberra is installed. It’s the same for Pidgin — it doesn’t believe there’s a working sound framework, either. I have to give it commands like “aplay /some/dir/foo.wav” for each kind of event.

The whole thing, is, quite frankly, a bloody mess. And all because I wanted to get some experimental Portage toys from an overlay. It’s my fault, I admit, and even after 8 hours of hacking at it, I’m probably nowhere near finished, assuming it’s even possible to get all the bleeding-edge pieces to play nicely together.

(Side note: I would like to thank my fellow Gentoo developer Samuli for taking the time to answer my numerous Xfce-related questions and do a bit of troubleshooting along the way. Thanks, man!)

So, what’s to learn from my adventures? First, trying to put everything back to its previous state would take another two days of work, if it’s even possible! Second, the price for living on the bleeding edge of *Kit integration is too high. I don’t mind running the occasional ~arch package, or using git X11 driver stacks like xf86-video-*, Mesa, and libdrm. But basic hardware abstraction stuff is nothing to be fooling around with. Not being able to use pluggable devices, enable Bluetooth, or properly adjust power management on a laptop is too high a price for being forward-thinking. I wish I’d stayed with my boring HAL system. While deprecated and a pain to configure, at least it worked reliably. More important, maintenance was nonexistent; it was simply a matter of copying several .fdi files into the right directory when I first compiled and installed my desktop. After that, I didn’t have to touch a thing.

The HAL-less desktop is supposed to be the future for every Linux distribution out there. I can only hope it is still some ways off, to give upstream coders more time to get their applications in order, so that distributions don’t have to do much patching or extensive repackaging and integration, and so that the end-users don’t have to spend hours configuring everything to their liking.

Long Overdue Update

I haven't posted anything in a while, but I'm not complaining. The last month I've been mostly busy pretending to be busy. Ok, to be honest, that's not entirely true. Over at Xfce, we have achieved a lot in August:

  • We've moved all Xfce repositories (including the goodies) over to Git. Kudos to Brian for doing most of the work.
  • All Xfce translation updates are now submitted via Transifex. Thanks to the Transifex developers for all the support and for being such a friendly bunch. It amazes me that Dimitris, the founder of Indifex, is also active on our translations mailing list to support people!
  • The migration of the Thunar core to GIO is complete and has been merged into the main development branch. The overall delta was 2.9MB, although admittedly, a big part of that is due to the removal of ThunarVFS, so I can only take credit for about 16,000 of the 24,335 insertions and 6,000 of the 41,356 deletions.
  • We've kicked off the Xfce 4.8 development cycle on August 16th. The schedule and all other details are available on the wiki. Xfce 4.8 is scheduled for April 12th, 2010. Expect development releases of the various core components soon!

Other things I've been planning to blog about but didn't have the time to:

  • Samuel is still busy setting up Buildbot. With less time than he had hoped for at hands this might still take a while.
  • I was provided with a free Linutop 2 in June. I'd like to thank the Linutop company again for this gift! So far, I've only found the time to give it a few test boots but I'm planning to set it up as a Xfce test machine soon. Its limited hardware makes it much better platform than my rather powerful laptop and/or virtual machines for testing the speed and memory demand of Xfce.
  • My thesis is progressing slowly. I think I have at least 3/4 finished now. I'll keep you posted about the result. I'm hoping to kick off the six month learning phase for my final exams before October because a friend of mine is already waiting for me. ;)

New Laptop (aka Gentoo On MacBook Pro 5,5)

NB: I’ve cleaned up this guide and moved it, and I’ll continue to update it there. This blog post will not get any more updates.

Those of you who have chatted with me over the past… er… 18 months or so… know I’ve been wanting a new laptop for a while. Those of you who have chatted with me over the past 6 months know that I’d settled on a 13″ MacBook, but I wanted to wait until Apple’s next refresh/update before making the purchase.

Apple updated their laptop line at WWDC in June 2009, and I was pretty much perfectly sold on the 13″ MacBook Pro (one of the “updates” was to rebrand the 13″ aluminum unibody MacBooks as Pro models).

I was in Maryland for a wedding, and decided to take advantage of the lower tax rate (than California’s) and my sister’s educational discount (she’s a teacher). As a nice bonus of the edu pricing, I also got a free 8GB iPod Touch (which I really like a lot more than I expected to).

So ok, enough background.

Vital stuff: this describes my experience installing Linux on a June 2009 era MacBook Pro 13″. DMI reports that this model name is “MacBookPro5,5″. This guide may work for other similar systems, or it may not.

lspci output for this laptop:

00:00.0 Host bridge: nVidia Corporation Device 0a82 (rev b1)
00:00.1 RAM memory: nVidia Corporation Device 0a88 (rev b1)
00:03.0 ISA bridge: nVidia Corporation Device 0aae (rev b3)
00:03.1 RAM memory: nVidia Corporation Device 0aa4 (rev b1)
00:03.2 SMBus: nVidia Corporation Device 0aa2 (rev b1)
00:03.3 RAM memory: nVidia Corporation Device 0a89 (rev b1)
00:03.4 RAM memory: nVidia Corporation Device 0a98 (rev b1)
00:03.5 Co-processor: nVidia Corporation Device 0aa3 (rev b1)
00:04.0 USB Controller: nVidia Corporation Device 0aa5 (rev b1)
00:04.1 USB Controller: nVidia Corporation Device 0aa6 (rev b1)
00:06.0 USB Controller: nVidia Corporation Device 0aa7 (rev b1)
00:06.1 USB Controller: nVidia Corporation Device 0aa9 (rev b1)
00:08.0 Audio device: nVidia Corporation Device 0ac0 (rev b1)
00:09.0 PCI bridge: nVidia Corporation Device 0aab (rev b1)
00:0a.0 Ethernet controller: nVidia Corporation MCP79 Ethernet (rev b1)
00:0b.0 IDE interface: nVidia Corporation Device 0ab5 (rev b1)
00:10.0 PCI bridge: nVidia Corporation Device 0aa0 (rev b1)
00:15.0 PCI bridge: nVidia Corporation Device 0ac6 (rev b1)
00:16.0 PCI bridge: nVidia Corporation Device 0ac7 (rev b1)
02:00.0 VGA compatible controller: nVidia Corporation Device 0863 (rev b1)
03:00.0 Network controller: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01)
04:00.0 FireWire (IEEE 1394): Agere Systems Device 5901 (rev 07)

Install Media

I decided to put Gentoo (the x86_64 version) on it. So, I grabbed the latest minimal installer (dated 20090618) and booted it. I was disappointed to find that the keyboard didn’t work after boot, so I couldn’t go anywhere with it. I Googled around a bit, but wasn’t able to find anything (except for the possibility of the usbhid driver failing to load due to an unrecognised option, which I thought a bit unlikely). After some head-scratching, I downloaded the install/live CD of Ubuntu 9.04, and booted that. To my happiness, the keyboard was working fine.

rEFIt

Backing up a little… Before booting the Linux CD, first I installed rEFIt from inside MacOS X. I didn’t burn the rEFIt bootable CD; I just went ahead and used the Mac installer which did the job without rebooting. After that I could still boot other CDs by holding down the “c” key while booting, but if I didn’t, I got a nifty boot menu with MacOS X listed.

Dual Boot

I decided I wanted to keep my MacOS X partition, so I fired up Disk Utility and resized the HFS+ MacOS partition down to 40GB. Yes, amazingly, current Leopard (10.5.7) Disk Utility can resize the startup volume while MacOS is running, without needing to use the installer DVD or reboot at all. It just resizes it live and you’re done. It was very quick, too.

BIOS Mode and Partitioning

I’ve read various sources that said that the proprietary nvidia drivers would not work with the machine in native EFI mode (though this seems to suggest otherwise, but I haven’t tried it), so it would have to be booted in BIOS mode. Unfortunately, this makes partitioning the drive a little annoying, as I wanted to keep MacOS X to dual-boot. The GPT partition table layout has a legacy MBR mode for booting BIOS-mode OSes (in our case, grub is the legacy OS).

The MBR compatibility mode only supports four primary partitions, and no extended partitions, so the partition with your kernel on it needs to be one of the first four. Since Apple takes up the first two partition slots (I’m told MacOS X will boot without the first partition, but it’s unclear as to whether or not missing that partition will screw up Apple-supplied updates later), that leaves two left. Plenty. Three and four ended up being /boot (96MB), and / (around 60GB). Initially, I was debating leaving out the swap partition, but Linux’s suspend to disk (aka hibernate) requires a swap partition, so I allocated 4GB for it. The rest of the space I allocated for /home. I used ext3 for the root and home partitions, since I don’t trust ext4 yet, and tools for manipulating ext4 volumes from other OSes are currently nonexistent. For the boot partition I used ext2, and set ‘noauto’ in the mount options so it doesn’t get mounted unless I tell it to. Note that *all* of these partitions should be primary partitions. GPT doesn’t use anything else. Grub will only be able to see my first two Linux partitions (/boot and /), but that’s fine, as the kernel will be on /boot, and once Linux comes up it will know how to read the real GPT partition table to find the rest of the partitions.

GPT Resync

After partitioning, I rebooted and selected the GPT/MBR partition table sync item from the rEFIt boot menu. This turned out to be unnecessary for me (I think gparted did it for me?), but this might be needed in some cases.

Gentoo Install

After partitioning, I pretty much followed the normal Gentoo install procedure (downloading a stage3 tarball, unpacking it to the root partition, chrooting, setting up a new kernel and various stuff, installing grub, and rebooting). It was remarkably painless. After the reboot, the rEFIt boot menu had an entry for Linux (with a cute penguin icon) next to the MacOS X entry, so I selected that and booted.

Kernel

I started off with the gentoo-sources-2.6.30-r1 kernel (and just today updated to -r2 with no trouble). Here’s my kernel config. I set up the uvesafb framebuffer console driver, which seems to work great.

Video

I installed nvidia-drivers-180.60. Previous versions did not compile against the 2.6.30 kernel. I created a minimal /etc/X11/xorg.conf file that only had 4 lines in it to set the video driver to “nvidia” and let the X server auto-config the rest. It appears to work fine; came up the first time at 1280×800 automatically. I didn’t test the external monitor support, as I don’t have any DisplayPort devices, and I didn’t buy the DVI adapter.

Display Backlight

The backlight didn’t work at first, because it looks for specific MBP models, and this new laptop has a newer model number. I simply patched the ‘mbp-nvidia-bl’ driver (update: see below for a better patch) in the kernel to add “MacBookPro5,5″ as a recognised model. However, the backlight controls for some reason do not work while X is running. I suspect the nvidia driver to be at fault here, but more investigation is needed. I’m going to give nouveau a try at some point to see if this fixes any issues (though of course I’ll lose 3D accel with that).

Update (2009/07/14): The ‘nvclock’ program is able to set the backlight brightness while X is running, so I ‘ported’ the code that does that to the kernel driver. It’s not the best patch in the world, but it’s here if you want to give it a try. I’m told that this is not really a correct way of fixing the problem, as it’s not reasonable to poke at memory addresses owned/reserved by another driver (nvidia, in this case). So expect that some weirdness might occur if you use my patch.

Keyboard Illumination

The keyboard illumination works. The ‘applesmc’ driver detects it and creates a LED-class device (you can see it in /sys/class/leds). The ‘pommed’ daemon is supposed to support this, but I haven’t tried it yet because it requires patching to support the “MacBookPro5,5″ string. Otherwise I can manually set the keyboard lighting via the sysfs interface (just to verify it works). The ‘pommed’ daemon will monitor the light sensor and adjust the keyboard brightness accordingly. I needed to patch it to get it to recognise the new model string. Apparently upstream already has a patch and support will work in the next release. I also patched it to increase some ridiculously-stupid battery-wasting 200ms timeouts into equally-useful 2s timeouts. Ideally it shouldn’t poll at all, but I don’t care enough to put in the work to make that happen.

Touchpad

The touchpad works with the ‘bcm5974′ kernel driver and xf86-input-synaptics X.org driver. Note that to make X.org correctly use the synaptics driver when you aren’t providing an xorg.conf file, you need a very recent version of the hal-info package (otherwise it will use the evdev driver). I also have a custom .fdi file to specify some extra options for the driver. Left click works, and 2-finger clicking for right click and 3-finger clicking for middle click work as well. Two-finger horizontal and vertical scrolling work fine. One major annoyance is drag and drop: with MacOS running, I can click and hold with my thumb, and drag with my index finger (while keeping my thumb still). With Linux, I have to click and drag with the same finger, which is very awkward. I filed a feature request about this.

WiFi

The WiFi works, but unfortunately not with the open source ‘b43′ driver, as that driver does not yet support Broadcom 802.11n chipsets. Broadcom provides a closed-source proprietary driver which seems to work decently, though the speeds I’m getting aren’t great, and it has a lot of trouble finding my 5GHz 11n AP sometimes (it finds the 2.4GHz 11g AP just fine though). Udev initially assigned the device the “eth1″ name, which I didn’t like, so I edited /etc/udev/rules.d/70-persistent-net.rules to change it to “wlan0″. NetworkManager works, though intermittently it won’t be able to find any APs (despite the fact that “iwlist wlan0 scan” shows APs). I anxiously await support from the ‘b43′ driver.

When compiling the Broadcom ‘wl’ driver, be sure to read the README on their website. The compilation is a little weird as they only provide a stub Makefile for use with the kernel’s build system. You’ll probably want to add ‘wl’ to /etc/conf.d/modules (or /etc/modules.autoload.d/kernel-2.6) to get loaded on startup. You may want to add ‘b43′ and ‘ssb’ to the blacklist in /etc/modprobe.d to be safe. If even the ssb driver gets loaded (even if b43 is not loaded), wl won’t work.

One oddity: wl requires the full suite of lib80211 helper modules, including the crypto ones. For some reason these don’t get built properly unless you compile another driver into the kernel that needs them, like CONFIG_HOSTAP (you can just compile it as a module).

Bluetooth

The bluetooth chipset is detected, using the standard ‘btusb’ driver. I haven’t tested functionality yet because Bluez 4 is giving me issues.

iSight Camera

The iSight works just fine with the ‘uvcvideo’ module. Interestingly, on this laptop I did not have to extract the firmware from Apple’s MacOS X driver. Oddly, sometimes the driver for it fails to load properly, complaining about not finding a “video chain” or something similar, but removing and reloading the driver usually fixes it (very occasionally a reboot seems to be required).

Sound

I haven’t been able to get sound to work yet. The snd-hda-intel driver appears to detect the device, and I can unmute it and change the volume, but playing .wav files using aplay doesn’t produce sound. I didn’t get any output from the dual-purpose audio in/out jack either. I’ve tried the patch here, as well as trying ALSA’s git repository, but no luck. My current guess is that Apple decided to use a new sound chip. I filed an issue report with ALSA here. My bug hasn’t appeared to gain any attention, but someone else’s post to alsa-devel has gotten some response, so it looks like this is being worked on.

Update (2009/07/10): There’s now experimental support for the Cirrus Logic codec in the hda-cirrus branch of Takashi Iwai’s sound-unstable-2.6 tree. I imagine this’ll end up in 2.6.31 or .32. I haven’t tried it yet, but it’s been reported to work on the MacBookPro5,5 (and was indeed the motivation for writing the codec support).

Update (2009/07/12): The new driver works for me, though the sound-unstable-2.6 tree is based on 2.6.31rc1 as of this writing, so it’s a little bit of a pain because neither the Broadcom wl driver nor the nvidia binary driver compile correctly against it. I whipped up a couple patches and submitted them to Gentoo’s bug tracker (for broadcom-sta, for nvidia-drivers), so hopefully they’ll get included in the portage tree soon (and presumably added to future releases). Here’s my new kernel config; you just need hda-intel with Cirrus Logic codec support. You could also compile it into the kernel, but I’ve left it as modules for now.

Suspend/Hibernate

Untested.

Update (2009/07/16): I wish I’d tested this first off, because suspend at least worked perfectly out of the box. No tweaks necessary. I just installed pm-utils and suspended via HAL (using xfce4-power-manager in my case). I imagine calling ‘pm-suspend’ from the command line would work as well.

Miscellaneous

Shutdown and reboot do not work. The system just halts and locks up. You’ll need to hold down the power button for 5 seconds to shut it off. On a rare occasion shutdown will actually power off the unit, but reboot has never worked. I suspect that dropping the BIOS emulation and booting in EFI mode will solve this problem.

USB works fine for mass storage devices, at least. The SD card reader is detected as a usb-storage device, and works as it should.

Firewire drivers load (I used the kernel’s “new” firewire stack) and detect the chipset just fine, but I don’t have any devices to test it with.

This laptop has an accelerometer (aka Apple Motion Sensor). It appears to work; I can read the machine’s orientation via sysfs, but I don’t know if there are any daemons that will watch it and park the heads on the hard drive if the laptop gets shaken/dropped. There are also other nifty things you can do with it that I haven’t tried.

All things considered, I’m pretty happy. I haven’t gotten to a point where I can give meaningful battery life numbers, but I’ll try to get to that soon. The machine seems to run pretty cool and quiet, even while compiling for a while. My only major outstanding issue is sound.

BIOS mode vs. EFI mode

In order to get shutdown and reboot working, I’ve been trying to boot in EFI mode, with no success yet. I’ve tried the latest SVN versions of grub2, but I’ve had a lot of trouble. rEFIt only seems to find grub.efi if I put it on the HFS+ MacOS X partition; if put it on the Linux partition, it doesn’t work. Running rEFIt’s EFI console and poking at the disk partitions seems to indicate that it’s failing to read the ext3 partitions for some reason.

Grub2 otherwise just seems very buggy. The config file parsing doesn’t appear to work (when grub2 loads, it prints messages about “menuentry” being an invalid command). Despite the fact that linux.mod is loaded, “linux” isn’t being recognised as a valid command. In fact, after I use many commands once, successive uses claim that the command is invalid. Even the “help” command doesn’t work (fortunately, hitting the tab key lists valid commands). I’ve mostly given up on grub2. One of the nice things about grub2 is that, if you boot in BIOS mode, you can dump your main and video BIOS images which grub2 can later load/emulate on bootup in EFI mode, which presumably would allow the nvidia drivers to work correctly.

So next I’ll be giving elilo a try. It apparently doesn’t have support for loading BIOS images, but maybe I can get that to work eventually.