1 Nov 2010 04:20
Re: [libusb] #70: device removal breaks internal state, making later libusb_open calls always fail
Xiaofan Chen <xiaofanc <at> gmail.com>
2010-11-01 03:20:57 GMT
2010-11-01 03:20:57 GMT
Just an historical information here. I believe libusb-win32 is okay as well. But it might be interesting to re-write Stephan Meyer's test program with libusb-1.0 under Windows and see how it works. -- Xiaofan On Fri, Sep 29, 2006 at 2:55 AM, Stephan Meyer wrote: > > I tried the same on my system (WinXP, 2GHz CPU) and my test program > (code attached) consumes less than 5% of CPU resources. > > But if I enable debugging by calling usb_set_debug(4) and if I connect > a tool such as DebugView to capture the debug messages then CPU > load goes up to 80%. > > Try to disable debug messages by calling usb_set_debug(0) after usb_init(). > > My test program also calls usb_find_devices() from a seperate thread and > it doesn't crash (as you mentioned in your other mail). If I unplug my device > then the application just terminates. > The current DLL isn't fully thread safe but refreshing the device list from > a second thread shouldn't crash the DLL. > > Which version of the DLL are you using? Have you tried one of the latest > development versions? > > Stephan(Continue reading)
#define VENDOR_ID 0x0925
#define PRODUCT_ID 0x7001
// remove this define to avoid the error (appends sleep(1) to the loop)
//#define BREAK_LIBUSB
libusb_device_handle *m_device;
int main(void)
{
if (libusb_init(NULL) != 0)
{
printf("could not init libusb context\n");
RSS Feed