On Fri, Jan 20, 2012 at 8:09 AM, Xiaofan Chen <xiaof...@gmail.com> wrote: > On Fri, Jan 20, 2012 at 10:47 AM, Peter Bigot > <pabi...@users.sourceforge.net> wrote: >> On Thu, Jan 19, 2012 at 7:24 PM, Xiaofan Chen <xiaof...@gmail.com> wrote: >>> On Fri, Jan 20, 2012 at 12:02 AM, Peter Bigot >>> <pabi...@users.sourceforge.net> wrote: >>> Is this libusb-0.1.12-72 the legacy libusb-0.1 version? Or is >>> it libusb-compat which is based on libusb-1.0? >> >> I believe it is legacy; the distribution (openSUSE 10.3) is five years old. > > I see. That is a very old distro in the world of Linux.
Yes. SUSE Enterprise 10.3 (2007) and RHEL 4.8 (2005) are apparently the only ones the client is allowed to install. Corporate IT departments live in a strange reality. >>> Most the Linux distributions (other than Debian/Ubuntu) ship >>> with libusb-compat. It seems to me libusb-compat uses the >>> location field of the usb_bus structure as the bus number. >>> >>> http://git.libusb.org/?p=libusb-compat-0.1.git;a=blob;f=libusb/core.c;hb=HEAD;js=1 >>> 192 /* iterate over the device list, identifying the individual >>> busses. >>> 193 * we use the location field of the usb_bus structure to store >>> the >>> 194 * bus number. */ >>> >>> Maybe the behavior of the legacy libusb-0.1 is a bit different. > > I will check in the libusb mailing list to see if this is the case or not. > >> If so, perhaps we need a way to determine which is being used. If the >> script I put in the commit comment actually works when "libusb01" is >> being used as a back-end, then there's a conflict; if it doesn't, then >> the fix is probably right. > > I think it is basically not possible to easily differentiate libusb-compat > and legacy libusb-0.1 since libusb-compat is supposed to replace > libusb-0.1. OK. You haven't said whether the patch causes problems for libusb-compat; I assure you it's necessary for this particular version of legacy libusb-0.1, so if it doesn't break compat I think it should be installed (and if it does, then it's not as "compat" as it should be). >> Is there a way to influence the selection of back end if multiple ones >> are available? I didn't dig into how it was done, but did notice that >> libusb01 was listed before libusb1 in at least one place. > > I believe libusb1 is chosen before libusb01. If so, and if libusb1 must be present for libusb-compat to function, then having the behavior be correct with legacy libusb would seem to make more sense. At any rate, the patch works for me, so even if it doesn't pass for upstream having the 'how-to-fix' information archived here is enough. > You can also force to use a certain backend. > > Reference: > http://comments.gmane.org/gmane.comp.python.pyusb.user/276 > > eg: > > import usb.core > import usb.backend.libusb01 > b = usb.backend.libusb01.get_backend() > assert b is not None Thanks. > -- > Xiaofan > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > pyusb-users mailing list > pyusb-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyusb-users ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users