Archive

Archive for the ‘macbook’ Category

Enable Apple iSight Camera : Ubuntu 8.10

November 3rd, 2008 Christer Edwards 21 comments

Have you been to a geek conference lately and noticed the overwhelming number of MacBooks and MacBook Pros in the audience?  When I presented at OSCON this last summer it was by far the most popular piece of hardware to be seen.  Now I don’t want to get into a conversation about Apple or OS X, but I do want to help all you MacBook owners running Ubuntu get your hardware working properly.  This post outlines how to retrieve and extract the required firmware in order to enable your Apple iSight camera on Ubuntu 8.10 “Intrepid Ibex”.

Get the firmware

There are a few ways to get the required firmware.  The first requires that you have an existing OS X installation.  If you’re doing a dual-boot installation you can find the firmware at the following path within your OS X partition:

/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport

You might also be able to find the firmware file at this link.. but for possible legal reasons (?) I wouldn’t know anything about that.

Extract the firmware

Once you have the required firmware you’ll need to extract it to your system.  If you’re running Ubuntu 8.10 “Intrepid Ibex” there is a package available that’ll do the extraction for you.  Use the following command to extract and install the firmware:

sudo aptitude install isight-firmware-tools
sudo cp ~/Desktop/AppleUSBSupportVideo /lib/firmware/
sudo ift-extract -a /lib/firmware/AppleUSBVideoSupport

This should create a file called “isight.fw".  Once you have this file you can safely remove the package and the AppleUSBVideoSupport file.  Keep the isight.fw file for future installations.  This will let you avoid the firmware extraction in the future.

note: if you are using Ubuntu 8.04 “Hardy Heron” you can use the isight-firmware-tools package from the intrepid repositories.

amd64 package

i386 package

Activate the camera

In order for the firmware to activate properly you will need to shut down your MacBook.  Rebooting will not suffice!  Enjoy.

If this article has been helpful, please consider linking to it.

Extended Display on the MacBook (with xorg.conf) : Ubuntu 8.04

April 28th, 2008 Christer Edwards 2 comments

I’ve blogged in the past about setting up extended display on the MacBook (second gen), but I thought I’d update the post for Ubuntu 8.04.  I notice there are some small differences, which are likely caused by the updates to Xorg.  I’ll post my steps and my xorg.conf file below.

Extended Display on the MacBook

First, I tried to use the new Screen Resolution tool but it did not detect either monitor properly.  It does detect the MacBook display when it is the only display, but when my external monitor is plugged in everything gets screwed up.

I had to do things by hand using xrandr, and I had to add three lines to my xorg.conf file.  There isn’t much to it, but not as straight-forward as it could be with the graphical tools.

  1. The first step is to figure out the sum of both resolutions.  ie; 1280×800 + 1440×900 = 2720 x 1700.  Take the resolutions from your MacBook (which should be 1280×800) and add it to the resolution of your external monitor.  Make note of the result.
  2. Update your xorg.conf file to include the new, combined, resolution (example below)
  3. Restart X (logout & login or ctrl-alt-bkspace)
  4. xrandr –output VGA –auto
  5. xrandr –output VGA –above LVDS

Here is a copy of my xorg.conf file.  It is default except for the three additional lines:


# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section “InputDevice”
Identifier    “Generic Keyboard”
Driver        “kbd”
Option        “XkbRules”    “xorg”
Option        “XkbModel”    “pc105″
Option        “XkbLayout”    “us”
Option        “XkbOptions”    “lv3:ralt_switch”
EndSection

Section “InputDevice”
Identifier    “Configured Mouse”
Driver        “mouse”
Option        “CorePointer”
EndSection

Section “InputDevice”
Identifier    “Synaptics Touchpad”
Driver        “synaptics”
Option        “SendCoreEvents”    “true”
Option        “Device”        “/dev/psaux”
Option        “Protocol”        “auto-dev”
Option        “HorizEdgeScroll”    “0″
EndSection

Section “Device”
Identifier    “Configured Video Device”
EndSection

Section “Monitor”
Identifier    “Configured Monitor”
EndSection

Section “Screen”
Identifier    “Default Screen”
Monitor        “Configured Monitor”
Device        “Configured Video Device”

# added SubSection “Display” until EndSubSection
SubSection “Display”
Virtual 2720 1700
EndSubSection

EndSection

Section “ServerLayout”
Identifier    “Default Layout”
Screen        “Default Screen”
InputDevice    “Synaptics Touchpad”
EndSection

Categories: macbook Tags: , , ,

Microphone Support on the MacBook (Skype 2 Supported)

December 30th, 2007 Christer Edwards 2 comments

So I posted recently on how to get the camera working in Skype 2 Beta on the MacBook. One of the most common questions after that post was “But how do I get the microphone to work!?” So, I started toggling switches and trying stuff out until I could reproduce working microphone input. I did have this working in the past and I guess I must have lost the settings so I had to find them again…

Microphone on the Macbook

To get started right-click on the volume applet up near the clock and select the “Open Volume Control” option. This should open the volume control mixer application. What you’ll want to do within this application is select “Edit > Preferences”, which will present you with a long checklist of potential hardware items. The only items I have checked here are:

  • PCM
  • Input Source
  • Mux

PCM should be your main volume for audio output for best control. You can set that from the “Preferences” menu of the volume applet.

Input Source allows you to select the source of the microphone. Mic, Front Mic or Line.

Mux is the device/option I’m using for the Microphone input.

I have the “Playback” tab, on PCM, set to full and use the hardware keys to control volume. “Recording” tab, on Mux, is set to 1/3 volume. I find that I get too much static and noise set too far above that. “Options” is then set to Mic as the input.

Calls in Skype now sound great incoming and outgoing and the video works really well. I hope these similar settings work for everyone else. If you need to use alternate settings please leave a comment.

UPDATE: these instructions have been added to the Ubuntu community wiki as well. Ubuntu on the Macbook.

Categories: macbook Tags: , ,

Video Chat Support with Skype 2 Beta on MacBook : Ubuntu 7.10 “Gutsy”

December 21st, 2007 Christer Edwards 7 comments

So I’m back with Ubuntu now after a week of testing the Fedora waters. Wow its nice to be back in the living of the “Just Works”! There were far too many things that didn’t work in Fedora.. too frustrating for me.

In any event, one of the first things that I tried setting up after getting back to Ubuntu is the Video Chat support for the new Linux client, which is now supported on the MacBook. When it was first released a month or so ago the MacBook hardware was not supported. Add a bug report and a little time, and we’re in business. It’s actually pretty easy to get going, so I’ll dive right in.

iSight Firmware

The one critical part that you need to get the camera supported in both Skype and Ekiga is the Apple USB Support Firmware, available as part of a default Apple OS X installation. You’ll either need access to your OS X partition, or get the file from the DVD somehow. (I don’t really want to get into how to try and pull it off the DVD, granted you need a copy of:

AppleUSBVideoSupport

Drop this file into the directory “/lib/firmware/$(uname -r)” and restart the machine. When it comes back up you’re camera should be supported.  For more details see the community maintained Ubuntu on the MacBook wiki.

Skype 2 Beta for Linux – With Video!

Now that you’ve got the hardware supported head over to the Skype website and grab yourself a copy of the beta client for Linux. I’ve got a handy link for you right here:

Download Skype for Linux

Select the copy for Ubuntu.  (I know its listed as Ubuntu 7.04, but it works just fine on Ubuntu 7.10 as well).  Double click the saved .deb package, or open with Gdebi Installer and get it installed.  Once you’re done you should instantly be able to enjoy video chat with all of your Skype using friends.  Enjoy!

Categories: macbook Tags:

Extended Video on the Macbook : Xrandr ftw!

November 25th, 2007 Christer Edwards 5 comments

Update: I wrote this quite a while ago and never posted it pending more testing.  I figure it can be helpful in its current state to more users than just myself.  So, in the spirit of release early, release often here are steps that I took for configuring extended display on my MacBook. 

Based on the flood of feedback yesterday with suggestions on getting the extended display setup I’m going to attempt to blog what I have figured out. I’m still not 100% on the steps yet but hopefully this’ll help people get started and perhaps work some of the kinks out of the setup. I would like to get a better proper tutorial, but for now I want to get this written down while its fresh in my memory.

  1. I had some odd issues if both displays were connected at login prior to configuration. Login to your desktop without the external monitor connected. Connect the monitor after you’ve completely logged in.
  2. Connect the external monitor and generate a new default xorg.conf (sudo dpkg-reconfigure -phigh xserver-xorg).
  3. Figure out the highest resolution you want between the two screens (1440×900+1280×800 = 2720×1700). Calculate based on what you have. In my case my external does 1440×900. I add that to the 1280×800 of the macbook and get my total.
  4. Edit your xorg.conf file and add the line to the Section “Screen” > SubSection “Display” area. Add Virtual 2720 1700 (your resolution).
  5. Log out after saving the xorg.conf file (unplug the external monitor until after you’ve logged back in successfully)
  6. xrandr –output VGA –auto
  7. xrandr –output VGA –above LVDS

In further testing I no longer have the issue in step 1, 5 above, but I leave it there as others may have similar problems.  In regards to my hardware I am using a MacBook with an onboard intel video card.  Card information via lspci output:

00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)

I now use extended desktop quite a bit and the only “issue” is that compiz-fusion is disabled if the resolution goes this high.  Not a big issue, but something to be aware of.  I hope this helps some more of you get extended display working.  It’s very nice :)

Categories: Hardware, macbook Tags:

Enabling the Motion Sensor on the Macbook for Physical Neverball!

October 31st, 2007 Christer Edwards 13 comments

How many of you have played Neverball raise your hands? If you actually raised your hand you get a cookie. If you haven’t played Neverball and you have a Macbook you’re going to start playing because this tutorial makes it *so* much more fun! We can make use of the motion sensors built into the Macbook hardware to allow us to play physical neverball.

Activating the driver

We’ll need to load the proper module into the kernel for this to work. We can do that using this command:

sudo modprobe applesmc

If you want this module to automagically load at boot time you can also use this command:

echo applesmc | sudo tee -a /etc/modules

Launching Neverball

You’ll now want to pick up a copy of the game Neverball which is available in the repositories.

sudo aptitude install neverball

Now launch the game (you’ll find it in your Games menu, or via the command neverball). Select “Play”, select your difficulty level and start the game. Now, here’s the best part, pick up your Macbook to play. Trust me, pick up the macbook and tilt the actual laptop to control tilting the floor within the game. Now that’s playing games with your laptop!

For the rest of you that want to play but don’t have the motion sensors you can just use your boring old mouse to play. Enjoy!

Categories: macbook Tags: ,

Enabling Suspend on the Macbook : Ubuntu 7.10

October 25th, 2007 Christer Edwards 5 comments

In continued testing on my macbook it appears that I have suspend working solidly. If you enjoy this feature you may want to look into this tutorial. I have never really used suspend/hibernate much in the past because it has been buggy, but now that it appears to be working well I think I may give it a try.

note: To use suspend (in my experience) on the macbook you have to downgrade the 2.6.22-14 kernel (current in 7.10) to the 2.6.22-12 kernel. I don’t think there are many huge changes between the two, and I have not seen a loss of other functionality, but I figured I should get that out of the way right at the start. If you’re not comfortable reverting your kernel or know a specific reason you should not, you can stop reading here.

Suspend on the Macbook

Suspend is a nice feature that lets you virtually “pause” your machine to be brought back in its exact state at a later time. This is very nice for laptops and mobile machines that are always on the go and going up and down quite a bit. The current kernel in Ubuntu 7.10, the 2.6.22-14 kernel, has a few issues with suspend. It will allow machines to go into suspend, but not properly come back again. (bug #151016).

Installing the required kernel packages

As mentioned above the last known kernel version to properly support suspend on the macbook (and some other models – see the bug report for details) is the 2.6.22-12 kernel. The following steps will help you install the packages needed in order to run that kernel version and enable the suspend feature. Install the following packages in this order:

  1. sudo aptitude install linux-image-2.6.22-12-generic
  2. sudo aptitude install linux-headers-2.6.22-12
  3. sudo aptitude install linux-headers-2.6.22-12-generic
  4. sudo aptitude install linux-ubuntu-modules-2.6.22-12-generic
  5. sudo aptitude install linux-restricted-modules-2.6.22-12-generic

You’ll next need to update your grub settings to use this kernel instead of the current latest automagically at boot time. If you are running the stock Ubuntu 7.10 installation with the 2.6.22-14 kernel (at the time of this writing this is the only kernel released for 7.10) it is a very simple update. Edit the /boot/grub/menu.lst file and change the default line from 0 to 2.

If you have other kernel images installed take a look into the file, view the boot entries near the bottom and look for the one listed as 2.6.22-12. Count down from the first entry starting with 0 (ie; 0,1,2,3…) and replace your default line to that number. REMEMBER GRUB STARTS COUNTING AT ZERO, NOT ONE.

At this point you should be able to reboot and test suspend. In my use it has been solid since making the above changes. Also note that if you have compiled anything against your previous kernel you’ll need to do it again for this version. (ie; if you followed yesterdays post about compiling wireless support for the macbook you’ll need to repeat those steps.)

Categories: macbook Tags:

How To Enable Wireless Networking on the Macbook : Ubuntu 7.10

October 24th, 2007 Christer Edwards 20 comments

With the new release of Ubuntu 7.10 I figured I should go back and revisit some of my macbook specific tutorials.  Today I’ll touch on configuring / enabling wireless on the macbook (second-gen) in Ubuntu 7.10.

Enable Wireless on the Macbook

  1. sudo aptitude install build-essential
  2. wget -c http://snapshots.madwifi.org/madwifi-trunk-current.tar.gz
  3. tar -zxf madwifi-trunk-current.tar.gz
  4. cd madwifi-ng-*
  5. make
  6. sudo make install
  7. sudo modprobe ath_pci
  8. sudo modprobe wlan_scan_sta

You should now be able to scan for wireless broadcasts and connect to available networks without restarting your machine.  Enjoy.

Categories: macbook Tags:

Installing Ubuntu on a Macbook : Tutorial (beta)

August 2nd, 2007 Christer Edwards 10 comments

This tutorial has been a long time in the making and it isn’t completely done, but I wanted to release it for some suggestions, comments and cleanup. I set out to write a comprehensive, step-by-step guide for installing Ubuntu. It basically starts from taking the Macbook out of the box to configuring networking, video, right-click, fn-keys, etc. There is a complete outline at the top of the tutorial.

Based on the length of this writeup (easily the longest writeup I’ve done to date) I will not post it here in the blog contents. For this beta-tutorial (if there is such a thing) I am linking to the original text file. If any of you have a Macbook and are interested in trying these steps feel free. As usual the responsibility is in your hands on any data loss, but that is also outlined in the tutorial.

Any questions, comments, suggestions or further tips please leave comments here. Otherwise, click the link below to take a peek at the document.

Ubuntu on a Macbook (text file)

Categories: macbook Tags:

How to setup wireless on a macbook using madwifi : 7.10 “Gutsy”

August 2nd, 2007 Christer Edwards 12 comments

Update : Improved instructions available on a more recent post here.

I have been using ndiswrapper for wireless support for some time now due to the Core 2 Duo Macbook series not working with the madwifi drivers. You may remember a previous tutorial I wrote on Configuring Wireless using ndiswrapper. That tutorial is all fine and great if you don’t mind a little non-free running in your blood. This tutorial will let you use the more free madwifi system, but it may only work on Ubuntu 7.10.

Can one of the Ubuntu packagers get this into Gutsy? The current package version is too old from what I can tell.

On with the show…

To get the driver support (until a proper package is created) we’ll need to compile it from source. If you’re not familiar with doing that you should be fine in this case as I’ve outlined the steps as best I can. If you run into any weirdness leave a comment and we might be able to get you figured out. Follow the below commands and you should be fine.

sudo aptitude install build-essential

wget http://snapshots.madwifi.org/madwifi-hal-0.9.30.13-current.tar.gz

tar -zxvf madwifi [tab]

cd madwifi [tab]

make

sudo make install (answer 'r' when asked about previous modules)

at this point you should be able to reboot and wireless should work. I have tested it with unencrypted and WEP connections, but not had a chance for WPA yet. Anyone able to verify functionality with WPA?

Also, if you have followed my previous tutorial on using ndiswrapper you’ll want to make sure that module doesn’t load at boot anymore. (You may want to leave it installed as a backup driver or something, but remove the line ‘ndiswrapper’ from the /etc/modules file.) Enjoy.

Categories: macbook Tags: