Skip to content

Commit 8e2b1eb

Browse files
committed
Fixes "subpacket too large", "not all subsequences received" and LIBUSB_ERROR_OTHER errors for OS X
1 parent caf7d86 commit 8e2b1eb

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/libfreenect2.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@
4343
#include <libfreenect2/protocol/command_transaction.h>
4444
#include <libfreenect2/logging.h>
4545

46+
#ifdef __APPLE__
47+
#define PKTS_PER_XFER 128
48+
#define NUM_XFERS 4
49+
#else
50+
#define PKTS_PER_XFER 8
51+
#define NUM_XFERS 60
52+
#endif
53+
4654
namespace libfreenect2
4755
{
4856
using namespace libfreenect2;
@@ -464,8 +472,8 @@ bool Freenect2DeviceImpl::open()
464472
return false;
465473
}
466474

467-
rgb_transfer_pool_.allocate(50, 0x4000);
468-
ir_transfer_pool_.allocate(80, 8, max_iso_packet_size);
475+
rgb_transfer_pool_.allocate(20, 0x4000);
476+
ir_transfer_pool_.allocate(NUM_XFERS, PKTS_PER_XFER, max_iso_packet_size);
469477

470478
state_ = Open;
471479

@@ -585,7 +593,7 @@ void Freenect2DeviceImpl::start()
585593

586594
LOG_INFO << "submitting usb transfers...";
587595
rgb_transfer_pool_.submit(20);
588-
ir_transfer_pool_.submit(60);
596+
ir_transfer_pool_.submit(NUM_XFERS);
589597

590598
state_ = Streaming;
591599
LOG_INFO << "started";

0 commit comments

Comments
 (0)