Wow! I thought most of your guys are already retired or has millions of $
in retirement fund with no financial burden! I really admire your effort
for spending your precious free time to help the community!

Question: Does libusbx supports hotplug on Linux?? that's very import to
us. I dot not have to support hot plug in windows, but I do need to support
hot plug in Linux.

I was not doing hot plug when I was running the test, the reason I got
Access Denied is because I am trying to support HotPlug, maybe there is a
better way to do it than what I am doing. Right now I need to find out
whether a new device has just been plugged, whether an existing device has
been unplugged, so I did the following:
1) Caches a list of related device handle in the memory CACHEDLIST (when
the system started)
2) Create a seperate thread, running the following logic every 5 seconds,
the logic is as following:
    a) Enumerate all related device in the system at the moment, Create a
NEWLIST in memory
        FOREACH (related  Device in the System)
            {
                int r=libusb_open(Device)
                if (r>0)
                {
                     string Serial#=RetrieveSerial#(Device)
                     NEWLIST.add(Device with Serial#)
        }
        }

    b)  Figure out new devices just plugged in from CACHEDLIST  & NEWLIST .
        FOREACH (Device in the NEWLIST)
            {

                     string Serial#=Device.Serial#
                     Search Serial# in CACHEDLIST(also has to match product
Id and vendor id)
                     if (found)
                     {
                        This Device already in our CACHEDLIST.
            Do Nothing
             }
                     else
                     {
            This is a new device,
            Add it to CACHEDLIST.
            Notify the client New Device.
             }
         }
    c)  Find out which device has been unplugged:
        FOREACH (Device in the CACHEDLIST)
            {
                int err =Device.RetriveSerial#(Again)
                if (r<0)
                {
                    unable RetriveSerial#,
            something wrong with the device or
            most likely it has been unplugged
            This is a new device,
            Erase it from CACHEDLIST
            Notify the client device has been unplugged.
        }
         }

The "Access is denied" is coming from the Monitor Thread when it trying to
open the same device again, I was puzzled by this, because according the
the document, I should be able to reopen the same device more than once
with no error.

Anywhere I removed the hot plug Monitor  thread so I am no longer getting
the "Access is Denied" error ,rebooted my computer and let the usb stay
connected, but it still crash in the same spot. I re-generated the trace
and attached here.

I followed your advice, installed LibUSBK, changed the driver from WinUSB
(v6.1.7600.16385) to libusbK (v3.0.4.0),libusb-win32 (v1.2.5.0), in both
cases, I can not even open the device, the error message is
LIBUSB_ERROR_NOT_SUPPORTED from libusb_open.






On Fri, Sep 14, 2012 at 4:51 PM, Pete Batard <p...@akeo.ie> wrote:

> On 2012.09.14 04:42, John Chen wrote:
> > Pete,
> > I was wondering where you were?
>
> In a cubicle, where access to SF.net or personal e-mail accounts are
> actively prohibited, so that I can repay a mortgage...
> Freedom or money: pick one.
>
> > I have done the following:
> > 1) Download the latest from GIT
> > 2) Uncomment //#define DEBUG_POLL_WINDOWS" (line 51). in poll_windows.c:
> >   , added a debug printout of winusb_handle and transfer->endpoint
> > 3) recompiled libusbx as a static library
> > 4) set LIBUSB_DEBUG=4, run the app, generate trace, please see
> > LibUSBDebugTrace.txt
> > 5) I also downloaded libusbk dirver, but I am not sure how to use it,
> > right now I am using zadig_v2.0.1.154
>
> Just run Zadig and select your device (you may have to click on Options
> -> List all devices). Then select the driver in the list and click the
> Install/Replace driver button.
>
> > 6) I also added a lot of my own logging here, hopefully it will be
> helpful.
> > Please let me know if you need anything else from.
>
>  > Pod Plugged, SerialNum:1
>  > USBPlugInEvent device.ProductID 4408,device.PodType.ToString()
> exbtXDP3,device.VendorID 32902,device.m_IsOpen.ToString()) False
>
> Are you hot plugging a device?
>
> libusbx does not support hotplugging of USB devices. That's something we
> plan to add to v2.0.
> If you are hot plugging any USB device on Windows with the current
> libusbx, I'm afraid you are on your own, because this mode of operation
> is not supported.
>
>  > [365.772573] [00002424] libusbx: error [winusb_open] could not open
> device
>
> \\.\USB#VID_8086&PID_1138#5&3A81798F&0&1#{A5DCBF10-6530-11D2-901F-00C04FB951ED}
> (interface 0): [5] Access is denied.
>
> Not entirely surprising if that device was just plugged in. If that's
> the one you have a problem with, then please run a test with the device
> plugged from the start, and send us that log.
>
> Regards,
>
> /Pete
>
>
> ------------------------------------------------------------------------------
> 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
> _______________________________________________
> libusbx-devel mailing list
> libusbx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusbx-devel
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to