Thursday, February 22, 2007

MacBook + Ubuntu (Edgy)

Notes on getting my brand new (arrived from apple.com on Tuesday) MacBook working with Ubuntu (single boot -- I only want Linux!):

  1. Ubuntu Edgy Server disc was unusable, b/c the keyboard isn't available at the CD menu screen and there's no timeout.

  2. Ubuntu Edgy Desktop CD (32-bit i386) installation went without a hitch.

  3. mouseemu under Edgy freezes the trackpad until I stop the service again.

  4. pommed under Feisty works 50/50. The function keys started doing the things they're supposed to, but I wanted them to be F-keys by default, and only do special things when I hold dow the 'fn' key. I couldn't make this happen.

  5. I was unable to get right/middle clicking to work until I installed xkbset and put the following in my .bash_profile:


    • xmodmap -e 'keycode 116 = Pointer_Button2'
      xmodmap -e 'keycode 108 = Pointer_Button3'
      xkbset m


    I can middle-click by holding down the right Apple key, clicking, and releasing the Apple key.

    The little "enter" key next to the arrow keys is a right-click.

  6. I installed mpd and mpc and sound is working fine, except that after a while I noticed:

    1. I'm only hearing the right channel of stereo sound through the internal speakers. It's playing only the right channel, through both speakers, as if it's mono.

    2. The internal speakers keep playing even when headphones are plugged in, as other people have experienced while running Windows on Intel-Mac hardware. *BIG FROWNY FACE* This is very annoying. I'm shopping for USB sound devices now (anticipating that there won't be a fix soon enough to suit me) and I'd really rather not be.

    Update: I just bought a USB Sound device that looks just like this one (different color plastic) for $15 from my local PC shop, and it came right up. Here's what showed up in syslog:

    Feb 23 14:28:14 kant kernel: [17239422.824000] usb 2-1: USB disconnect, address 2
    Feb 23 14:28:28 kant kernel: [17239436.988000] usb 2-1: new full speed USB device using uhci_hcd and address 3
    Feb 23 14:28:29 kant kernel: [17239437.144000] usb 2-1: configuration #1 chosen from 1 choice
    Feb 23 14:28:29 kant kernel: [17239437.228000] input: C-Media USB Headphone Set as /class/input/input20
    Feb 23 14:28:29 kant kernel: [17239437.228000] input: USB HID v1.00 Device [C-Media USB Headphone Set ] on usb-0000:00:1d.1-1
    Feb 23 14:28:55 kant kernel: [17239463.224000] usb 2-1: USB disconnect, address 3
    Feb 23 14:29:11 kant kernel: [17239479.864000] usb 2-1: new full speed USB device using uhci_hcd and address 4
    Feb 23 14:29:12 kant kernel: [17239480.024000] usb 2-1: configuration #1 chosen from 1 choice
    Feb 23 14:29:12 kant kernel: [17239480.108000] input: C-Media USB Headphone Set as /class/input/input21
    Feb 23 14:29:12 kant kernel: [17239480.108000] input: USB HID v1.00 Device [C-Media USB Headphone Set ] on usb-0000:00:1d.1-1


    I added an /etc/asound.conf file:
    kant ~ # cat /etc/asound.conf 
    pcm.!default {
    type hw
    card 1
    }

    ctl.!default {
    type hw
    card 1
    }

    ...and I modified my /etc/mpd.conf (this is only for people who use mpd instead of, say, xmms, or totem, or whatever) to have the following alsa output
    configuration:
    # use this if you want to use ALSA audio output
    audio_output {
    type "alsa"
    name "my ALSA device"
    device "hw:1,0" # optional
    format "44100:16:2" #optional
    }

    I couldn't be happier with a $15 usb sound card purchased at the last minute before a trip overseas. :)

  7. The madwifi drivers were insufficient (no wlan0 showed up in iwconfig output), so I eventually resorted to ndiswrapper, which has been working fine. (See further discussion here.) Note: I just installed ndiswrapper-utils-1.8, grabbed the D-Link driver, did ndiswrapper -i net5416.inf; modprobe ndiswrapper; echo ndiswrapper >> /etc/modules, and iwconfig listed wlan0 and I was good to go.

  8. Suspend failed to come back up with the backlight. I had to CTRL+ALT+F1 out of X, log in, and restart, without seeing what I was doing. :) (I don't have networking configured to start automatically, so I couldn't ssh into the system to restart it.)

  9. I am, as I type (on my desktop workstation) testing hibernation...(*BONNNNNGGGGGGG*, says the MacBook)...and we're booted successfully! Hibernation looks like a go.

  10. I haven't messed with iSight yet, but I've read that it doesn't work. I've got a copy of the MacOSX /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport file that desrt mentions here, so I expect to be able to get it working whenever I get around to it.

  11. Oh, yeah. CD ejection...I don't have that yet b/c pommed isn't available in Edgy. But just now, I added the following to my .bash_profile:

    xmodmap -e 'keycode 204 = F13'

    and the following to my ion2 configuration (yes, I know...I haven't even upgraded to ion3):

    kpress("F13", make_exec_fn("eject /dev/hda"))

    ...and now the CD eject key works as expected. :) (Use 'xev' to figure out keycodes, btw.)

  12. I also have the following in my .bash_profile to make the left Apple into "Alt" and the "alt/option" key into a "Windows" (Super_L) key. I haven't yet gotten this to work with my normal ion2 bindings to manage mpc (music player), but someday I will...

    xmodmap -e 'keycode 115 = Alt_L Meta_L'
    xmodmap -e 'clear mod1'
    xmodmap -e 'add mod1 = Alt_L Meta_L'
    xmodmap -e 'keycode 64 = Super_L'
    xmodmap -e 'clear mod4'
    xmodmap -e 'add mod4 = Super_L'


  13. The resolution comes up as 1024x768, but installing 915resolution and restarting X (or the whole system) gets me 1280x800 pixels.

  14. Resources:

    1. Google :)

    2. desrt's "Ubuntu Edgy on the Apple Macbook" page

    3. Debian Wiki MacBook page (I didn't use it, but I wish I'd found it earlier)