2006 Apple iMac - Getting iSight Webcam to work

Hey all. Been using NixOS for about 8 months and learning more and more as I go along. I’ve used Linux for many years but with most hardware working out of the box, I haven’t had to dabble too far in getting more complex hardware working.

In this case, I have 64bit NixOS installed and running on a 2006 Apple iMac. The only thing that I can’t get to work is the iSight camera that is built-in. I’ve done a bit of searching and it seems like other distributions require an “isight.fw” firmware file be extracted from Mac OSX. All my searching has lead me to " isight-firmware-tools" that I cannot find in NixOS package search. Instead, I installed this on a VM running Ubuntu and managed to extract said “isight.fw” file and bring it to my NixOS iMac.

Most distro’s instructions say to put this file in /lib/firmware - but I know NixOS doesn’t follow those conventions. Instead, I used this snippet in my configuation.nix file to try to get it installed:

hardware.firmware = [
(
pkgs.runCommandNoCC “isight-webcam” { } ‘’
mkdir -p $out/lib/firmware/isight
cp ${./firmware/isight/isight.fw} $out/lib/firmware/isight/isight.fw
‘’
)
];

After doing a rebuild and a shut down, I brought the system back up and saw “isight.fw” in the Store:

/nix/store/slvhdm051mmr2bjq0lwbll03b6zw6mvg-isight-webcam/lib/firmware/isight/isight.fw

However, I’m not having any luck. When looking at dmesg:

[ 33.874827] usb 5-4: Direct firmware load for isight.fw failed with error -2
[ 33.874837] Unable to load isight firmware
[ 33.874890] usbcore: registered new interface driver isight_firmware

Additionally, I see no “video0” device in /dev as other articles lead me to believe I should be seeing. Any help would be appriciated!

(note that you posted in the french section, not sure why?)

I’m not a mac expert at all, neither a kernel expert but here are a few remarks on the top of my head:

  • for sanity check, have you doubled checked that the file appears in /run/current-system/firmware?
  • Are you sure the file should not be put instead in $out/lib/firmware/isight.fw? If I inspect the debian package isight-firmware-tools package : Ubuntu it is where udev seems to look for it as it prints a rule:
ACTION=="add", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8300", RUN+="/usr/lib/udev/ift-load --firmware /lib/firmware/isight.fw"
  • if you extract the .deb from the package https://launchpad.net/ubuntu/+source/isight-firmware-tools, you can see in the readme a line no kernelspace Apple driver loading ! suggesting that the firmware is not loaded by the kernel itself, but rather by udev in userspace using the above rule. So you might want to package instead the above deb (should be a matter of using dpkg -x on it to extract it to the good folder, and maybe fix the udev rules to point to the proper folder and add auto patchelf hook). For reference, here is the full README (usr/share/doc/isight-firmware-tools/README):
This project provide tools to manipulate firmware for Built-in iSight
found on Apple machine since iMac G5 iSight (November 2005).

Those tools are based on the work from Ronald S. Bultje and are
licensed under the term of the GPLv2 or later. There are currently
(2010) maintained by Étienne Bersac.

See https://launchpad.net/isight-firmware-tools/ for bugs, code and
more informations.

ift-extract :
—————————————

        ift-extract extracts isight.fw from any AppleUSBVideoSupport
        driver from Darwin. This driver is located in
        /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport
        on your Mac OS X root partition.

ift-load :
——————————

        ift-load load a firmware extracted by ift-extract right into
        the iSight. This tool is meant to be called by udev. (see
        isight.rules udev rules file provided).

ift-export :
——————————

        Exports a firmware extracted by ift-extract as Intel HEX
        format for load with fxload. Note that the RAM size of the
        Built-in iSight seems larger than 8KB, therefore fxload refuse
        to load the end of the firmware into the chip.

and the HOWTO:

The following steps allow you to have a clean support for Apple
Built-in iSight on both PPC and intel Macintoshes. No kernelspace
Apple driver loading !


 * Install latest isight-firmware-tools.

   /!\ Configure --sysconfdir=/etc (autotools bug?)  in order to have
       the udev rules properly installed.

            ./configure --sysconfdir=/etc && make && sudo make install

 * Get any AppleUSBVideoSupport from your Mac OS X partition and
   extract the firmware using ift-extract. ift-extract default output
   to /lib/firmware/isight.fw, so run as root :

            sudo ift-extract --apple-driver AppleUSBVideoSupport

 * Load the firmware manually or reboot

            sudo ift-load --firmware /lib/firmware/isight.fw


Tested with gstreamer-properties, ekiga, cheese 0.2.3 (cheese 0.2.4
fails, 0.3 not tested).

(Adjusted this so it’s no longer in the French section. Whoops!)

Thank you for your reply! I’ll be able to put this advice to practice tomorrow. :slight_smile:

So now that I’ve had a chance to revisit the iMac, I have some really good news!

First, thank you @tobiasBora because your tips pointed me in the right direction. Turns out, the only thing I needed to do differently was have the isight.fw file copied to $out/lib/firmware/isight.fw instead of the subfolder that my previous configuration used. I got that snippet from someone trying to install some Broadcom Wifi firmware and I clearly didn’t adapt it quite right on my first attempt. :smile:

For anyone trying to get this to work themselves, this snippet of my configuration.nix file now looks like this:

hardware.firmware = [
(
# Copy the Apple iSight Webcam firmware into the appropriate directory
pkgs.runCommandNoCC “isight-webcam” { } ‘’
mkdir -p $out/lib/firmware
cp ${./firmware/isight/isight.fw} $out/lib/firmware/isight.fw
‘’
)
];

(This assumes it can find isight.fw in /etc/nixos/firmware/isight/isight.fw)

After a rebuild:

$ dmesg | grep iSight
[ 1.432201] usb 1-4: Product: Built-in iSight
[ 35.017409] usb 1-4: Found UVC 1.00 device Built-in iSight (05ac:8501)

$ l /run/current-system/firmware/ | grep isight
lrwxrwxrwx 1 root root 86 Dec 31 1969 isight.fw.xz → /nix/store/mdsf41r66y9vqpxzmz5k9kgd9r16pnvv-isight-webcam-xz/lib/firmware/isight.fw.xz

$ l /dev/video*
crw-rw----+ 1 root video 81, 0 Nov 21 14:03 /dev/video0
crw-rw----+ 1 root video 81, 1 Nov 21 14:03 /dev/video1

And most importantly, the “Camera” app in Pantheon can now access the built-in webcam!

1 Like