libfreenect2 usb on osx

447 views
Skip to first unread message

ybott

unread,
Jun 30, 2015, 5:07:46 AM6/30/15
to openk...@googlegroups.com
Hello all,

I have been trying to get a Kinect One setup on an OSX install. I have been successful up until running Protonect example and was wondering if someone could help. 

The Kinect one has a MS adaptor with supplied power adaptor. I am running on a Macbook with an express port usb 3 card[1]. 

Dependency installation was through brew; libusb through the depends folder of libfreenect2. When running with the Kinect plugged in I received the following[2]:-

[Freenect2Impl] enumerating devices...
[Freenect2Impl] 8 usb devices connected
[Freenect2Impl] found valid Kinect v2 @0:3 with serial XXXXXXXXXXX
[Freenect2Impl] found 1 devices

<snip>

[Freenect2DeviceImpl] submitting usb transfers...
[TransferPool::submit] failed to submit transfer: LIBUSB_ERROR_NOT_FOUND

<snip>

[Freenect2DeviceImpl] started
device serial: XXXXXXXXXXX
device firmware: 1.1.2906.0.7
[RgbPacketStreamParser::onDataReceived] buffer overflow!
[RgbPacketStreamParser::onDataReceived] buffer overflow!
[RgbPacketStreamParser::onDataReceived] packetsize or sequence doesn't match!

I have heard the correct libusb version is important, and am 'fairly' sure it is the correct one, any way to check?

Other issue is I am unable to access any frame display from opencv, it just shows the Protonect icon with no windows. Could this also be an issue?

Many thanks,
ybot


ybott

unread,
Jul 1, 2015, 10:28:03 PM7/1/15
to openk...@googlegroups.com
I have tried this on another Mac machine with success. It looks like my initial guess was correct in regards to an unsupported USB 3.0 chipset.

Note for other libfreenect2 OSX users .... I have written a quick (WIP) Homebrew recipe (turns opencl off) as follows ...

$ vim /usr/local/Library/Formula/libfreenect2.rb

Or

$ brew create libfreenect2

and fill with the following

require "formula"

class Libfreenect2 < Formula
  desc "Drivers/Example for Kinect V2"
  homepage "https://github.com/OpenKinect/libfreenect2"
  head "https://github.com/OpenKinect/libfreenect2.git"
  url "https://github.com/OpenKinect/libfreenect2/archive/master.zip"
  sha256 "8ba27e1d995e6be4406d05964b7e8a5f2df49bdac9a905623392e53e0f8959ff"

  version "0.0.1"

  depends_on "libusb"
  depends_on "nasm" => :recommended
  depends_on "jpeg-turbo" => :recommended
  depends_on "homebrew/science/opencv" => :recommended
  depends_on "homebrew/versions/glfw3" => :recommended
  depends_on "cmake" => :build

  patch :DATA

  def install
     system "cmake", "-DENABLE_OPENCL=OFF", "-Wno-dev", "-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/libfreenect2/#{version}", "examples/protonect"
     system "make"
     system "make", "install"
  end
end

__END__
diff --git a/examples/protonect/CMakeLists.txt b/examples/protonect/CMakeLists.txt
index ba93a67..dcd7714 100644
--- a/examples/protonect/CMakeLists.txt
+++ b/examples/protonect/CMakeLists.txt
@@ -202,4 +202,4 @@ IF(LIBFREENECT2_THREADING_TINYTHREAD)
 ENDIF(LIBFREENECT2_THREADING_TINYTHREAD)
 INSTALL(FILES "${PROJECT_BINARY_DIR}/freenect2Config.cmake" DESTINATION lib/cmake/freenect2/)
 INSTALL(FILES "${PROJECT_BINARY_DIR}/freenect2.pc" DESTINATION lib/pkgconfig/)
-
+INSTALL(FILES "${MY_DIR}/bin/Protonect" DESTINATION bin/)
diff --git a/examples/protonect/cmake_modules/FindLibUSB.cmake b/examples/protonect/cmake_modules/FindLibUSB.cmake
index f3e822b..af7a16a 100644
--- a/examples/protonect/cmake_modules/FindLibUSB.cmake
+++ b/examples/protonect/cmake_modules/FindLibUSB.cmake
@@ -8,7 +8,6 @@
 #  LibUSB_LIBRARIES:  the libraries

 IF(PKG_CONFIG_FOUND)
-  SET(ENV{PKG_CONFIG_PATH} "${DEPENDS_DIR}/libusb/lib/pkgconfig")
   PKG_CHECK_MODULES(LibUSB libusb-1.0)
   RETURN()
 ENDIF()
Reply all
Reply to author
Forward
0 new messages