If you want to get the Microsoft Kinect setup and working on your Mac using OS X 10.9 Mavericks, then you’ve come to the right place. Since posting the first tutorial, a number of new software updates have been released, so it’s a good idea to recap from the start. This tutorial will detail all the steps necessary to get the Kinect working in Mavericks, so buckle up and let’s get this party started.
As always, if you have any questions, issues, or feedback, please feel free to post them in the comments section at the bottom, and to keep abreast of any new updates and posts you can follow me on Twitter, or subscribe using the new email form in the sidebar. Oh, and if you don’t own a Kinect yet, there’s a few things you’ll need to know, so please check out the buyers guide or.
Preface: Uninstall Existing Kinect Drivers
If you followed my earlier tutorial and/or had your Kinect running in Mac OS X 10.8 Mountain Lion, then you’ll want to complete this step before moving ahead. If you’re new, and are setting up the Kinect in Mac OS X 10.9 Mavericks from scratch then please feel free to skip this and move straight onto Step 1.
When it comes to hacking the Kinect, cleaner is better. So I suggest uninstalling any existing Kinect drivers you might have installed and start fresh. If you’re confident simply upgrading then please feel free to do so, but for everyone else please begin by following the instructions in this article – How to uninstall Kinect drivers on your Mac.
Step 1: Install and upgrade Xcode
If you’re a regular visitor to this site or a developer, you may already have Xcode installed. If so, just make sure you upgrade your Command Line Tools to the latest version for Mavericks. For everyone else, please follow the tasks below.
1. Install Xcode from the Mac App Store (as of writing, the latest version is 5.0.2). Once installed, open the application and select the menu option Xcode / Open Developer Tool / More Developer Tools…
3. In the list of downloads, search for the most recent version of Command Line Tools (OS X Mavericks) for Xcode (as of writing, this is the release from October 23, 2013). Click on the blue disk image link to the right of the description to download.
Easy! So now you’re up to date with Xcode, let’s move on to installing the Kinect drivers.
Step 2: Install Additions
Next up is a list of applications/tools that you’ll need to install. The versions mentioned below are the latest at the time of writing, but if there is a more recent version, you should be fine installing that too.
1. Download XQuartz, an open source version of the X.org X Window System for Mac.
I’m using version 2.7.5.
2. Download CMake, a cross-platform build automation system.
Select the download link beside Mac OSX 64/32-bit Universal (for Intel, Snow Leopard/10.6 or later), I’m using version 220.127.116.11.
Part way through the CMake installation you’ll be asked to Install Command Line Tools, make sure you do this by clicking the Install Command Line Links button. If you get an error at this point, you’ll need to follow all the uninstallation instructions and then reinstall.
3. Download MacPorts, which allows you to compile, install and upgrade software via Terminal app.
Select the download titled OS X 10.9 Mavericks, I’m using version 2.2.1.
Step 3: Install Dependencies
At this point you’ve installed your primary applications, so now we just need to install a couple of dependencies for later on. Don’t worry, they’re easy!
Libtool: A generic library support tool.
1. To install Libtool, open the Terminal application: Applications / Utilities / Terminal.
2. Next, type in the following:
sudo port install libtool
3. Press Return, and then enter your password when prompted. If all went well, you should see something similar to the following appear in Terminal:
---> Fetching archive for libtool ---> Attempting to fetch libtool-2.4.2_3.darwin_13.x86_64.tbz2 from http://jog.id.packages.macports.org/macports/packages/libtool ---> Attempting to fetch libtool-2.4.2_3.darwin_13.x86_64.tbz2.rmd160 from http://jog.id.packages.macports.org/macports/packages/libtool ---> Installing libtool @2.4.2_3 ---> Activating libtool @2.4.2_3 ---> Cleaning libtool ---> Updating database of binaries: 100.0% ---> Scanning binaries for linking errors: 100.0% ---> No broken files found.
Libusb: A usb support tool for applications.
Okay, so don’t close Terminal just yet. You’ll need it for this installation too.
1. In Terminal, type in the following:
sudo port install libusb +universal
2. Click Return and then enter your password when prompted. If everything installed correctly, you should see something similar to this:
---> Fetching archive for libusb ---> Attempting to fetch libusb-1.0.18_0+universal.darwin_13.i386-x86_64.tbz2 from http://jog.id.packages.macports.org/macports/packages/libusb ---> Attempting to fetch libusb-1.0.18_0+universal.darwin_13.i386-x86_64.tbz2 from http://packages.macports.org/libusb ---> Attempting to fetch libusb-1.0.18_0+universal.darwin_13.i386-x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/libusb ---> Fetching distfiles for libusb ---> Attempting to fetch libusb-1.0.18.tar.bz2 from http://aarnet.dl.sourceforge.net/libusb ---> Verifying checksums for libusb ---> Extracting libusb ---> Configuring libusb ---> Building libusb ---> Staging libusb into destroot ---> Installing libusb @1.0.18_0+universal ---> Activating libusb @1.0.18_0+universal ---> Cleaning libusb ---> Updating database of binaries: 100.0% ---> Scanning binaries for linking errors: 100.0% ---> No broken files found.
Step 4: Install OpenNi SDK (v18.104.22.168)
Okay, now we’re moving into Kinect territory. OpenNi is the first Kinect-specific software you’ll be installing, so make sure you follow along closely.
OpenNi is created by a group of companies including PrimeSense (now owned by Apple), who developed the original Microsoft Kinect. The OpenNi software itself contains a stack of middleware libraries and applications that will help get you going on your Kinect journey!
1. Create a new folder on your Mac called ‘Kinect’. This will help keep things organised (I’ll be referring to this folder later on).
3. Move the file you just downloaded to your Kinect folder and double click to uncompress and reveal the SDK folder.
4. Open the Terminal application on your Mac: Applications / Utilities / Terminal.
5. We will now navigate to the OpenNi SDK folder using the command. Start by typing in cd, add a space, and finally drag your SDK folder from the Finder onto the Terminal window and press Return. This will automatically enter the file path for you, and look something like this:
Glens-MacBook-Pro:~ glen$ cd /Users/glen/Sites/kinect/OpenNI-Bin-Dev-MacOSX-v22.214.171.124 Glens-MacBook-Pro:OpenNI-Bin-Dev-MacOSX-v126.96.36.199 glen$
6. And now the fun part! Type in the following, press Return and then enter your password to install OpenNi SDK:
If everything installed correctly, then you’ll see the following text:
Installing OpenNI **************************** copying shared libraries...OK copying executables...OK copying include files...OK creating database directory...OK registering module 'libnimMockNodes.dylib'...OK registering module 'libnimCodecs.dylib'...OK registering module 'libnimRecorder.dylib'...OK creating java bindings directory...OK Installing java bindings...OK *** DONE ***
Step 5a: Prepare to Install SensorKinect
We need to quickly complete this step to prevent errors during the SensorKinect installation.
1. Open Terminal on your Mac: Applications / Utilities / Terminal.
2. Next type in the following and press Return:
sudo ln -s /usr/local/bin/niReg /usr/bin/niReg
Step 5b: Install SensorKinect
SensorKinect is simply a module that helps the Kinect interact with OpenNI. You’ll need it for your Kinect to work on your Mac.
1. Visit the SensorKinect project on GitHub and click the Download ZIP button that looks like this:
2. Once downloaded, move the SensorKinect-unstable.zip file to your Kinect folder and double-click to uncompress it.
3. Navigate to the SensorKinect093-Bin-MacOSX-v188.8.131.52.tar.bz2 file inside the Bin folder, and double-click to uncompress it.
4. Now you’re ready to install. Open Terminal on your Mac: Applications / Utilities / Terminal.
5. In Terminal, type cd, then a space, then drag the Sensor-Bin-MacOSX-v184.108.40.206 folder into the Terminal window, and finally hit Return to navigate to that directory. You’ll end up with something like this:
Glens-MacBook-Pro:~ glen$ cd /Users/glen/Sites/kinect/SensorKinect-unstable/Bin/Sensor-Bin-MacOSX-v220.127.116.11 Glens-MacBook-Pro:Sensor-Bin-MacOSX-v18.104.22.168 glen$
6. And then to install, type the following in Terminal, hit Return, and then enter your password when prompted:
And if everything worked, you’ll see the following:
Installing PrimeSense Sensor **************************** creating config dir /usr/etc/primesense...OK copying shared libraries...OK copying executables...OK registering module 'libXnDeviceSensorV2KM.dylib' with OpenNI...OK registering module 'libXnDeviceFile.dylib' with OpenNI...OK copying server config file...OK setting uid of server...OK creating server logs dir...OK *** DONE ***
Step 6: Install NiTE
It’s all downhill from here, as this is the last thing you’ll be installing. NiTE is some awesome middleware that’s made by the same crew behind OpenNI. It monitors depth, colour, infrared and audio to track your body and hands for use as input devices.
2 Once downloaded, move the NITE-Bin-MacOSX-v22.214.171.124.tar.zip file to your Kinect folder and double-click to uncompress it.
3. And just like before, open Terminal and type in cd, followed by a space, and then drag the NITE-Bin-Dev-MacOSX-v126.96.36.199 folder into the Terminal window. Hit Return to navigate to that directory, and you should see something like this:
Glens-MacBook-Pro:~ glen$ cd /Users/glen/Sites/kinect/NITE-Bin-Dev-MacOSX-v188.8.131.52 Glens-MacBook-Pro:NITE-Bin-Dev-MacOSX-v184.108.40.206 glen$
5. After this, we can install NiTE by typing in the following, and then hitting Return:
Don’t worry if you get some ‘No such file or directory’ errors, they don’t really matter. A successful install will look something like this:
Installing NITE *************** Copying shared libraries... OK Copying includes... OK Installing java bindings... OK Installing module 'Features_1_3_0'... ls: Features_1_3_0/Bin/lib*dylib: No such file or directory Installing module 'Features_1_3_1'... ls: Features_1_3_1/Bin/lib*dylib: No such file or directory Installing module 'Features_1_4_1'... ls: Features_1_4_1/Bin/lib*dylib: No such file or directory Installing module 'Features_1_4_2'... ls: Features_1_4_2/Bin/lib*dylib: No such file or directory Installing module 'Features_1_5_2'... Registering module 'libXnVFeatures_1_5_2.dylib'... OK Copying XnVSceneServer... OK Installing module 'Features_1_5_2' ls: Hands_1_3_0/Bin/lib*dylib: No such file or directory Installing module 'Features_1_5_2' ls: Hands_1_3_1/Bin/lib*dylib: No such file or directory Installing module 'Features_1_5_2' ls: Hands_1_4_1/Bin/lib*dylib: No such file or directory Installing module 'Features_1_5_2' ls: Hands_1_4_2/Bin/lib*dylib: No such file or directory Installing module 'Features_1_5_2' registering module 'libXnVHandGenerator_1_5_2.dylib'...OK Installing .NET wrappers... Package exported to: /Library/Frameworks/Mono.framework/Versions/3.2.0/lib/mono/2.0/XnVNite.net.dll -> ../gac/XnVNite.net/220.127.116.11__399870656fc6c787/XnVNite.net.dll Installed Bin/XnVNite.net.dll into the gac (/Library/Frameworks/Mono.framework/Versions/3.2.0/lib/mono/gac) Adding license.. OK *** DONE ***
Step 7: Transfer and Test Sample Files
You’ve made it to the final step! All we need to do now is transfer over some files and we can test out our installation.
1. Copy the sample xml files from NiTE / Data over to your SensorKinect / Data folder like so (hold the Option key while dragging to copy files in Mac OS X):
3. Open your Terminal app again: Applications / Utilities / Terminal.
4. In Terminal, type cd, followed by a space, and then drag the x64-Release folder onto the Terminal window to fill in the path and press Return. You should see something like this:
Glens-MacBook-Pro:~ glen$ cd /Users/glen/Sites/kinect/NITE-Bin-Dev-MacOSX-v18.104.22.168/Samples/Bin/x64-Release Glens-MacBook-Pro:x64-Release glen$
5. And now finally, to run your first demo, type the following into your Terminal window and press Return:
If everything is setup correctly, PointViewer should open in a new screen. This is a tracking demo, so stand back, wave your hand around in the air, and pretty soon you should notice a white tracking line appear (see the video below).
6. You can also test out the other demos too, like the Players demo. This will identify your body shape and colour you blue, add another person to the mix and they will be coloured green. To test it out, simply close the previous demo and type the following into Terminal and hit Return:
7. Want to try something cooler? Check out my other tutorial on creating special effects with Synapse Kinect and Quartz Composer.
And now you should be good to go! I know a lot of you were waiting for this tutorial, so thank you for your patience and I hope it was helpful. I’ll be following this up with a few more in-depth tutorials and inspiration posts soon – to be notified when they’re published, simply sign up using the email form in the sidebar (don’t worry, no spam!), or follow me on Twitter. I’d also love to know how you went setting up the Kinect, so feel free to comment below with any questions, success stories or issues! Take care and have fun kinecting!