that has libusb as an installable port
On 11/11/2010 08:54 AM, Kyle Machulis wrote:
> The error seen in the USB prober:
>
> 1037.409 [3]AppleUSBEHCI[0x718b800]::CreateHSIsochTransfer Isoch --
> incomplete final TD in transfer, command->GetNumFrames() is 1,
> pEP->Interval is 1 and so transfersPerTD is 8
>
> Reference seen on apple list:
>
> http://lists.apple.com/archives/usb/2010/Jun/msg00010.html
>
> However, this might just be worth waiting until the macam people have
> this implemented in the actual platform API instead of trying libusb.
>
> On Wed, Nov 10, 2010 at 10:32 PM, Kyle Machulis <ky...@nonpolynomial.com
> <mailto:ky...@nonpolynomial.com>> wrote:
>
> Yeah. iso transfers are stalling on mac. This is usually an issue
> when developing mac libusb stuff, what works on linux requires some
> tweaking in OS X. Things may need to align on weird boundaries, etc...
>
>
> On Wed, Nov 10, 2010 at 9:52 PM, Vitor Calejuri
> <ondeosfrang...@gmail.com
> <mailto:ondeosfrang...@gmail.com>> wrote:
>
> This may also help you debugging:
>
> http://developer.apple.com/hardwaredrivers/download/usbdebug.html
>
> On Thu, Nov 11, 2010 at 3:48 AM, Tim Hawkins <tim.h...@me.com
> <mailto:tim.h...@me.com>> wrote:
>
> Check out MacPorts
>
> that has libusb as an installable port
>
>
> On Nov 11, 2010, at 1:42 PM, Dave wrote:
>
> > Has anyone got this to work with OSX yet? I'm having some
> trouble with
> > the libusb.
>
>
>
>
--
Hector Martin (hec...@marcansoft.com)
Public Key: http://www.marcansoft.com/marcan.asc
after tons of usb debugging I found on osx I needed to add:
libusb_claim_interface(dev, 0);
underneath:
dev = libusb_open_device_with_vid_pid(NULL, 0x45e, 0x2ae);
if (!dev) {
printf("Could not open device\n");
return 1;
}
now I am getting transfer errors but the endpoint is found ( before the endpoints weren't found ).
only getting the first frame then rgb_callback stops getting called.
I had to change a few other things:
#define PKTS_PER_XFER 32
#define NUM_XFERS 512
uint8_t rgb_frame[640*480*4]; <-- changed to *4 as bayer to RGB was going out of bounds.
and in depth_process
if (hdr->flag != 0x75){
return
}
to
if (hdr->flag != 0x75 && hdr->flag != 0x72){
return;
}
and in rgb_process
if (hdr->flag != 0x85){
return;
}
to
if (hdr->flag != 0x85 && hdr->flag != 0x82){
printf("hdr->flag is %02x\n", hdr->flag);
return;
}
Also I have been hacking at libusb on OS X and for some reason my hacked version works but the offical one doesn't.
Have to figure out what it is :)
Good job on getting it to work on OSX though!
The source code is included in the video link and so is the libusb which you won't need to install.
The results I ended up using were:
#define DEPTH_LEN 2048
#define RGB_LEN 2048
#define PKTS_PER_XFER 512
#define NUM_XFERS 1
Anything else would results in the buffers coming in out of order.
There aren't too many mods - the most important being libusb_claim_interface
The code is a little different right now as it has tons of my debugging efforts littered though it.
Huge thanks Hector for all the help and for making the library!!
> That looks like entirely caused by packet loss (keep in mind that the
> kinect uses >20MB/s of bandwidth, you need pretty efficient software to
> keep up).
Yeah I noticed even having printfs in the callbacks caused a visible difference in the results.
1 transfer is generally a bad idea, because it means any packets coming
in while those 512 packets are processed are inevitably lost. Have you
tried something like 4 transfers of 512 packets? Or maybe 8 transfers of
128 packets or similar.
The length shouldn't matter as long as it's large enough, but maybe the
2K alignment helps, so that's good.
#define PKTS_PER_XFER 128
#define NUM_XFERS 8
gives much faster results
It installs libusb.h into /usr/local/include/libusb-1.0/ and the lib
into /usr/local/lib/
The pkg is available at http://www.as3kinect.org/download/
Hope this helps.