A month with the Retina MacBook and Linux

I’ve been using the Retina MacBook for a month now, and I’ve got to say the experience hasn’t been all that smooth, but better than I had expected.

Graphics Cards

Using the latest kernel (I used 3.6.0-rc3, but 3.6.0-rc4 should probably work too), switchable graphics works to an extent. If you forcibly enable the Intel HD4000 GPU in OS X using gfxCardStatus, then reboot straight into Linux, you will be able to use the i915 kernel driver, and the intel Xorg driver. You can even switch to/from the NVIDIA GeForce GT 650m at runtime by prodding vgaswitcheroo. Unfortunately, you can’t boot up with the GeForce enabled (ie – without the gfxCardStatus hack) for now, because the Intel driver won’t bring up the eDP link properly.

If you use a recent xorg-x11-drv-intel, the screen backlight controls work fine. In Fedora 17 I had to enable the “testing” repository to get an up-to-date enough version of this package.

I found that using the Intel card on my rMBP causes the screen to artifact badly every so often. As far as I’m aware, nobody else has seen this issue, but I can’t reproduce it when using the discrete GPU, or when I’m booted into OS X and using the Intel GPU. I’m not ruling out a hardware issue for now, but if you do see this issue (it manifests as a screen updating issue where portions of the screen jump around very quickly) please let me know.

nouveau is an exercise in frustration. It works, but don’t expect any sort of hardware acceleration. The cursor blinks frequently. There’s no power management, so the laptop will physically run quite warm and the battery won’t last long. I recommend using the latest beta NVIDIA binary driver (version 304.43 at time of writing) if you’re planning to use the discrete GPU on this thing; it actually works surprisingly well.

If you do use the Intel driver, ensure you turn off the discrete GPU at runtime by echoing “OFF” to /sys/kernel/debug/vgaswitcheroo/switch.

Backlight control works when using the NVIDIA drivers only after the laptop has been put to suspend and resumed at least once.

Wireless

This is the worst supported piece of hardware, by far, in my opinion. It works to an extent, but the b43 driver frequently disconnects and exhibits high packet loss. It’s incredibly variable depending on the environment. I found that at the Mozilla office I would be disconnected every few minutes and I’d have to rmmod and modprobe b43 to even get it to reconnect, and even then the bandwidth throughput on the connection was terrible (I was seeing ~50kB/s on an 802.11g network). ndiswrapper is also flakey. In the end I gave up messing around with it and bought a cheap $13 USB dongle which uses a Realtek chipset, that works fine.

Keyboard

Mostly works out of the box. Backlighting works fine in latest kernels, you may need to set the brightness manually by prodding /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness with echo.

Touchpad

Works well enough with the xorg-input-mtrack driver, but can be a little flakey. Despite lots of tweaking, I still haven’t found a configuration that doesn’t register false clicks. My biggest issue is the case where I’m resting my thumb on the trackpad and moving the cursor with my index finger; when I want to register a left click, about 50% of the time it’ll register as a right click because it’ll think it’s a two finger touch. For now I’ve worked around this by setting three finger click to be right click, four finger click to be a middle click and single and two finger clicks to be a left click. My configuration is:

Section "InputClass"
MatchIsTouchpad "on"
Identifier      "Touchpads"
Driver          "mtrack"
Option          "Sensitivity" "0.35"
Option          "IgnoreThumb" "true"
Option          "IgnorePalm" "true"
Option          "TapButton1" "0"
Option          "TapButton2" "0"
Option          "TapButton3" "0"
Option          "TapButton4" "0"
Option          "ClickFinger1" "0"
Option          "ClickFinger2" "3"
Option          "ClickFinger3" "2"
Option          "ButtonMoveEmulate" "false"
Option          "ClickTime" "25"
Option          "BottomEdge" "25"
EndSection

Thunderbolt

Not working.

Audio

Speakers work fine, as does the mixer. Optical output is always on at boot (which is the source of the red LED shining out of the headphone socket); turn it off with:

amixer -c0 set IEC958 mute

Microphone doesn’t work.

Webcam

Works out of the box, but somewhat useless without the microphone.

Power Management

Seems to work pretty well. Seems to hover around 17W when not doing much, but can jump to 30W under normal usage. When compiling it jumps to 60-70W. If using the Intel GPU with the discrete turned off, you gain a few watts on average.

Kernel

Grab the vanilla 3.6.0-rc3 from kernel.org, then apply this patch to fix the gmux, and these patches to fix nouveau. Once that’s done you can just build the kernel as normal.

Pushing to git from Mozilla Toronto

Today, Ehsan and I set up a highly experimental git server in Mozilla Toronto, and it seems to be working relatively well (for now). If you want access, give me a ping and I’ll sort it out for you (should be accessible to anyone on a Mozilla corporate network, I think). We’re still ironing out the kinks though, so please only use it if you’re fairly well versed with git.

The server (currently accessible via “teenux.local”) hosts repositories mirroring mozilla-central, mozilla-inbound and a push-only repository for try:

git@teenux.local:mozilla-central.git
git@teenux.local:mozilla-inbound.git
git@teenux.local:try.git

To use it, you need to add a new section to your .ssh/config like this:

Host teenux.local
User git
ForwardAgent yes
IdentityFile path/to/your/hg/private_key

You may also need to register the private key you use for hg.mozilla.org with ssh-agent by doing:

ssh-add path/to/your/hg/private_key

That should be it. Now you can go ahead and clone git://github.com/mozilla/mozilla-central.git and set up a remote for the repositories hosted on teenux for pushing to. You can theoretically clone from teenux as well but given that the server isn’t anywhere near as reliable as github, I recommend you stick to github for fetching changes, and only use teenux for pushing.

There is a minor caveat: you must push to the master branch for this to work. So a typical command would be:

git push -f try my_local_branch:master

Enjoy!