[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libusb-devel
Subject:    Re: Claim interface on different handles to the same device fails
From:       Xiaofan Chen <xiaofanc () gmail ! com>
Date:       2012-09-28 9:39:26
Message-ID: CAGjSPUAqvrcE8+C6tpt2uPDmwJeQAPXPnqmp8Oigqc2hxz67eQ () mail ! gmail ! com
[Download RAW message or body]

On Fri, Sep 28, 2012 at 5:18 PM, Lederhilger Martin
<M.Lederhilger@ds-automotion.com> wrote:
> Hello,
>
> I am a user of the PointCloudLibrary, which uses OpenNI to communicate
> with a Kinect like USB-device (point cloud capture device). I use Linux
> as an operating system. If I use the XnSensorServer then everything
> works, so my following question is more out of curiosity:
>
> If I do not use the XnSensorServer, then OpenNI's sensor driver uses
> 'libusb_open' and 'libusb_claim_interface' multiple times on the same
> device (for depth-, infrared- and RGB-imagegenerator). Each call to
> 'libusb_open' returns a different handle - so the first
> 'libusb_claim_interface' passes, but the second one fails with an error,
> that the device is already claimed because 'claimed_interfaces' (used to
> block the call to OS specific claim interface function, if the device
> has already been claimed by this function - see
> 'libusb_claim_interface') is stored in the handle's and not in the
> device's data structure.

If what you describe is true, then I think OpenNI is doing things
wrongly.

> So my question is that if it is legal (from libusb's point of view) to
> open one device multiple times. If yes, then would not it be better to
> store 'claimed_interfaces' in the device instead of it's handle. Since I
> am new to this matter, maybe you can give me some insight on this.

You can open the device multiple times, but you can not do that
with libusb_claim_interface. You should release the previous
interface and before you claim it again.


-- 
Xiaofan

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
libusb-devel mailing list
libusb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic