Xbox One Kinect 2.0 for Mac

This is a work in progress entry about getting the Xbox One Kinect 2.0 to run under Mac OSX. Currently, they are quite affordable (~60€) on Ebay because many people don’t like Microsoft invading their privacy in the living room. So get them while they are cheap!

The Kinect 2.0 from the Xbox One seems to be exactly the same as the Kinect for Windows (K4W) v2 dev kit , except for the missing power adapter and USB 3 converter/hub. So we will need to supply 12V from a lab power supply and solder two wires inside the kinect. You can find more here. A firmware update was not necessary for me.

Before starting off, check your usb controller compatibility by typing:

into your console and check with my Kinect 2.0 USB 3.0 controller compatibility table:

Controller Chipset PCI Device ID Status
Nec uPD720200 ? working
Intel Pantherpoint 0x1e31 working
Intel Lynxpoint 0x9c31 working
Intel Corporation 7 Series/C210 ? not working

If you are able to get another controller working – please let me know in the comments.

1. cd into a directory where you want to keep libfreenect2 stuff in
2. Install some homebrew dependencies

3. Download the libfreenect2 repository

4. Install a bunch of dependencies

5. Build the actual protonect executable

6. Run the program

Keep in mind that some USB ports may work better than others 🙂

Here are some pictures:

ImageViewer

CloudViewer

19 Gedanken zu „Xbox One Kinect 2.0 for Mac

  1. Hi can you help me? I’m doing this procedure but at point5.
    i get this error? how can i do?

    -bash: cmake: command not found
    myusert:protonect fatcat$ make && make install
    Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

      • now i get this error… 🙁

        — using tinythread as threading library
        CMake Error at CMakeLists.txt:43 (FIND_PACKAGE):
        By not providing „FindOpenCV.cmake“ in CMAKE_MODULE_PATH this project has
        asked CMake to find a package configuration file provided by „OpenCV“, but
        CMake did not find one.
        Could not find a package configuration file provided by „OpenCV“ with any
        of the following names:
        OpenCVConfig.cmake
        opencv-config.cmake
        Add the installation prefix of „OpenCV“ to CMAKE_PREFIX_PATH or set
        „OpenCV_DIR“ to a directory containing one of the above files. If „OpenCV“
        provides a separate development package or SDK, be sure it has been
        installed.
        — Configuring incomplete, errors occurred!
        See also „/Users/fatcat/libfreenet2/examples/protonect/CMakeFiles/CMakeOutput.log“.
        See also „/Users/fatcat/libfreenet2/examples/protonect/CMakeFiles/CMakeError.log“.

          • it seems i missing other thing…

            fatcat:protonect fatcat$ cmake CMakeLists.txt

            — using tinythread as threading library
            — Using Cocoa for window creation
            — Using NSGL for context creation
            — Building GLFW only for the native architecture
            — Configuring done
            CMake Warning (dev) in /Users/fatcat/libfreenet2/depends/glfw_src/src/CMakeLists.txt:
            Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
            interface. Run „cmake –help-policy CMP0022“ for policy details. Use the
            cmake_policy command to set the policy and suppress this warning.
            Target „glfw“ has an INTERFACE_LINK_LIBRARIES property which differs from
            its LINK_INTERFACE_LIBRARIES properties.
            INTERFACE_LINK_LIBRARIES:

            /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Cocoa.framework;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/IOKit.framework;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreFoundation.framework;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreVideo.framework

            LINK_INTERFACE_LIBRARIES:

            This warning is for project developers. Use -Wno-dev to suppress it.
            CMake Warning (dev):
            Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run „cmake
            –help-policy CMP0042“ for policy details. Use the cmake_policy command to
            set the policy and suppress this warning.
            MACOSX_RPATH is not specified for the following targets:
            freenect2
            glfw
            This warning is for project developers. Use -Wno-dev to suppress it.
            — Generating done
            — Build files have been written to: /Users/fatcat/libfreenet2/examples/protonect
            fatcat:protonect fatcat$ make && make install
            [ 2%] Built target generate_resources_tool
            [ 45%] Built target glfw
            [ 47%] Building CXX object CMakeFiles/freenect2.dir/src/transfer_pool.cpp.o
            In file included from /Users/fatcat/libfreenet2/examples/protonect/src/transfer_pool.cpp:27:
            /Users/fatcat/libfreenet2/examples/protonect/include/libfreenect2/usb/transfer_pool.h:31:10: fatal error:

            ‚libusb.h‘ file not found

            #include ^
            1 error generated.
            make[2]: *** [CMskeFiles/freenect2.dir/src/transfer_pool.cpp.o] Error 1
            make[1]: *** [CMakeFiles/freenect2.dir/all] Error 2
            make: *** [all] Error 2
            fatcat:protonect fatcat$ ./bin/Protonect
            -bash: ./bin/Protonect: No such file or directory

          • You seem to be missing a lot of dependencies, are you sure you ran this?
            sh ./depends/install_mac.sh

          • yes i do it again and it say:

            — Installing: /Users/fatcat/libfreenet2/depends/glfw/lib/pkgconfig/glfw3.pc
            — Installing: /Users/fatcat/libfreenet2/depends/glfw/lib/libglfw.3.0.dylib
            — Installing: /Users/fatcat/libfreenet2/depends/glfw/lib/libglfw.3.dylib
            — Installing: /Users/fatcat/libfreenet2/depends/glfw/lib/libglfw.dylib
            ./depends/install_mac.sh: line 14: wget: command not found
            tar: Error opening archive: Failed to open ‚libjpeg-turbo-1.3.1.tar.gz‘
            mv: rename libjpeg-turbo-1.3.1 to /Users/fatcat/libfreenet2/depends/libjpeg_turbo_src/libjpeg-turbo-1.3.1: No such file or directory
            cp: /config.guess: No such file or directory
            cp: /config.sub: No such file or directory
            ./depends/install_mac.sh: line 22: ./configure: No such file or directory
            make: *** No targets specified and no makefile found. Stop.
            ./depends/install_mac.sh: line 26: cd: /System/Library/Frameworks/OpenCL.framework/Versions/A/Headers/: No such file or directory
            sudo: wget: command not found

          • i start again from the beginning and i have check what i have installed.

            Warning: wget-1.16.3 already installed
            Warning: libfreenect-0.5.1 already installed
            Warning: libusb-1.0.19 already installed
            Warning: opencv-2.4.11_1 already installed
            Warning: cmake-3.2.2 already installed
            Warning: git-2.4.0 already installed

            it seem i missing something again…

            fatcat:libjpeg-turbo-1.3.1 fatcat$ cmake CMakeList.txt

            CMake Error: The source directory „/Users/fatcat/libfreenet2/depends/libjpeg_turbo_src/libjpeg-turbo-1.3.1/CMakeList.txt“ does not exist.
            Specify –help for usage, or press the help button on the CMake GUI.
            fatcat:libjpeg-turbo-1.3.1 fatcat$ cmake CMakeLists.txt
            — The C compiler identification is AppleClang 6.1.0.6020049
            — Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
            — Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc — works
            — Detecting C compiler ABI info
            — Detecting C compiler ABI info – done
            — Detecting C compile features
            — Detecting C compile features – done
            CMake Error at CMakeLists.txt:25 (message):
            Platform not supported by this build system. Use autotools instead.

          • /Users/fatcat/libfreenet2/depends/libjpeg_turbo_src/libjpeg-turbo-1.3.1/CMakeList.txt“ does not exist

            Check if it really does not exist or if its inside some other folder maybe with another version number. Also consider removing the complete libfreenet2 folder and start from scratch.

          • yes its there. i try also to run it.

            and it says

            fatcat:libjpeg-turbo-1.3.1 fatcat$ cmake CMakeLists.txt
            — The C compiler identification is AppleClang 6.1.0.6020049
            — Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
            — Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc — works

            — Detecting C compiler ABI info
            — Detecting C compiler ABI info – done
            — Detecting C compile features
            — Detecting C compile features – done
            CMake Error at CMakeLists.txt:25 (message):

            Platform not supported by this build system. Use autotools instead.
            — Configuring incomplete, errors occurred!

            See also „/Users/fatcat/libfreenet2/depends/libjpeg-turbo-1.3.1/CMakeFiles/CMakeOutput.log“.

  2. Hi, thanks a lot for your tutorial, all the steps ran perfectly (long waiting at 100% CPU on bootstrap, see below) until the „make && make install“ command, it returns this :
    make: *** No targets specified and no makefile found. Stop.

    could you help me please?
    thanks again

    long waiting here :
    ==> ../configure –build=x86_64-apple-darwin14.3.0 –prefix=/usr/local/Cellar/gcc/5.1.0 –libd
    ==> make bootstrap

  3. yes i did, it returned this :

    user:protonect user$ cmake CMakeLists.txt
    — The C compiler identification is AppleClang 6.1.0.6020053
    — The CXX compiler identification is AppleClang 6.1.0.6020053
    — Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
    — Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc — works
    — Detecting C compiler ABI info
    — Detecting C compiler ABI info – done
    — Detecting C compile features
    — Detecting C compile features – done
    — Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
    — Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ — works
    — Detecting CXX compiler ABI info
    — Detecting CXX compiler ABI info – done
    — Detecting CXX compile features
    — Detecting CXX compile features – done
    — Performing Test LIBFREENECT2_THREADING_STDLIB
    — Performing Test LIBFREENECT2_THREADING_STDLIB – Failed
    — using tinythread as threading library
    — Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
    CMake Error at /usr/local/Cellar/cmake/3.2.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
    Could NOT find LibUSB (missing: LibUSB_LIBRARIES LibUSB_INCLUDE_DIRS)
    Call Stack (most recent call first):
    /usr/local/Cellar/cmake/3.2.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
    cmake_modules/FindLibUSB.cmake:42 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
    CMakeLists.txt:42 (FIND_PACKAGE)
    — Configuring incomplete, errors occurred!
    See also „/Users/tristan/Documents/kinect2/libfreenect2/examples/protonect/CMakeFiles/CMakeOutput.log“.
    See also „/Users/tristan/Documents/kinect2/libfreenect2/examples/protonect/CMakeFiles/CMakeError.log“.

      • still something wrong:

        — using tinythread as threading library
        — Found PkgConfig: /usr/local/bin/pkg-config (found version „0.28“)
        — checking for module ‚libusb-1.0‘
        — package ‚libusb-1.0‘ not found
        — Performing Test TURBOJPEG_WORKS
        — Performing Test TURBOJPEG_WORKS – Success
        — Found TurboJPEG: /usr/local/opt/jpeg-turbo/lib/libturbojpeg.dylib
        — checking for module ‚glfw3‘
        — found glfw3, version 3.1.1
        — Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework
        — Found OpenCL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenCL.framework
        Linking with these libraries: opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_nonfree;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d;opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_nonfree;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d;LibUSB_LIBRARIES-NOTFOUND;/usr/local/opt/jpeg-turbo/lib/libturbojpeg.dylib;pthread;glfw3;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenCL.framework

        CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
        Please set them or make sure they are set and tested correctly in the CMake files:
        LibUSB_INCLUDE_DIRS
        used as include directory in directory /Users/user/Documents/kinect2/libfreenect2/examples/protonect
        used as include directory in directory /Users/user/Documents/kinect2/libfreenect2/examples/protonect
        used as include directory in directory /Users/user/Documents/kinect2/libfreenect2/examples/protonect
        used as include directory in directory /Users/user/Documents/kinect2/libfreenect2/examples/protonect
        used as include directory in directory /Users/user/Documents/kinect2/libfreenect2/examples/protonect

        LibUSB_LIBRARIES

        linked by target „freenect2shared“ in directory /Users/user/Documents/kinect2/libfreenect2/examples/protonect

        — Configuring incomplete, errors occurred!

        See also „/Users/user/Documents/kinect2/libfreenect2/examples/protonect/CMakeFiles/CMakeOutput.log“.

        See also „/Users/user/Documents/kinect2/libfreenect2/examples/protonect/CMakeFiles/CMakeError.log“.

        libusb?

          • yes… I tried doing „brew install libturbojpeg libusb“, it returned this :

            Error: No available formula for libturbojpeg
            Searching formulae…
            Searching taps…

            then I did „brew install libusb“ and it seemed to work.

            I did „cmake CMaleLists.txt“ and it returned :

            user:protonect user$ cmake CMakeLists.txt

            — using tinythread as threading library
            — checking for module ‚libusb-1.0‘
            — found libusb-1.0, version 1.0.19
            Linking with these libraries: opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_nonfree;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d;opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_nonfree;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d;usb-1.0;/usr/local/opt/jpeg-turbo/lib/libturbojpeg.dylib;pthread;glfw3;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenCL.framework
            — Configuring done
            CMake Warning (dev):
            Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run „cmake
            –help-policy CMP0042“ for policy details. Use the cmake_policy command to
            set the policy and suppress this warning.
            MACOSX_RPATH is not specified for the following targets:
            freenect2shared
            This warning is for project developers. Use -Wno-dev to suppress it.
            — Generating done
            — Build files have been written to: /Users/user/Documents/kinect2/libfreenect2/examples/protonect

            and then „make && make install“ :

            user-mb:protonect user$ make && make install
            Scanning dependencies of target generate_resources_tool
            [ 4%] Building CXX object CMakeFiles/generate_resources_tool.dir/src/generate_resources.cpp.o
            Linking CXX executable bin/generate_resources_tool
            [ 4%] Built target generate_resources_tool
            [ 8%] Generating src/resources.inc.h
            Scanning dependencies of target freenect2
            [ 13%] Building CXX object CMakeFiles/freenect2.dir/src/transfer_pool.cpp.o
            [ 17%] Building CXX object CMakeFiles/freenect2.dir/src/event_loop.cpp.o
            [ 21%] Building CXX object CMakeFiles/freenect2.dir/src/usb_control.cpp.o
            [ 26%] Building CXX object CMakeFiles/freenect2.dir/src/double_buffer.cpp.o
            [ 30%] Building CXX object CMakeFiles/freenect2.dir/src/frame_listener_impl.cpp.o
            [ 34%] Building CXX object CMakeFiles/freenect2.dir/src/packet_pipeline.cpp.o
            [ 39%] Building CXX object CMakeFiles/freenect2.dir/src/rgb_packet_stream_parser.cpp.o
            [ 43%] Building CXX object CMakeFiles/freenect2.dir/src/rgb_packet_processor.cpp.o
            [ 47%] Building CXX object CMakeFiles/freenect2.dir/src/turbo_jpeg_rgb_packet_processor.cpp.o
            [ 52%] Building CXX object CMakeFiles/freenect2.dir/src/depth_packet_stream_parser.cpp.o
            [ 56%] Building CXX object CMakeFiles/freenect2.dir/src/depth_packet_processor.cpp.o
            [ 60%] Building CXX object CMakeFiles/freenect2.dir/src/cpu_depth_packet_processor.cpp.o
            [ 65%] Building CXX object CMakeFiles/freenect2.dir/src/resource.cpp.o
            [ 69%] Building CXX object CMakeFiles/freenect2.dir/src/command_transaction.cpp.o
            [ 73%] Building CXX object CMakeFiles/freenect2.dir/src/registration.cpp.o
            [ 78%] Building CXX object CMakeFiles/freenect2.dir/src/libfreenect2.cpp.o
            [ 82%] Building CXX object CMakeFiles/freenect2.dir/src/tinythread/tinythread.cpp.o
            [ 86%] Building C object CMakeFiles/freenect2.dir/src/flextGL.c.o
            In file included from /Users/user/Documents/kinect2/libfreenect2/examples/protonect/src/flextGL.c:5:
            /usr/local/include/GLFW/glfw3.h:722:27: warning: redefinition of typedef ‚GLFWwindow‘ is a C11 feature [-Wtypedef-redefinition]
            typedef struct GLFWwindow GLFWwindow;
            ^
            /Users/user/Documents/kinect2/libfreenect2/examples/protonect/src/flextGL.h:1652:27: note: previous definition is here
            typedef struct GLFWwindow GLFWwindow;
            ^
            1 warning generated.
            [ 91%] Building CXX object CMakeFiles/freenect2.dir/src/opengl_depth_packet_processor.cpp.o
            [ 95%] Building CXX object CMakeFiles/freenect2.dir/src/opencl_depth_packet_processor.cpp.o
            /Users/user/Documents/kinect2/libfreenect2/examples/protonect/src/opencl_depth_packet_processor.cpp:43:10: fatal error: ‚OpenCL/cl.hpp‘ file not found
            #include
            ^
            1 error generated.
            make[2]: *** [CMakeFiles/freenect2.dir/src/opencl_depth_packet_processor.cpp.o] Error 1
            make[1]: *** [CMakeFiles/freenect2.dir/all] Error 2
            make: *** [all] Error 2

            is it still this libturbojpg? How could I install it properly? thank you a lot !

          • I don’t think you will get this working by just installing libturbojpeg libusb from brew. As far is I remember libfreenect2 requires a specially patched version of at least libusb. Have a look at what the install_mac script actually does. Moreover, I’d recommend reading the compiler feedback. It clearly says fatal error: ‚OpenCL/cl.hpp‘ file not found. See if that file exists at all on your Mac. You may have to download it from khronos.org

Schreibe einen Kommentar