Hi, I had a similar problem a while ago, but my device look-up
strategy was a bit different. My problem was related to a driver bug
that made the Window API report the same hub port for two devices.
This should be impossible and confused libusb, as it assumes that hub
ports are unique. In the end I got the same error as you, because I
tried to open a device for which libusb didn't assign the proper
backend to. This made the open call fail with an unsupported error.

Anyway, you said this problem only occurs on Windows 8. How do you
test the different operating systems? Do you use different virtual
machines, or do you use different physical PCs? Maybe Windows 8 is not
the problem, but you're testing Windows 8 on a PC that has a USB host
controller with a buggy driver.

Things you could test:

- Test Windows 8 on different hardware.

- Test with your device connected to a different USB port, if it's
connected to a USB3 port then try a USB2 port.

- If you're testing Windows 8 in a virtual machine then try with
Windows 8 on an actual PC, maybe the problem is in the USB
pass-through of the virtual machine.

- In the for loop where you call is_correctdev(), don't break on the
first matching device, but check all devices in the list to see if
libusb reports multiple matching ones. If it does and you only have
one device actually connected, then you might have a similar problem
compared to the problem I had.

- Did you try the xusb examples that comes with libusb? Is xusb able
to list information about your device?

Some more things to test. This should not make a difference, but I
suggest testing it anyway:

- Simplify your test program: remove the config descriptor stuff
before the libusb_open() call.

- You said you're using cygwin, try without cygwin.

Regards,
Matthias


2014-08-02 3:18 GMT+02:00 Bob Tausworthe <t...@sentons.com>:
> Hi, it checks the VID and PID
>
> int is_correctdev( libusb_device *dev )
> {
> struct libusb_device_descriptor desc;
> int r = libusb_get_device_descriptor( dev, &desc );
>
>     //printf("Checking VID=0x%04x, PID=0x%04x\n", desc.idVendor,
> desc.idProduct);
> if( desc.idVendor == VENDOR_ID &&
>       (desc.idProduct  == PRODUCT_ID)
>   {
>         //printf("device found: class=0x%x\n", desc.bDeviceClass);
>
> return 1;
> }
> return 0;
> }
>
>
>
> On Thu, Jul 31, 2014 at 3:42 AM, Matthias Bolte
> <matthias.bo...@googlemail.com> wrote:
>>
>> 2014-07-29 23:28 GMT+02:00 Bob Tausworthe <t...@sentons.com>:
>> > Sorry to trouble you but I've exhausted other options. We are developing
>> > a
>> > composite HID/debug interace device and are using libusb 1.0 under 32
>> > bit
>> > Cygwin to access the debug interface portion. Everything is working fine
>> > on
>> > Windows 7 and Linux but when we try to run the application on Windows 8,
>> > it
>> > fails with the error :
>> >
>> > libusb: debug [unsupported_open] unsupported API call for 'open'
>> > (unrecognized device driver)
>> > libusb: debug [libusb_open] open 2.16 returns -12
>> > ERROR: Unable to open usb device
>> >
>> > After reading some posts of people with similar issues, I tried all of
>> > the
>> > drivers Zadig supports but didn't see any difference in behavior. I have
>> > tried building under Win7 and Win8 but the results are the same. I am
>> > using
>> > version 1.0.18 of libusb. The trace below was taken with the WinUSB
>> > driver
>> > version 6.1.7600.16385.
>> >
>> > Any help you can give me to point me in the right direction would be
>> > welcome. Here is the code I'm using to open our device and the trace
>> > listing.
>> >
>> > Thanks
>> >
>> > Bob Tausworthe
>> > t...@sentons.com
>> > Sentons, inc.
>> >
>> > int
>> >
>> > InitUSB(void)
>> >
>> > {
>> >
>> >    // Change these as needed to match idVendor and idProduct in your
>> > device's device descriptor.
>> >
>> >    int device_ready = 0;
>> >
>> >    int result;
>> >
>> >   libusb_device **list;
>> >
>> >   libusb_device *found = NULL;
>> >
>> >   libusb_context *ctx = NULL;
>> >
>> >   int attached = 0;
>> >
>> >   result = libusb_init(&ctx);
>> >
>> >   if (result == 0) {
>> >
>> >   if (usb_trace_enabled)
>> >
>> >   libusb_set_debug(ctx,255); // LIBUSB_LOG_LEVEL_DEBUG,
>> > LIBUSB_LOG_LEVEL_WARNING
>> >
>> >   ssize_t i = 0;
>> >
>> >   int err = 0;
>> >
>> >   ssize_t cnt = libusb_get_device_list(ctx, &list);
>> >
>> >   if (cnt < 0){
>> >
>> >     fprintf(stderr, "ERROR: no usb devices found\n" );
>> >
>> >     error();
>> >
>> >   }
>> >
>> >   // find our device. Note we are using the brute force method rather
>> >
>> >   // than open_device_with_vid_pid() because we need the device pointer
>> >
>> >   // to look at the config descriptor.
>> >
>> >   for(i = 0; i < cnt; i++){
>> >
>> >     libusb_device *device = list[i];
>> >
>> >     if( is_correctdev(device) ){
>>
>> How does the is_correctdev() function decide which device to pick?
>>
>> --
>> Matthias Bolte
>> http://photron.blogspot.com
>>
>>
>> ------------------------------------------------------------------------------
>> Infragistics Professional
>> Build stunning WinForms apps today!
>> Reboot your WinForms applications with our WinForms controls.
>> Build a bridge from your legacy apps to the future.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
>> _______________________________________________
>> libusbx-devel mailing list
>> libusbx-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/libusbx-devel
>
>
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> libusbx-devel mailing list
> libusbx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusbx-devel
>



-- 
Matthias Bolte
http://photron.blogspot.com

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to