+ if (current_configuration != KINECT_AUDIO_CONFIGURATION) {
+ ret = libusb_set_configuration(dev, KINECT_AUDIO_CONFIGURATION);
+ if (ret < 0) {
+ fprintf(stderr, "libusb_set_configuration failed: %s\n",
+ libusb_error_name(ret));
+ fprintf(stderr, "Cannot set configuration %d\n",
+ KINECT_AUDIO_CONFIGURATION);
+ goto out_libusb_close;
+ }
+ }
+
+ libusb_set_auto_detach_kernel_driver(dev, 1);
+
+ ret = libusb_claim_interface(dev, KINECT_AUDIO_INTERFACE);
+ if (ret < 0) {
+ fprintf(stderr, "libusb_claim_interface failed: %s\n",
+ libusb_error_name(ret));
+ fprintf(stderr, "Cannot claim interface %d\n",
+ KINECT_AUDIO_INTERFACE);
+ goto out_libusb_close;
+ }