Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows_winusb libusb_get_device_list: bus numbers are defined and assigned to root hubs directly during the hub pass, by enforcing the defintion of root hub as being a hub without parent. #1202

Conversation

sonatique
Copy link
Contributor

@sonatique sonatique commented Oct 4, 2022

windows: define bus numbers without using HCD

Bus numbers are defined and assigned to root hubs directly
during the hub pass of winusb libusb_get_device_list, using the
definition of a root hub as being a hub without parent at port 0.

Therefore the HCD pass is no longer used for defining root hubs.

Note: assigned bus number values for a given setup are not guaranteed
to remain constant when migrating from previous implementation to this
one.

The rational behind this change is that:

  • Implementation using CM_Get_Child from HCD to get root hub devInst is
    not working when using "FabulaTech Virtual USB Host Controller"
    (USB-Ethernet bridge) under Hyper-V virtual machine.

  • This new way of enumerating is inspired by "USB Device Viewer" Microsoft
    driver sample code which is capable of correctly enumerating hubs and
    devices in the above mentioned configuration as well as in regular
    configurations.

@mcuee
Copy link
Member

mcuee commented Oct 5, 2022

I think this is a interesting idea and a good idea.

@sonatique sonatique force-pushed the winusb-use-root-hubs-instead-of-HCD-to-define-and-assign-bus-numbers branch from 2b43ecf to f6727a5 Compare January 11, 2023 18:05
@mcuee
Copy link
Member

mcuee commented Jan 13, 2023

@pbatard

I am sorry to ping you but you may be the only person who can comment on this idea now that @dickens is not active for quite a while. Thanks.

@pbatard
Copy link
Contributor

pbatard commented Jan 13, 2023

I'm afraid I don't have the scope to be roped in back into libusb, and I don't want to leave some kind of seal of approval for what would be, at best, a half-assed review, since the Windows libusb enumeration code has changed quite a bit from my time.

I will make the two following remarks though:

  • Please don't use "some" in the patch description (some virtual machine implementations, some ethernet-USB bridges, some corner cases). If you've seen breakage somewhere, name it explicitly so that, if needed, this can be validated by third parties and also, so that, if someone has to alter these changes in the future, they get a chance of being able to check for breakage/regressions with the scenarios that were problematic. Being vague is not helping anyone.
  • This should be tested as much as possible for breakage/regression because my recollection is that changes to Windows enumeration often led to unintended side effects.

Oh, and there's a typo with implemenations in the commit description.

@mcuee
Copy link
Member

mcuee commented Jan 13, 2023

@pbatard

Thanks a lot for sharing your views. I understand that this needs more detailed review.

@sonatique
Copy link
Contributor Author

sonatique commented Jan 14, 2023

I'm afraid I don't have the scope to be roped in back into libusb, and I don't want to leave some kind of seal of approval for what would be, at best, a half-assed review, since the Windows libusb enumeration code has changed quite a bit from my time.

I will make the two following remarks though:

  • Please don't use "some" in the patch description (some virtual machine implementations, some ethernet-USB bridges, some corner cases). If you've seen breakage somewhere, name it explicitly so that, if needed, this can be validated by third parties and also, so that, if someone has to alter these changes in the future, they get a chance of being able to check for breakage/regressions with the scenarios that were problematic. Being vague is not helping anyone.
  • This should be tested as much as possible for breakage/regression because my recollection is that changes to Windows enumeration often led to unintended side effects.

Oh, and there's a typo with implemenations in the commit description.

Got it, thanks @pbatard . I will do what you said regarding the description of the changes.

Regarding testing: I did my best to test this changes under Windows, but of course my scope is limited, it is difficult to guarantee 100% safety, though the changes affecting a root part of the enumeration, my guess would be that we should quite easily detect issues..

@mcuee
Copy link
Member

mcuee commented Jan 14, 2023

The first difference is that bus number is now different. This is probably okay and as intended.

$ ./examples/testlibusb.exe
Dev (bus 1, device 11): 16C0 - 05DC speed: 1.5M
  Manufacturer:              www.fischl.de
  Product:                   USBasp
Dev (bus 2, device 1): 05E3 - 0612 speed: 5G
Dev (bus 1, device 13): 0403 - 6001 speed: 12M
Dev (bus 1, device 6): 8087 - 0026 speed: 12M
Dev (bus 1, device 12): 04F2 - B6DD speed: 480M
  Manufacturer:              Chicony Electronics Co.,Ltd.
  Product:                   HD User Facing
Dev (bus 1, device 5): 1C7A - 0575 speed: 480M
Dev (bus 1, device 0): 8086 - A0ED speed: 5G
Dev (bus 1, device 2): 05E3 - 0610 speed: 480M
Dev (bus 1, device 3): 046D - C52B speed: 12M
  Manufacturer:              Logitech
  Product:                   USB Receiver
Dev (bus 2, device 0): 8086 - 9A13 speed: 5G

$ ./examples/listdevs.exe
16c0:05dc (bus 1, device 11) path: 1
05e3:0612 (bus 2, device 1) path: 2
0403:6001 (bus 1, device 13) path: 2.2
8087:0026 (bus 1, device 6) path: 10
04f2:b6dd (bus 1, device 12) path: 5
1c7a:0575 (bus 1, device 5) path: 7
8086:a0ed (bus 1, device 0)
05e3:0610 (bus 1, device 2) path: 2
046d:c52b (bus 1, device 3) path: 3
8086:9a13 (bus 2, device 0)

$ ../libusb_pr1202/examples/testlibusb.exe
Dev (bus 2, device 11): 16C0 - 05DC speed: 1.5M
  Manufacturer:              www.fischl.de
  Product:                   USBasp
Dev (bus 3, device 1): 05E3 - 0612 speed: 5G
Dev (bus 2, device 13): 0403 - 6001 speed: 12M
Dev (bus 2, device 6): 8087 - 0026 speed: 12M
Dev (bus 2, device 12): 04F2 - B6DD speed: 480M
  Manufacturer:              Chicony Electronics Co.,Ltd.
  Product:                   HD User Facing
Dev (bus 2, device 5): 1C7A - 0575 speed: 480M
Dev (bus 2, device 0): 1D6B - 0004 speed: 5G
Dev (bus 2, device 2): 05E3 - 0610 speed: 480M
Dev (bus 2, device 3): 046D - C52B speed: 12M
  Manufacturer:              Logitech
  Product:                   USB Receiver
Dev (bus 3, device 0): 1D6B - 0004 speed: 5G

$ ../libusb_pr1202/examples/listdevs.exe
16c0:05dc (bus 2, device 11) path: 1
05e3:0612 (bus 3, device 1) path: 2
0403:6001 (bus 2, device 13) path: 2.2
8087:0026 (bus 2, device 6) path: 10
04f2:b6dd (bus 2, device 12) path: 5
1c7a:0575 (bus 2, device 5) path: 7
1d6b:0004 (bus 2, device 0)
05e3:0610 (bus 2, device 2) path: 2
046d:c52b (bus 2, device 3) path: 3
1d6b:0004 (bus 3, device 0)

@mcuee
Copy link
Member

mcuee commented Jan 14, 2023

xusb example seems to work fine.

$ ./examples/xusb.exe 16c0:05dc
Using libusb v1.0.26.11760

Opening device 16C0:05DC...

Reading device descriptor:
            length: 18
      device class: 0
               S/N: 3
           VID:PID: 16C0:05DC
         bcdDevice: 0110
   iMan:iProd:iSer: 1:2:3
          nb confs: 1

Reading BOS descriptor: 2 caps
    Container ID:
      {b9d357ad-6611-f843-8790-ebe14ddc7594}
    Unknown BOS device capability 05:

Reading first configuration descriptor:
              total length: 50
         descriptor length: 9
             nb interfaces: 2
              interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 0
   Class.SubClass.Protocol: FF.00.00
              interface[1]: id = 1
interface[1].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: 03.00.00
       endpoint[0].address: 81
           max packet size: 0008
          polling interval: 0A
       endpoint[1].address: 01
           max packet size: 0008
          polling interval: 0A

Kernel driver attached for interface 0: -12

Claiming interface 0...

Kernel driver attached for interface 1: -12

Claiming interface 1...

Reading string descriptors:
   String (0x01): "www.fischl.de"
   String (0x02): "USBasp"
   String (0x03): "0001"

Reading OS string descriptor: no descriptor

Releasing interface 0...
Releasing interface 1...
Closing device...

$ ../libusb_pr1202/examples/xusb 16c0:05dc
Using libusb v1.0.26.11760

Opening device 16C0:05DC...

Reading device descriptor:
            length: 18
      device class: 0
               S/N: 3
           VID:PID: 16C0:05DC
         bcdDevice: 0110
   iMan:iProd:iSer: 1:2:3
          nb confs: 1

Reading BOS descriptor: 2 caps
    Container ID:
      {b9d357ad-6611-f843-8790-ebe14ddc7594}
    Unknown BOS device capability 05:

Reading first configuration descriptor:
              total length: 50
         descriptor length: 9
             nb interfaces: 2
              interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 0
   Class.SubClass.Protocol: FF.00.00
              interface[1]: id = 1
interface[1].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: 03.00.00
       endpoint[0].address: 81
           max packet size: 0008
          polling interval: 0A
       endpoint[1].address: 01
           max packet size: 0008
          polling interval: 0A

Kernel driver attached for interface 0: -12

Claiming interface 0...

Kernel driver attached for interface 1: -12

Claiming interface 1...

Reading string descriptors:
   String (0x01): "www.fischl.de"
   String (0x02): "USBasp"
   String (0x03): "0001"

Reading OS string descriptor: no descriptor

Releasing interface 0...
Releasing interface 1...
Closing device...

@mcuee
Copy link
Member

mcuee commented Jan 14, 2023

I also test using avrdude with the above usbasp programmer (USB Composite Device -- WinUSB + HID).

$ ldd /mingw64/bin/avrdude
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffcd6ad0000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffcd4f40000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ffcd42b0000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ffcd52e0000)
        SETUPAPI.dll => /c/WINDOWS/System32/SETUPAPI.dll (0x7ffcd65f0000)
        HID.DLL => /c/WINDOWS/SYSTEM32/HID.DLL (0x7ffcd2790000)
        WS2_32.dll => /c/WINDOWS/System32/WS2_32.dll (0x7ffcd5f10000)
        RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7ffcd4b30000)
        libusb-1.0.dll => /mingw64/bin/libusb-1.0.dll (0x7ffc9f8d0000)
        libhidapi-0.dll => /mingw64/bin/libhidapi-0.dll (0x7ffcc1c20000)
        libusb-0-1-4.dll => /mingw64/bin/libusb-0-1-4.dll (0x7ffcc1c00000)
        libftdi1.dll => /mingw64/bin/libftdi1.dll (0x7ffc9f8a0000)

$ avrdude -c usbasp -p m328p -U flash:r:m328p_test.hex:i

avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e950f (probably m328p)
avrdude: reading flash memory ...

Reading | ################################################## | 100% 6.15 s

avrdude: writing output file m328p_test.hex

avrdude done.  Thank you.

@sonatique
Copy link
Contributor Author

sonatique commented Jan 14, 2023

The first difference is that bus number is now different. This is probably okay and as intended.

@mcuee : thanks for testing. Yes, bus numberx are different with my changes. From what I understood, I think it is ok, given those number are anyway arbitrary. They only have to be unique and stable from one enumeration to the other.

@tormodvolden
Copy link
Contributor

We should mention in the release notes that bus numbers might change, so it can be helpful to mention it in the commit message in the first place. There are setups where identical USB devices are identified by where they are plugged in.

About commit messages, they should ideally be formatted to 72 chars width and have a free-standing summary line (see for instance Commit Guidelines on https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project).

@tormodvolden
Copy link
Contributor

The passname array also needs updating.

@tormodvolden
Copy link
Contributor

tormodvolden commented Jan 18, 2023

In the listdevs test case above, the bus numbers start at 2. Is that expected? Where is bus number 1 attributed?

It seems fine that the bus numbers will change from previous libusb versions, but if this is just an unnecessary off-by-one issue, this is not there yet.

@sonatique
Copy link
Contributor Author

In the listdevs test case above, the bus numbers start at 2. Is that expected? Where is bus number 1 attributed?

It seems fine that the bus numbers will change from previous libusb versions, but if this is just an unnecessary off-by-one issue, this is not there yet.

Thanks for poiting this out, I'll check ASAP

@tormodvolden
Copy link
Contributor

Great. BTW, for copyright reasons it would be preferable to have your full name if possible as commit author (and eventually in AUTHORS).

@mcuee
Copy link
Member

mcuee commented Jan 20, 2023

Pre-build binary for Windows on ARM64, using VS2022.
bin_pr1202_Win_Arm64.zip

@sonatique sonatique force-pushed the winusb-use-root-hubs-instead-of-HCD-to-define-and-assign-bus-numbers branch from f6727a5 to 34e1d78 Compare January 26, 2023 06:19
@mcuee
Copy link
Member

mcuee commented Jan 26, 2023

I am not so sure if the following patch is correct or not but it will give the same bus_number as git HEAD.

PS C:\work\libusb\libusb_pr1202_mod> git diff
diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c
index 6ebe74b9..44d5fa0a 100644
--- a/libusb/os/windows_winusb.c
+++ b/libusb/os/windows_winusb.c
@@ -1792,7 +1792,7 @@ static int winusb_get_device_list(struct libusb_context *ctx, struct discovered_
                                                        break;
                                                }

-                                               dev->bus_number = ++bus_number;
+                                               dev->bus_number = bus_number++;
                                                usbi_dbg(ctx, "assigning Root Hub '%s' bus number %u", dev_id, bus_number);
                                        }
                                        else

PS C:\work\libusb\libusb_pr1202_mod> .\build\v143\x64\Release\listdevs.exe
16c0:05dc (bus 1, device 7) path: 1
05e3:0612 (bus 2, device 1) path: 2
8087:0026 (bus 1, device 1) path: 10
04f2:b6dd (bus 1, device 4) path: 5
1c7a:0575 (bus 1, device 3) path: 7
1d6b:0004 (bus 1, device 0)
05e3:0610 (bus 1, device 6) path: 2
046d:c52b (bus 1, device 2) path: 3
1d6b:0004 (bus 2, device 0)

PS C:\work\libusb\libusb_pr1202_mod> .\build\v143\x64\Release\testlibusb.exe
Dev (bus 1, device 7): 16C0 - 05DC speed: 1.5M
  Manufacturer:              www.fischl.de
  Product:                   USBasp
Dev (bus 2, device 1): 05E3 - 0612 speed: 5G
Dev (bus 1, device 1): 8087 - 0026 speed: 12M
Dev (bus 1, device 4): 04F2 - B6DD speed: 480M
Dev (bus 1, device 3): 1C7A - 0575 speed: 480M
Dev (bus 1, device 0): 1D6B - 0004 speed: 5G
Dev (bus 1, device 6): 05E3 - 0610 speed: 480M
Dev (bus 1, device 2): 046D - C52B speed: 12M
  Manufacturer:              Logitech
  Product:                   USB Receiver
Dev (bus 2, device 0): 1D6B - 0004 speed: 5G

@tormodvolden
Copy link
Contributor

tormodvolden commented Jan 26, 2023

Great. BTW, for copyright reasons it would be preferable to have your full name if possible as commit author (and eventually in AUTHORS).

I was a bit unclear here. By "eventually" I mean that the names in the commit log will eventually end up in the AUTHORS list, when we update that list manually once before release. Please don't touch the AUTHORS file in patches and PRs. Just make sure you have your proper, real name as commit author.

@sonatique
Copy link
Contributor Author

@tormodvolden : oups, sorry, OK I'll remove that change (I felt a little bit presomptuous to add my own name to the author list anyway).

For the other remaining question: (changes or not in bus numbers): sorry, I have been diverted from this PR by other tasks, but I'll come back as soon as possible with a final proposal. I am not sure I will be able to gurantee same bus numbers as head and the fact that my implementation was giving bus numbers equal to head + 1 in one of the run above seems like a coincidence to me. Basically the way to come up with bus number changed completely from one abritrary set of number to another one. By "arbitrary" I mean that it basically depends on how the system orders its object internally, not "random".

@tormodvolden
Copy link
Contributor

Yes, if the numbers change around a bit that is not a blocker. However that the numbers always started at 1 before and now starts at 2 is not good. If you cannot answer where the number 1 went, you don't understand your patch well enough, and I will be reluctant to merge it :)

@ArminiusTux
Copy link

Dear @mcuee,

Apart from an exe run-test, is there anything specific you would like me to test on WinARM64 (v10.0.22621)?

> C:\Temp\bin_pr1202_Win_Arm64\bin>dpfp
> Could not find/open device
> 
> C:\Temp\bin_pr1202_Win_Arm64\bin>dpfp_threaded
> Could not find/open device
> 
> C:\Temp\bin_pr1202_Win_Arm64\bin>fxload
> no firmware specified!
> 
> Usage: fxload [-v] [-V] [-t type] [-d vid:pid] [-p bus,addr] [-s loader] -i firmware
>   -i <path>       -- Firmware to upload
>   -s <path>       -- Second stage loader
>   -t <type>       -- Target type: an21, fx, fx2, fx2lp, fx3
>   -d <vid:pid>    -- Target device, as an USB VID:PID
>   -p <bus,addr>   -- Target device, as a libusb bus number and device address path
>   -v              -- Increase verbosity
>   -q              -- Decrease verbosity (silent mode)
>   -V              -- Print program version
> 
> C:\Temp\bin_pr1202_Win_Arm64\bin>hotplugtest
> Hotplug capabilities are not supported on this platform
> 
> C:\Temp\bin_pr1202_Win_Arm64\bin>listdevs
> 1d6b:0004 (bus 2, device 0)
> 045e:02d5 (bus 2, device 5) path: 1.4
> 05e3:0749 (bus 2, device 3) path: 2.2
> 05e3:0610 (bus 2, device 4) path: 1
> 0b95:1790 (bus 2, device 2) path: 2.1
> 1d6b:0004 (bus 1, device 0)
> 0781:5567 (bus 2, device 6) path: 1.3
> 05e3:0626 (bus 2, device 1) path: 2
> 1c4f:007c (bus 1, device 1) path: 1
> 
> C:\Temp\bin_pr1202_Win_Arm64\bin>sam3u_benchmark
> Error finding USB device
> 
> C:\Temp\bin_pr1202_Win_Arm64\bin>stress
> Starting test run: init_and_exit...
> Success (0)
> Starting test run: get_device_list...
> ^C
> C:\Temp\bin_pr1202_Win_Arm64\bin>
> 
> C:\Temp\bin_pr1202_Win_Arm64\bin>testlibusb
> Dev (bus 2, device 0): 1D6B - 0004 speed: 5G
> Dev (bus 2, device 4): 045E - 02D5 speed: 480M
> Dev (bus 2, device 3): 05E3 - 0749 speed: 5G
> Dev (bus 2, device 2): 05E3 - 0610 speed: 480M
> Dev (bus 2, device 5): 0B95 - 1790 speed: 5G
> Dev (bus 1, device 0): 1D6B - 0004 speed: 5G
> Dev (bus 2, device 6): 0781 - 5567 speed: 480M
> Dev (bus 2, device 1): 05E3 - 0626 speed: 5G
> Dev (bus 1, device 1): 1C4F - 007C speed: 1.5M
>   Manufacturer:              SIGMACHIP
>   Product:                   USB Keyboard
> 
> C:\Temp\bin_pr1202_Win_Arm64\bin>xusb
> usage: xusb [-h] [-d] [-i] [-k] [-b file] [-l lang] [-j] [-x] [-s] [-p] [-w] [vid:pid]
>    -h      : display usage
>    -d      : enable debug output
>    -i      : print topology and speed info
>    -j      : test composite FTDI based JTAG device
>    -k      : test Mass Storage device
>    -b file : dump Mass Storage data to file 'file'
>    -p      : test Sony PS3 SixAxis controller
>    -s      : test Microsoft Sidewinder Precision Pro (HID)
>    -x      : test Microsoft XBox Controller Type S
>    -l lang : language to report errors in (ISO 639-1)
>    -w      : force the use of device requests when querying WCID descriptors
> If only the vid:pid is provided, xusb attempts to run the most appropriate test
> 
> C:\Temp\bin_pr1202_Win_Arm64\bin>xusb -k
> Using libusb v1.0.26.11760
> 
> Opening device 0204:6025...
> libusb: info [winusb_get_device_list] The following device has no driver: 'USB\VID_045E&PID_02D5\001129070415'
> libusb: info [winusb_get_device_list] libusb will not be able to access it
> libusb: info [init_device] 0x45e:0x2d5 found 1 configurations but device isn't configured, forcing current configuration to 1
>   Failed.
>

@mcuee
Copy link
Member

mcuee commented Feb 5, 2023

@ArminiusTux

Thanks for the help. It is great that we can see "bus 1` from your test.

> C:\Temp\bin_pr1202_Win_Arm64\bin>testlibusb
> Dev (bus 2, device 0): 1D6B - 0004 speed: 5G
> Dev (bus 2, device 4): 045E - 02D5 speed: 480M
> Dev (bus 2, device 3): 05E3 - 0749 speed: 5G
> Dev (bus 2, device 2): 05E3 - 0610 speed: 480M
> Dev (bus 2, device 5): 0B95 - 1790 speed: 5G
> Dev (bus 1, device 0): 1D6B - 0004 speed: 5G
> Dev (bus 2, device 6): 0781 - 5567 speed: 480M
> Dev (bus 2, device 1): 05E3 - 0626 speed: 5G
> Dev (bus 1, device 1): 1C4F - 007C speed: 1.5M
>   Manufacturer:              SIGMACHIP
>   Product:                   USB Keyboard

It will be great that you can test xusb with a device with the WinUSB driver. As of now, Zadig does not work under Windows on ARM, so you need a generic device which use WinUSB driver to test it out. The best is probably those generic USB device with the WCID descriptor.

Ref:

@ArminiusTux
Copy link

Here you go @mcuee

Android phone (MTP mode)

WinUSB (v10.0.22621.608) drivers coming along with Windows 11 v22H2 (ARM64)

C:\Temp\bin_pr1202_Win_Arm64\bin>xusb 1004:633E
Using libusb v1.0.26.11760

Opening device 1004:633E...

Reading device descriptor:
          length: 18
    device class: 0
             S/N: 3
         VID:PID: 1004:633E
       bcdDevice: 0232
 iMan:iProd:iSer: 1:2:3
        nb confs: 1

Reading BOS descriptor: libusb: error [winusbx_claim_interface] could not access interface 0: [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 1 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 2 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 3 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 4 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 5 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 6 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 7 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 8 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 9 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 10 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 11 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 12 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 13 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 14 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 15 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 16 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 17 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 18 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 19 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 20 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 21 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 22 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 23 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 24 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 25 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 26 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 27 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 28 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 29 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 30 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 31 with WinUSB): [1] Unzulõssige Funktion.
libusb: error [auto_claim] could not auto-claim any interface
libusb: error [libusb_get_bos_descriptor] failed to read BOS (-5)
no descriptor

Reading first configuration descriptor:
            total length: 39
       descriptor length: 9
           nb interfaces: 1
            interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 3
 Class.SubClass.Protocol: FF.FF.00
     endpoint[0].address: 81
         max packet size: 0200
        polling interval: 00
     endpoint[1].address: 01
         max packet size: 0200
        polling interval: 00
     endpoint[2].address: 82
         max packet size: 001C
        polling interval: 06

Kernel driver attached for interface 0: -12

Claiming interface 0...
libusb: error [winusbx_claim_interface] could not access interface 0: [1] Unzulõssige Funktion.
 Failed.

Reading string descriptors:
libusb: error [winusbx_claim_interface] could not access interface 0: [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 1 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 2 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 3 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 4 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 5 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 6 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 7 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 8 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 9 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 10 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 11 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 12 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 13 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 14 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 15 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 16 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 17 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 18 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 19 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 20 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 21 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 22 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 23 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 24 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 25 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 26 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 27 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 28 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 29 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 30 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 31 with WinUSB): [1] Unzulõssige Funktion.
libusb: error [auto_claim] could not auto-claim any interface
libusb: error [winusbx_claim_interface] could not access interface 0: [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 1 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 2 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 3 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 4 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 5 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 6 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 7 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 8 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 9 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 10 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 11 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 12 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 13 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 14 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 15 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 16 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 17 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 18 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 19 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 20 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 21 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 22 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 23 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 24 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 25 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 26 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 27 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 28 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 29 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 30 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 31 with WinUSB): [1] Unzulõssige Funktion.
libusb: error [auto_claim] could not auto-claim any interface
libusb: error [winusbx_claim_interface] could not access interface 0: [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 1 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 2 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 3 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 4 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 5 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 6 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 7 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 8 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 9 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 10 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 11 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 12 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 13 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 14 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 15 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 16 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 17 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 18 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 19 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 20 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 21 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 22 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 23 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 24 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 25 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 26 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 27 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 28 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 29 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 30 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 31 with WinUSB): [1] Unzulõssige Funktion.
libusb: error [auto_claim] could not auto-claim any interface

Reading OS string descriptor:libusb: error [winusbx_claim_interface] could not access interface 0: [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 1 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 2 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 3 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 4 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 5 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 6 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 7 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 8 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 9 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 10 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 11 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 12 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 13 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 14 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 15 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 16 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 17 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 18 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 19 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 20 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 21 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 22 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 23 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 24 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 25 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 26 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 27 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 28 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 29 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 30 with WinUSB): [1] Unzulõssige Funktion.
libusb: warning [winusbx_claim_interface] failed to auto-claim interface 0 (required to claim 31 with WinUSB): [1] Unzulõssige Funktion.
libusb: error [auto_claim] could not auto-claim any interface
no descriptor

Releasing interface 0...
Closing device...
TV tuner (DVB)

Drivers created by Zadig and modified (ARM64) using solely the winusb.sys (v10.0.22621.608)

C:\Temp\bin_pr1202_Win_Arm64\bin>xusb 045E:02D5
Using libusb v1.0.26.11760

Opening device 045E:02D5...

Reading device descriptor:
          length: 18
    device class: 0
             S/N: 3
         VID:PID: 045E:02D5
       bcdDevice: 0110
 iMan:iProd:iSer: 1:2:3
        nb confs: 1

Reading BOS descriptor: no descriptor

Reading first configuration descriptor:
            total length: 46
       descriptor length: 9
           nb interfaces: 1
            interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 4
 Class.SubClass.Protocol: FF.00.00
     endpoint[0].address: 01
         max packet size: 0200
        polling interval: 01
     endpoint[1].address: 81
         max packet size: 0200
        polling interval: 01
     endpoint[2].address: 82
         max packet size: 0200
        polling interval: 01
     endpoint[3].address: 83
         max packet size: 0200
        polling interval: 01

Kernel driver attached for interface 0: -12

Claiming interface 0...

Reading string descriptors:
 String (0x01): "Microsoft Corp."
 String (0x02): "Xbox USB Tuner"
 String (0x03): "001129070415"

Reading OS string descriptor: no descriptor

Releasing interface 0...
Closing device...

@mcuee
Copy link
Member

mcuee commented Feb 7, 2023

@ArminiusTux

We need a few clarifications from you.

For the DVB TV tuners, the output looks good. How did you create the driver by Zadig and then modify it for ARM64 to use winusb.sys (v10.0.22621.608) driver? Normally you need signed driver package to work with Windows.

For the Android phone, the output does not seem to be good. Is the device really using WinUSB driver?

@ArminiusTux
Copy link

We need a few clarifications from you.

Of course, @mcuee

**For the Android phone, ... Is the device really using WinUSB driver?**

You are correct, although Winusb.sys is included the main driver is a different one.

Android_MTP_arm64

**For the DVB TV tuners, ... How did you create the driver by Zadig and then modify it for ARM64 to use winusb.sys ?**

I took the ...

original.INF created by Zadig Zadig-screen2
; Xbox_USB_Tuner.inf
; Copyright (c) 2010-2016 Pete Batard <pete@akeo.ie> (GNU LGPL)
[Strings]
DeviceName = "Xbox USB Tuner"
VendorName = "Microsoft Corp."
SourceName = "Xbox USB Tuner Install Disk"
DeviceID   = "VID_045E&PID_02D5"
DeviceGUID = "{876534DC-3BBB-4EB3-AB52-161E9A1174FE}"

[Version]
Signature   = "$Windows NT$"
Class       = "USBDevice"
ClassGuid   = {88bae032-5a81-49f0-bc3d-a4ff138216d6}
Provider    = "libwdi"
CatalogFile = Xbox_USB_Tuner.cat
DriverVer   = 06/02/2012, 6.1.7600.16385

[ClassInstall32]
Addreg = WinUSBDeviceClassReg

[WinUSBDeviceClassReg]
HKR,,,0,"Universal Serial Bus devices"
HKR,,Icon,,-20

[Manufacturer]
%VendorName% = libusbDevice_WinUSB,NTx86,NTamd64,NTarm

[libusbDevice_WinUSB.NTx86]
%DeviceName% = USB_Install, USB\%DeviceID%

[libusbDevice_WinUSB.NTamd64]
%DeviceName% = USB_Install, USB\%DeviceID%

[libusbDevice_WinUSB.NTarm]
%DeviceName% = USB_Install, USB\%DeviceID%

[USB_Install]
Include = winusb.inf
Needs   = WINUSB.NT

[USB_Install.Services]
Include    = winusb.inf
AddService = WinUSB,0x00000002,WinUSB_ServiceInstall

[WinUSB_ServiceInstall]
DisplayName   = "WinUSB - Kernel Driver 06/02/2012 6.1.7600.16385"
ServiceType   = 1
StartType     = 3
ErrorControl  = 1
ServiceBinary = %12%\WinUSB.sys

[USB_Install.Wdf]
KmdfService = WINUSB, WinUsb_Install

[WinUSB_Install]
KmdfLibraryVersion = 1.11

[USB_Install.HW]
AddReg = AddDeviceInterfaceGUID

[NoDeviceInterfaceGUID]
; Avoids adding a DeviceInterfaceGUID for generic driver

[AddDeviceInterfaceGUID]
HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID%

[USB_Install.CoInstallers]
AddReg    = CoInstallers_AddReg
CopyFiles = CoInstallers_CopyFiles

[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01011.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"

[CoInstallers_CopyFiles]
WinUSBCoInstaller2.dll
WdfCoInstaller01011.dll

[DestinationDirs]
CoInstallers_CopyFiles = 11

[SourceDisksNames]
1 = %SourceName%

[SourceDisksFiles.x86]
WinUSBCoInstaller2.dll = 1,x86
WdfCoInstaller01011.dll = 1,x86

[SourceDisksFiles.amd64]
WinUSBCoInstaller2.dll = 1,amd64
WdfCoInstaller01011.dll = 1,amd64

[SourceDisksFiles.arm]
WinUSBCoInstaller2.dll = 1,arm
WdfCoInstaller01011.dll = 1,arm
;

and created a

modified.INF for ARM64 manual/forced installation

bascially by discarding the "non-essential" DLLs & signature

; Xbox_USB_Tuner.inf
; Copyright (c) 2010-2016 Pete Batard <pete@akeo.ie> (GNU LGPL)
[Strings]
DeviceName = "Xbox USB Tuner"
VendorName = "Microsoft Corp."
SourceName = "Xbox USB Tuner Install Disk"
DeviceID   = "VID_045E&PID_02D5"
DeviceGUID = "{876534DC-3BBB-4EB3-AB52-161E9A1174FE}"

[Version]
Signature   = "$Windows NT$"
Class       = "USBDevice"
ClassGuid   = {88bae032-5a81-49f0-bc3d-a4ff138216d6}
Provider    = "libwdi"
DriverVer   = 06/02/2012, 6.1.7600.16385

[ClassInstall32]
Addreg = WinUSBDeviceClassReg

[WinUSBDeviceClassReg]
HKR,,,0,"Universal Serial Bus devices"
HKR,,Icon,,-20

[Manufacturer]
%VendorName% = libusbDevice_WinUSB,NTarm64

[libusbDevice_WinUSB.NTarm64]
%DeviceName% = USB_Install, USB\%DeviceID%

[USB_Install]
Include = winusb.inf
Needs   = WINUSB.NT

[USB_Install.Services]
Include    = winusb.inf
AddService = WinUSB,0x00000002,WinUSB_ServiceInstall

[WinUSB_ServiceInstall]
DisplayName   = "WinUSB - Kernel Driver 06/02/2012 6.1.7600.16385"
ServiceType   = 1
StartType     = 3
ErrorControl  = 1
ServiceBinary = %12%\WinUSB.sys

[USB_Install.Wdf]
KmdfService = WINUSB, WinUsb_Install

[WinUSB_Install]
KmdfLibraryVersion = 1.11

[USB_Install.HW]
AddReg = AddDeviceInterfaceGUID

[NoDeviceInterfaceGUID]
; Avoids adding a DeviceInterfaceGUID for generic driver

[AddDeviceInterfaceGUID]
HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID%
;
xbox_arm64_usb_driver

@mcuee
Copy link
Member

mcuee commented Feb 7, 2023

@ArminiusTux

Thanks a lot for the detailed info.

Just wondering how you carry out manual/forced installation for the DVB TV Tuner driver package you created. In paticular, what do you mean by forced?

Edit: Info given here.

Windows_startup_settings

@sonatique sonatique force-pushed the winusb-use-root-hubs-instead-of-HCD-to-define-and-assign-bus-numbers branch 2 times, most recently from 8e7ad93 to c08f1fd Compare February 23, 2023 12:04
@mcuee
Copy link
Member

mcuee commented Feb 23, 2023

Somehow latest MSYS2 clang32/clang64 build failed.

@sonatique sonatique force-pushed the winusb-use-root-hubs-instead-of-HCD-to-define-and-assign-bus-numbers branch from c08f1fd to e5c7566 Compare February 23, 2023 12:23
@mcuee
Copy link
Member

mcuee commented Feb 23, 2023

Now it is fine.

@mcuee
Copy link
Member

mcuee commented Feb 23, 2023

And the outpput of this PR is the same as git HEAD now.

PS C:\work\libusb\libusb_pr1202_new> .\build\v143\x64\Release\listdevs.exe
05e3:0612 (bus 2, device 1) path: 2
8087:0026 (bus 1, device 3) path: 10
04f2:b6dd (bus 1, device 2) path: 5
1c7a:0575 (bus 1, device 4) path: 7
8086:a0ed (bus 1, device 0)
05e3:0610 (bus 1, device 1) path: 2
046d:c52b (bus 1, device 5) path: 3
8086:9a13 (bus 2, device 0)

PS C:\work\libusb\libusb_pr1202_new> .\build\v143\x64\Release\testlibusb.exe
Dev (bus 2, device 1): 05E3 - 0612 speed: 5G
Dev (bus 1, device 3): 8087 - 0026 speed: 12M
Dev (bus 1, device 2): 04F2 - B6DD speed: 480M
Dev (bus 1, device 4): 1C7A - 0575 speed: 480M
Dev (bus 1, device 0): 8086 - A0ED speed: 5G
Dev (bus 1, device 1): 05E3 - 0610 speed: 480M
Dev (bus 1, device 5): 046D - C52B speed: 12M
  Manufacturer:              Logitech
  Product:                   USB Receiver
Dev (bus 2, device 0): 8086 - 9A13 speed: 5G

git master:

PS C:\work\libusb\libusb> .\build\v143\x64\Release\listdevs.exe
05e3:0612 (bus 2, device 1) path: 2
8087:0026 (bus 1, device 3) path: 10
04f2:b6dd (bus 1, device 2) path: 5
1c7a:0575 (bus 1, device 4) path: 7
8086:a0ed (bus 1, device 0)
05e3:0610 (bus 1, device 1) path: 2
046d:c52b (bus 1, device 5) path: 3
8086:9a13 (bus 2, device 0)
PS C:\work\libusb\libusb> .\build\v143\x64\Release\testlibusb.exe
Dev (bus 2, device 1): 05E3 - 0612 speed: 5G
Dev (bus 1, device 3): 8087 - 0026 speed: 12M
Dev (bus 1, device 2): 04F2 - B6DD speed: 480M
Dev (bus 1, device 4): 1C7A - 0575 speed: 480M
Dev (bus 1, device 0): 8086 - A0ED speed: 5G
Dev (bus 1, device 1): 05E3 - 0610 speed: 480M
Dev (bus 1, device 5): 046D - C52B speed: 12M
  Manufacturer:              Logitech
  Product:                   USB Receiver
Dev (bus 2, device 0): 8086 - 9A13 speed: 5G

@sonatique sonatique force-pushed the winusb-use-root-hubs-instead-of-HCD-to-define-and-assign-bus-numbers branch from e5c7566 to e87569a Compare February 23, 2023 13:42
@sonatique
Copy link
Contributor Author

@tormodvolden : I just pushed the missing space, thanks.
@mcuee : regarding the bus numbers: I made correction to my initial code. My initial code was indeed skipping some bus number (bus number value was increasing on every hub found, not on every Root hub). This issue was causing some of the differences you spotted.
With this new version, the bus number max value will always be equal to the bus number max value you'll get with current master. However, depending on which order HCD and Root Hub are enumerated by Windows, number may differ: on master, bus number is incremented everytime a HCD with a child Root Hub is discovered, while with my PR bus number is incremented everytime a Root Hub is discoverd, independently of HCD (since the goal is not to rely on HCD to get Root Hub).
So depending on your configuration you may have exactly the same output with master and my PR, or you may have some swaped numbers.

Thank you for your comments and patience.

@tormodvolden
Copy link
Contributor

The commit summary line is too long, see for instance "Commit Guidelines" on https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project or https://cbea.ms/git-commit/ about how to make well-formed commit messages. (I am drafting a HACKING file with such stuff :) )

@sonatique sonatique force-pushed the winusb-use-root-hubs-instead-of-HCD-to-define-and-assign-bus-numbers branch from e87569a to 02a17c9 Compare February 28, 2023 14:15
@sonatique sonatique force-pushed the winusb-use-root-hubs-instead-of-HCD-to-define-and-assign-bus-numbers branch from 02a17c9 to 284fd01 Compare April 7, 2023 20:27
Bus numbers are defined and assigned to root hubs directly
during the hub pass of winusb libusb_get_device_list, using the
definition of a root hub as being a hub without parent at port 0.

Therefore the HCD pass is no longer used for defining root hubs.

Note: assigned bus number values for a given setup are not guaranteed
to remain constant when migrating from previous implementation to this
one.

The rational behind this change is that:

- Implementation using CM_Get_Child from HCD to get root hub devInst is
not working when using "FabulaTech Virtual USB Host Controller"
(USB-Ethernet bridge) under Hyper-V virtual machine.

- This new way of enumerating is inspired by "USB Device Viewer" Microsoft
driver sample code which is capable of correctly enumerating hubs and
devices in the above mentioned configuration as well as in regular
configurations.
@sonatique sonatique force-pushed the winusb-use-root-hubs-instead-of-HCD-to-define-and-assign-bus-numbers branch from 284fd01 to e504d17 Compare October 19, 2023 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants