27 May 2005 08:04

zd1201 USB Wireless Adapter

The Airport Extreme in the iBook is currently a lost cause for linux (curse Broadcom), but the workaround is fairly cheap and not too inconvenient. I bought a GigaFast WF741-UIC 802.11b USB wireless adapter, which has the ZyDAS zd1201 chipset, and it works great in linux. I haven't got kismet to run yet, although it does do monitor mode and I've heard of people getting kismet to work with the old wlanng-based driver, so it's probably just a matter of time.

The driver (but not the firmware) is included in 2.6.12-rc5, but not 2.6.11.10. So I recommend picking up a 2.6.12 or higher kernel, but aside from a poorly-packed tarball building the module separately isn't hard either. I had trouble getting Ubuntu to load the firmware, and the solution is apparently to get more recent hotplug scripts. It has worked perfectly in Debian from day one.

waproamd doesn't want to work, nor does wpa_supplicant, so I'm writing my own autoconnect scripts. That's ok though, because I've never really been impressed with waproamd, and wpa_supplicant is much too complicated for simple wep authentication. The saddest thing, right now, is that I can't just put the computer to sleep and have wireless when it wakes up. I have to take the card out before sleep and put it in after, and since I don't yet have it automatically configuring I also have to configure it on resume too. I've seen a patch for this, but it didn't work for me.

22 May 2005 09:49

iBook caps lock as control in Linux

The short version of this saga is here: http://www.xmission.com/~fugalh/capslock/

ADB keyboards (like the one in my iBook) send the following events (oversimplified) on caps lock presses:

caps pressed on:  0x39
caps released:    0xff
caps pressed off: 0xff
caps released:    0xb9

Those 0xff events are not true caps lock events, they are some sort of special not-quite event. They probably aren't even mentioned in the spec. In any case, the linux kernel uses this logic to deal with this interesting hardware quirk: on 0x39 and 0xb9 both, generate both a key press and key release event, and do nothing for the 0xff events (or at least, nothing related to caps lock). This makes caps lock work perfectly, but it also makes it impossible to remap caps lock to a modifier because there is no way to hold down the key.

But in practice those 0xff events are mostly generated by caps lock. This is how uControl and Tiger remap caps lock to control. The patch at the above link will give linux the ability to do the same thing, with the same caveats. The only difference is that that patch is changing the kernel behavior for caps lock, not only when caps lock is remapped, so if you don't remap caps lock you might end up with an inverted caps lock occasionally. Depending on your personality, that may really bug you. Personally, I can't see the caps lock light through my hands anyway, so it doesn't bother me. (Not that I'd ever have caps lock as caps lock…)

And now you know the rest of the story.

22 May 2005 09:10

3-button emulation on an iBook

Google is full of old information, or misinformation, about getting 3-button emulation on an iBook. Here is the real story (for vanilla 2.6.11.10 on Debian, anyhow):

echo 1 > /proc/sys/dev/mac_hid/mouse_button_emulation

Middle click is fn-ctrl, and right click is fn-alt. I wasn't excited about F11/F12, or alt-2/alt-3, but this I think I can get used to. To make it permanent, you want to do this:

echo dev.mac_hid.mouse_button_emulation=1 >> /etc/sysctl.conf

If you don't have that proc file, you probably don't have MAC_EMUMOUSEBTN compiled into your kernel.

21 May 2005 09:31

Trackpad Sensitivity

I thought the trackpad in XFree86 (Debian) on my iBook was set to turbo or something. I tried xset m 1 and that helped but it was still too sensitive. The problem turned out to be something I didn't expect: both the "Configured Mouse" and "Generic Mouse" sections were sending events. I changed two lines in my ServerLayout section, so it now looks like this:

Section "ServerLayout"
    Identifier    "Default Layout"
    Screen        "Default Screen"
    InputDevice   "Generic Keyboard"
    #InputDevice  "Configured Mouse"
    InputDevice   "Generic Mouse" "CorePointer"
EndSection

My trackpad has dropped out of warp.

18 May 2005 07:34

Sleep on iBook G4 with Radeon 9200

There's a problem with sleep on the iBook G4 with Radeon 9200 under linux. It will go to sleep just fine, but will not wake up properly.

The problem is related to DRI. If you disable DRI in /etc/X11/XF86Config-4 (or xorg.conf), it works great. It also works great if you don't use X at all, although if you use X once and then exit the problem still exhibits itself.

The great news here is that you don't need to disable DRI, because there's an option that will fix things. The magic option is AGPMode, which you want to set to 4. Here's my Device section:

Section "Device"
    Identifier "Radeon Mobility 9200 M9+"
    Driver     "radeon"
    Option     "UseFBDev" "on"
    Option     "AGPMode"  "4"
EndSection

Voilá! Perfect sleep. Supposedly, the kernel is supposed to take care of that AGP mode stuff but it isn't doing so properly, so in future kernel versions (I am using 2.6.11.10) it may work without this option.

Working sleep, along with working wireless (I will blog the USB wireless adapter soon), has made linux a viable alternative to OS X for me. We shall really see which one I will gravitate towards, now that the showstopping barriers are gone.

14 May 2005 10:30

Ubuntu on the iBook

I've done it—I've installed, configured, and used Ubuntu linux on my iBook. (gandalf) I made a checklist of things that I feel are important and will tell you how Ubuntu did out of the box, (which is the primary advantage of one distro over another), and whether I was able to get it working with effort (or saw the light in the tunnel).

The first category is power management. Decent power management, especially sleep, is essential for any laptop. First the good news: thermal control and battery/AC reporting work great out of the box with Ubuntu. So does cpufreq, although I haven't decided yet if it needs to be tweaked. The fan comes on more often than in OS X, but I've heard complaints of overheating in OS X so maybe it's doing the Right Thing™.

Now the bad news: sleep is out. It goes to sleep just fine, but it's more like a coma than sleep. When you go to wake it, it makes hard disk sounds and the caps lock light works, but there is no screen activity and apparently the kernel locks up. I hear rumors that this might work later, and that it does work now for some people. Sacrificing 3D acceleration is one thing people say works. I tried leaving X altogether and it still behaved the same.

The next category is network support. The ethernet card works out of the box. I haven't tried the modem. The @#!% Broadcom wireless card does not work, of course. There are affordable USB wireless adapters that work great though, so this is more an inconvenience, and one I was aware of when I bought the laptop.

Caps lock must be remapped to control. I've had no luck with that in linux yet, unhappily. (No, xmodmap doesn't work, although you can disable caps lock with xmodmap.) It must be possible though, because it works in OS X (even built into the preferences in Tiger), so eventually it will work in linux as well.

Sound support is decent. The ALSA mixer is a little confused about capture devices, but capture does work. Playback of course works, but there's only one channel (I've been spoiled in this area before). I fired up JACK and used the XMMS JACK plugin for a few songs—no xruns. That doesn't exactly comprise a stress test, but it is much better than some environments I've been in, so that's a good sign.

Video works out the box. No futzing with the X config. I assume there's 2D acceleration, and there definitely is 3D acceleration. This brings us to one of the most important reasons for me to dual-boot linux on my iBook: FlightGear. I just don't have the RAM (256MB) to run both FlightGear and OS X. FlightGear runs very well in linux, even with GNOME.

Video out didn't work when I plugged another monitor in. I think this is possible, but I haven't done the research on it. I was slightly disappointed that I didn't get mirror out of the box. I'm slightly excited about the supposed possibility for Xinerama.

DVD support works, although Totem player (the default GNOME action when you insert a DVD) does some very strange things indeed, none of which is actually play the DVD. It confuses the battery meter, which decides to tell me I have less than 5% battery life, when in reality the battery is at 85%. It causes the mouse to stutter, and in fact once killed the mouse altogether—I had to reboot to get it back. So that's a lose for Ubuntu. I installed ogle and it works well, although DVD playback isn't smooth like in OS X for some reason. All in all, when I watch DVDs I'll probably do it in OS X.

And now for the miscellany. HFS+, check (after loading the hfsplus module). USB, check. CDROM and CD writing, check.

Overall, support for the iBook in linux is great. As far as I can tell, the only component with a dismal outlook is the Airport Extreme, which is easily worked around. There's still a bit of fiddling that needs to take place to bring linux up to snuff with OS X, but it looks like it's all doable.

09 May 2005 22:44

Quoits

My wife and I enjoy the occasional game of Scrabble. We have too much fun trying to fake each other out and making each other laugh to bother with keeping score. One of the best things about playing Scrabble this way is the words that you can discover. I will often try to play a word that I know nothing about, but very imaginably could be a real word. It makes me look smart, or funny, depending on whether it really exists. (This same tactic works just as well, perhaps better, in Boggle.)

It was in that way that I discovered quoits tonight. I had thought horseshoes started out with horseshoes, but it turns out to be much older than that, and in fact is directly related to the discus.

02 May 2005 23:06

Tiger First Impressions

I upgraded to Tiger today. The question on everybody's mind is, would I have paid for it? The answer is still probably no, but there are some very important improvements over Panther, at least from my perspective.

First, Dashboard is just as cool as it looks, although not as fast as I'd imagined (there are noticeable delays in e.g. the hula dancer almost every time, and CPU usage is nearly pegged while it's open). Spotlight looks useful, but I'm not yet sure whether the indexing is going to be bad for my battery. More investigation will be needed there.

Tiger has ruby 1.8.2, and unlike Panther's 1.6 it seems to be fully enabled with Tk. (I can't say for sure that that's not because I had installed TkAqua prior to upgrading in an attempt to get Tk working before) The upshot of this is that you can write ruby GUIs that don't require users to do any voodoo, not to mention all the benefits of 1.8 over 1.6.

Some say it's faster. I haven't noticed. If anything it seems slower (and my laptop seems hot). This may be temporary or configurable; more investigation is in order. I do understand that gcc4 does a superb job of optimizing for the platform though.

Last, but not least, Tiger supports remapping CAPS to Control right out of the box.