How To: Build OpenKinect/LibFreenect in Linux

The Kinect just came out in Australia today, so I’m already a little bit late to the party, but I’m keen to see what I can do with it so I went and picked one up earlier – a couple of minutes after unboxing and it’s happily working with Linux. Awesome =D

The GLView example running on LibFreenect
The GLView example running on LibFreenect

Anyways, here’s what you need to do to build the library for yourself:

  1. Using synaptic or apt-get, install the following packages: libusb1.0-dev, freeglut3-dev, git, cmake
  2. It’s possible you may need to install some other packages as well depending on what you currently have or don’t have installed, but if you need anything additional then cmake will let you know about it when you get to that step.

  3. Download the libFreenect source code using git (this will make a directory for you called libfreenect):

  4. Make a directory inside the c folder where you’ve downloaded the libFreenect source code and use cmake to configure the build:

  5. Actually compile the library:

That’s it – you’re done!

Now you can check out what the kinect’s seeing by going into the examples directory (which will now exist at ~/libfreenect/build/examples) and running ./glview as root:

I think we’re going to have a lot of fun with this… =D

Kinect Hacked – Open-Source Drivers Available!

Woo-hoo! Microsoft’s Kinect computer vision hardware for the XBox 360 (which uses the structured light technique for motion detection) now has open source Linux drivers available for it – and it took one talented hacker a whole three hours to do it!

Read more here.

To re-appropriate Sony’s marketing pitch: This changes Everything =D

Unrelatedly, the dude in the video has the exact same laptop as me – an Acer 8920G, unless he has an 8930G which has an additional TV-Tuner card.

How To: Get a Canon MP240 Printer Working in Ubuntu 10.04 32/64 Bit

The inkjet printer in our house is a Canon MP240 which is connected to the wife’s Windows-running laptop, while I’m on Ubuntu 10.04 64-bit, and although it takes a bit of effort to get them to play ball – they will talk and printing works just fine. To get it all up and running just follow these steps:

1.) Get the driver files

Head on over to: and enter Linux as your OS type and pick a language of choice, for the MP240 in English you’ll end up with a file called MP240_debian_drivers.tar. Extract it by right-clicking on it and selecting Extract Here from the pop-up menu, or running the command tar xvf ./MP240_debian_drivers.tar from the command line.

Once extracted, you’ll end up with a folder called the tar file name which has two files within it: MP240_debian_printer.tar and MP240_debian_printer_scangear.tar. Because this guide is about printing it’s the first file we’re after – so extract it using any of the two methods shown above, and again it’ll create a folder of the tar name, inside which you’ll find a tar.gz file (which you can safely ignore) and two deb files which are what we’re really after: cnijfilter-common_3.00-1_i386.deb and cnijfilter-mp240series_3.00-1_i386.deb.

2.) Repackage the deb OR get a libcupsys2 transitional package

Because Ubuntu has transferred from libcupsys2 to libcups, we have the option of using our mighty linux skills to repackage the debs to use libcups by reading this, but it’s a bit tech, and we don’t really have to. Instead, we can just install the transitional package from good ol’ Jaunty by heading over to this page: (link now broken – see local mirror of file below – or don’t use at all [see update 2!]).

The link to download the transitional deb is the one – just click on it to download, then double click on the file to install it. Nice – almost there!

Update: The link to the transitional package is no longer working, but as I still have a copy I’ve made it available here: libcupsys2_1.3.9-17ubuntu3.9_all.deb

Update 2: I see that some people have had success without using the libcupsys2 transitional package at all, just by ignoring the dependency. I haven’t tried it myself, but from what I read you can skip this step entirely by using the following commands for step 3:

3.) Install / Force Install of the MP240 drivers

If you’re running 10.04 32-bit then you can just install the canon debs by running the following two lines at the command line:

If, like me, you’re running 64-bit Linux, then you need to force dpkg to ignore the architecture differences like this:

4.) Add your printer

With that done, we’re ready to set up the printer, so go to System | Administration | Printing from the gnome panel (or your printing config tool of choice if you’re using KDE or whatnot) and the printer driver will be available for you to use. Because I’m going across the network to get to the printer I’m clicking on [Add] then picking Windows Printer via SAMBA. You can just hit [Browse] without entering an IP or path or anything to browse detected workgroups on your network.

Selecting a CanonMP240 through SAMBA

Once you’ve selected the printer and clicked [OK] you can click [Forward] and then Canon as the driver manufacturer and you’ll find the MP240 driver in your list like this:

Canon MP240 Driver Selected

Select it, click [Forward] again and print off a test page – you should be all set! Cheers! =D