Bug 1417637 - libusbx should provide a DLL with WinUSB backend as well
Summary: libusbx should provide a DLL with WinUSB backend as well
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw-libusbx
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Victor Toso
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-30 13:31 UTC by Thomas Sailer
Modified: 2018-08-15 04:04 UTC (History)
5 users (show)

Fixed In Version: mingw-libusbx-1.0.22-1.fc28
Clone Of:
Environment:
Last Closed: 2018-08-15 04:04:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Thomas Sailer 2017-01-30 13:31:48 UTC
Description of problem:
mingw-libusbx has changed to the UsbDk backend. However, UsbDk doesn't work for a number of devices where WinUSB works, such as the popular FTDI USB controllers. Unfortunately, libusb doesn't have a dynamic backend switching facility. Therefore, for the time being, mingw-libusbx should provide both a DLL built with the UsbDk backend, as well as one built with the WinUSB backend.

See here:
https://copr.fedorainfracloud.org/coprs/sailer/mingw/package/mingw-libusbx-wu/

Comment 1 Victor Toso 2017-01-31 07:45:14 UTC
(In reply to Thomas Sailer from comment #0)
> Description of problem:
> mingw-libusbx has changed to the UsbDk backend. However, UsbDk doesn't work
> for a number of devices where WinUSB works, such as the popular FTDI USB
> controllers.

Is it a limitation on UsbDk or a bug? You can file under UsbDk component at https://bugs.freedesktop.org/enter_bug.cgi?product=Spice 

> Unfortunately, libusb doesn't have a dynamic backend switching
> facility. Therefore, for the time being, mingw-libusbx should provide both a
> DLL built with the UsbDk backend, as well as one built with the WinUSB
> backend.
>
> See here:
> https://copr.fedorainfracloud.org/coprs/sailer/mingw/package/mingw-libusbx-
> wu/

It is a workaround, not sure if a good one due the change of the library name?

Comment 2 Thomas Sailer 2017-01-31 10:02:25 UTC
(In reply to Victor Toso from comment #1)

> Is it a limitation on UsbDk or a bug? You can file under UsbDk component at
> https://bugs.freedesktop.org/enter_bug.cgi?product=Spice 

I don't know. I would even do that if I found a version of tracetool that worked.

> It is a workaround, not sure if a good one due the change of the library
> name?

Sure it's not the most elegant thing to do. But it is still better than silently breaking working setups with just an RPM changelog entry

Comment 3 Victor Toso 2017-01-31 10:23:47 UTC
(In reply to Thomas Sailer from comment #2)
> Sure it's not the most elegant thing to do. But it is still better than
> silently breaking working setups with just an RPM changelog entry

Yeah, that's not nice. Sorry about that.

Dmitry, any suggestions?

Comment 4 Dmitry Fleytman 2017-01-31 15:01:49 UTC
As to FTDI USB controllers, I'm looking into the issue. Not yet sure what is the problem.

As to mingw-libusbx, don't we use dynamic backend selection patch there?

Comment 5 Victor Toso 2017-02-01 13:16:33 UTC
(In reply to Dmitry Fleytman from comment #4)
> As to mingw-libusbx, don't we use dynamic backend selection patch there?

This one? https://github.com/libusb/libusb/commit/57cfbb444e03179a4e4eafba18416209f0db1d1c

It should be in the 1.0.21 release. That's what we have in Fedora 25/rawhide. The only change we did in the configure was including --enable-usbdk, see:

http://pkgs.fedoraproject.org/cgit/rpms/mingw-libusbx.git/commit/?id=b54b90d3df0135c7cefc5f33a58a2fef3a10a248

Comment 6 Thomas Sailer 2017-02-01 13:58:28 UTC
Right now libusb_init fails on all machines that don't have UsbDk installed. A nicer behaviour would be to fall back to the winusb backend if UsbDk isn't installed.

Comment 8 Dmitry Fleytman 2017-02-02 15:36:33 UTC
FTDI USB controllers issue fix is pushed upstream and will be released in UsbDk v1.0.16.

Comment 10 Victor Toso 2017-02-03 07:46:57 UTC
(In reply to Dmitry Fleytman from comment #8)
> FTDI USB controllers issue fix is pushed upstream and will be released in
> UsbDk v1.0.16.

Just for the record, I think this is the commit that fixes the issue (correct me if I'm wrong)
https://github.com/daynix/UsbDk/commit/db95b4651e079e59353d8bafa84cc5ad23c4f2b1

Keeping the bug open to track dynamic backend selection, that should address comment #6

Comment 15 Fedora End Of Life 2017-11-16 19:39:17 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 18 Victor Toso 2018-02-19 13:19:39 UTC
Upstream bug is: https://github.com/libusb/libusb/pull/309
Patch that fixes the issue from comment #6 (dynamic backend selection)

commit 54884e84d024e761450287ab56aca8fc69f45d01
Author: Chris Dickens <christopher.a.dickens>
Date:   Mon Jan 8 10:17:26 2018 -0800

    Windows: Enable dynamic selection between WinUSB and UsbDk backends
    
    This commit unifies the two Windows backends into a single project and
    enables the user to switch to the UsbDk backend, if available, using the
    libusb_set_option() function. All contexts will use the WinUSB backend
    by default for backwards compatibility.
    
    With this change, the UsbDk-specific projects are no longer required.
    
    Closes #309
    
    Signed-off-by: Chris Dickens <christopher.a.dickens>

Comment 19 Victor Toso 2018-02-19 13:23:20 UTC
This should be fixed on release v1.0.22

Comment 20 Thomas Sailer 2018-02-20 17:45:10 UTC
Yes, looks like it will be fixed in 1.0.22, but 1.0.22 isn't released yet and it's not in our repos...

Incidentally, are there binaries for UsbDk 1.00-20 somewhere?

Comment 21 Victor Toso 2018-02-21 07:24:44 UTC
(In reply to Thomas Sailer from comment #20) 
> Incidentally, are there binaries for UsbDk 1.00-20 somewhere?

Last release is 1.0.19

https://github.com/daynix/UsbDk/releases

or

https://www.spice-space.org/download.html

Comment 22 Victor Toso 2018-08-07 08:46:04 UTC
Should be fixed by 
https://github.com/libusb/libusb/commit/54884e84d024e761450287ab56aca

In libusb 1.0.22

Comment 23 Fedora Update System 2018-08-07 08:47:07 UTC
mingw-libusbx-1.0.22-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-00616865ff

Comment 24 Fedora Update System 2018-08-07 15:25:26 UTC
mingw-libusbx-1.0.22-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-00616865ff

Comment 25 Fedora Update System 2018-08-15 04:04:59 UTC
mingw-libusbx-1.0.22-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.