Michael Wilt | 8 Sep 2011 16:08

Capturing multiple devices

I am using libusb-win32 version 1.2.4.0.  I have two devices connected 
and I made the product ID different on one of them so I can tell them 
apart.  I can find both of them and open both of them, getting different 
handles, but I can only capture one at a time.  If I try to capture the 
other one I always get -5 and the text output says "device is busy".  I 
can alternate between the two of them by doing capture and release, but 
this resets the device which is really not what I want to do.  Is there 
some limitation in libusb-win32 such that only one device can be 
captured at a time?  Is anyone able to capture multiple devices?  I can 
control the device configurations and spend some time looking at power 
and bandwidth, but I have not been able to find anything in the device 
configuration that affects this issue.

Mike

Michael Wilt

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
Xiaofan Chen | 9 Sep 2011 03:21
Picon

Re: Capturing multiple devices

On Thu, Sep 8, 2011 at 10:08 PM, Michael Wilt <mike <at> mwilt.org> wrote:
> I am using libusb-win32 version 1.2.4.0.  I have two devices connected
> and I made the product ID different on one of them so I can tell them
> apart.  I can find both of them and open both of them, getting different
> handles, but I can only capture one at a time.  If I try to capture the
> other one I always get -5 and the text output says "device is busy".  I
> can alternate between the two of them by doing capture and release, but
> this resets the device which is really not what I want to do.  Is there
> some limitation in libusb-win32 such that only one device can be
> captured at a time?  Is anyone able to capture multiple devices?  I can
> control the device configurations and spend some time looking at power
> and bandwidth, but I have not been able to find anything in the device
> configuration that affects this issue.

It should work. Could you please try to post the code snippets and
the debug log using the debug version of libusb-1.2.4.0 debug
version and DebugView?

Something like this?
http://libusb.6.n5.nabble.com/testlibusb-win-fails-td3404072.html

Debug version:
http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.4.0/
Choose libusb-win32-bin-debug-1.2.4.0.zip.

--

-- 
Xiaofan

------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
(Continue reading)

Michael Wilt | 9 Sep 2011 04:41

Re: Capturing multiple devices

On 9/8/2011 9:21 PM, Xiaofan Chen wrote:
> On Thu, Sep 8, 2011 at 10:08 PM, Michael Wilt<mike <at> mwilt.org>  wrote:
>> I am using libusb-win32 version 1.2.4.0.  I have two devices connected
>> and I made the product ID different on one of them so I can tell them
>> apart.  I can find both of them and open both of them, getting different
>> handles, but I can only capture one at a time.  If I try to capture the
>> other one I always get -5 and the text output says "device is busy".  I
>> can alternate between the two of them by doing capture and release, but
>> this resets the device which is really not what I want to do.  Is there
>> some limitation in libusb-win32 such that only one device can be
>> captured at a time?  Is anyone able to capture multiple devices?  I can
>> control the device configurations and spend some time looking at power
>> and bandwidth, but I have not been able to find anything in the device
>> configuration that affects this issue.
> It should work. Could you please try to post the code snippets and
> the debug log using the debug version of libusb-1.2.4.0 debug
> version and DebugView?
>
> Something like this?
> http://libusb.6.n5.nabble.com/testlibusb-win-fails-td3404072.html
>
> Debug version:
> http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.4.0/
> Choose libusb-win32-bin-debug-1.2.4.0.zip.

Thanks for looking at this.  Here is the relevant bit from DebugView:
libusb0-sys:[release_all_interfaces] releasing all interfaces bound to 
file object 0x88cdf4a8
libusb0-sys:[get_descriptor] buffer size: 18 type: 0001 recipient: 0000 
index: 0000 language id: 0000 timeout: 5000
(Continue reading)

Travis | 9 Sep 2011 07:08
Picon

Re: Capturing multiple devices

On 9/8/2011 7:41 PM, Michael Wilt wrote:
>
> libusb0-sys:[claim_interface] interface 0
> libusb0-sys:err [claim_interface] could not claim interface 0, interface
> is already claimed
>
>
> Here is the code that claims the first one successfully:
>       struct usb_bus *bus;
>       struct usb_device *dev;
>
>       usb_init(); /* initialize the library */
>       usb_find_busses(); /* find all busses */
>       usb_find_devices(); /* find all connected devices */
>
>       for (bus = usb_get_busses(); bus; bus = bus->next) {
>           for (dev = bus->devices; dev; dev = dev->next) {
>               if (dev->descriptor.idVendor == MY_VID
> &&  dev->descriptor.idProduct == useProductID) {
>                   dev_handle = usb_open(dev);
>               }
>           }
>       }
>       int ret = usb_claim_interface(dev_handle, 0);
>
> Here is the code that tries to claim the second one:
>       for (bus = usb_get_busses(); bus; bus = bus->next) {
>           for (dev = bus->devices; dev; dev = dev->next) {
>               if (dev->descriptor.idVendor == MY_VID
> &&  dev->descriptor.idProduct == MY_PID) {
(Continue reading)

stefano ugolini | 9 Sep 2011 18:40
Picon
Favicon

usb_get_busses getting error

I'm trying to run on windows7 Mike Krueger c# code for libusb; in the past I had no problem, but apparently something has happened in my system and I get "access violation" on the usb_get_busses function.
 
In my opinion the problem is in a wrong version of libusb0.dll; at present I employ the  23/07/2011 version.
 
My code is
 
     usb_bus bus;
                    
NativeMethods.usb_init();
NativeMethods.usb_find_busses();
NativeMethods.usb_find_devices();
   for (bus =  NativeMethods.usb_get_busses(); bus!=null; bus = bus.Next)
  {
  
    ////////////
  }
 
Thanks a lot.
------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT 
space for its ease of implementation, lower cost, and increased 
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Travis | 9 Sep 2011 19:26
Picon

Re: usb_get_busses getting error

On 9/9/2011 9:40 AM, stefano ugolini wrote:
> I'm trying to run on windows7 Mike Krueger c# code for libusb; in the 
> past I had no problem, but apparently something has happened in my 
> system and I get "access violation" on the usb_get_busses function.

Unfortunately, that C# API does not marshal data correctly.  You will 
either have to fix his APIs or switch to something like LibUsbDotNet.
It has been a very long time, but I vaguely remember this problem.  It 
was one of the reasons LUDN was written fro scratch and did not spawn 
from SharpUSB.

> In my opinion the problem is in a wrong version of libusb0.dll; at 
> present I employ the  23/07/2011 version.

None of the API calls/public structs have changed, so this is probably 
not the case. e.g.  Even an old 0.1.12.1 dll will work with the newest 
1.2.5.0 driver.

Regards,
Travis

------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT 
space for its ease of implementation, lower cost, and increased 
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
stefano ugolini | 10 Sep 2011 00:21
Picon
Favicon

Re: usb_get_busses getting error

Thanks a lot; I'll switch to LibusbDotNet.

Stefano

-----Messaggio originale----- 
From: Travis
Sent: Friday, September 09, 2011 7:26 PM
To: libusb-win32-devel <at> lists.sourceforge.net
Subject: Re: [Libusb-win32-devel] usb_get_busses getting error

On 9/9/2011 9:40 AM, stefano ugolini wrote:
> I'm trying to run on windows7 Mike Krueger c# code for libusb; in the
> past I had no problem, but apparently something has happened in my
> system and I get "access violation" on the usb_get_busses function.

Unfortunately, that C# API does not marshal data correctly.  You will
either have to fix his APIs or switch to something like LibUsbDotNet.
It has been a very long time, but I vaguely remember this problem.  It
was one of the reasons LUDN was written fro scratch and did not spawn
from SharpUSB.

> In my opinion the problem is in a wrong version of libusb0.dll; at
> present I employ the  23/07/2011 version.

None of the API calls/public structs have changed, so this is probably
not the case. e.g.  Even an old 0.1.12.1 dll will work with the newest
1.2.5.0 driver.

Regards,
Travis

------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT
space for its ease of implementation, lower cost, and increased
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel

__________ Information from ESET NOD32 Antivirus, version of virus signature 
database 6441 (20110906) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT 
space for its ease of implementation, lower cost, and increased 
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
Vitali Lovich | 10 Sep 2011 07:03
Picon

Re: usb_get_busses getting error

That wasn't my experience - multiple devices required a new driver.

On Fri, Sep 9, 2011 at 10:26 AM, Travis <libusbdotnet <at> gmail.com> wrote:
> On 9/9/2011 9:40 AM, stefano ugolini wrote:
>> I'm trying to run on windows7 Mike Krueger c# code for libusb; in the
>> past I had no problem, but apparently something has happened in my
>> system and I get "access violation" on the usb_get_busses function.
>
> Unfortunately, that C# API does not marshal data correctly.  You will
> either have to fix his APIs or switch to something like LibUsbDotNet.
> It has been a very long time, but I vaguely remember this problem.  It
> was one of the reasons LUDN was written fro scratch and did not spawn
> from SharpUSB.
>
>> In my opinion the problem is in a wrong version of libusb0.dll; at
>> present I employ the  23/07/2011 version.
>
> None of the API calls/public structs have changed, so this is probably
> not the case. e.g.  Even an old 0.1.12.1 dll will work with the newest
> 1.2.5.0 driver.
>
> Regards,
> Travis
>
>
> ------------------------------------------------------------------------------
> Why Cloud-Based Security and Archiving Make Sense
> Osterman Research conducted this study that outlines how and why cloud
> computing security and archiving is rapidly being adopted across the IT
> space for its ease of implementation, lower cost, and increased
> reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>

------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Xiaofan Chen | 11 Sep 2011 12:41
Picon

Re: usb_get_busses getting error

On Sat, Sep 10, 2011 at 1:03 PM, Vitali Lovich <vlovich <at> gmail.com> wrote:
>
> On Fri, Sep 9, 2011 at 10:26 AM, Travis <libusbdotnet <at> gmail.com> wrote:
>> None of the API calls/public structs have changed, so this is probably
>> not the case. e.g.  Even an old 0.1.12.1 dll will work with the newest
>> 1.2.5.0 driver.
> That wasn't my experience - multiple devices required a new driver.

Hmm, unless you are using the filter driver, that should normally
not happen. We do fix a few bugs here and there, so it is possible
the device driver now works with more device. But if an application
works with an older version of the device driver, it should work
with the latest version of the device driver as well.

--

-- 
Xiaofan

------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage 
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
stefano ugolini | 13 Sep 2011 12:42
Picon
Favicon

problems with async i/o in LibusbDotNet

I’m trying to adapt an old c# application of mine, performing  async reading and writing on an isochronous endpoint, in order to employ libusb0 on windows7.
The example nearest to my needs is read_write_async from the LiusbDotNet project, but I had these problems: in my application every request (in reading) loses a packet per request (for example a request of 20 packets yields 19 correct packets and one is skipped); furthermore a complete request out of five is corrupted.
Well possible that the problem is in my application, but the example in the project has problems as well; apparently requests yield not complete results and the stream of data is somehow broken.
Are these problems only mine?
Or is it better to adapt the readisochronous example?
And would it be possible to adapt it to isoch writing?
 
Thanks.
 
Stefano
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel

Gmane