gibsson / linux-adk

Linux Accessory Development Kit
113 stars 51 forks source link

Not work on windows #3

Closed AlynxZhou closed 3 years ago

AlynxZhou commented 3 years ago

I am implementing HID over AOAv2 for scrcpy, and I found libusb does not work on Windows (related info is https://libusb-devel.narkive.com/vENuKzdR/getting-the-serial-number-of-the-camera-fails), it cannot open Android device and read infos. Then I found this project which starts android accessory first, and I've built this on Visual Studio 2019, run it. Got the same error that it cannot open device:

 > .\linux-adk.exe -N -d 04E8:6860
Looking for device 04e8:6860
Unable to open device...
Closing USB device

04E8:6860 is for my Galaxy S9+, did you test it for your phone on windows? How do you manage to make libusb work on Windows?

Plus, C macro for Windows is _WIN32, not WIN32.

gibsson commented 3 years ago

Maybe you need to open your terminal as administrator but here linux-adk for Windows works fine. Can't reproduce on my end.

AlynxZhou commented 3 years ago

Still not work.

> .\linux-adk.exe -N -d 04E8:6860
Looking for device 04e8:6860
Unable to open device...
Closing USB device

Is there any other operation you do before run it?

gibsson commented 3 years ago

No, actually I confirm that on my end it works fine without admin rights:

linux-adk.exe -d 18d1:4ee7
Looking for device 18d1:4ee7
Device supports AOA 2.0!
Limiting AOA to version 1.0!
Sending identification to the device
 sending manufacturer: Google, Inc.
 sending model: DemoKit
 sending description: Demo ABS2013
 sending version: 2.0
 sending url: https://github.com/gibsson
 sending serial number: 0000000012345678
Turning the device in Accessory mode

Note that this is my libusb revision: f38f09da98acc63966b65b72029b1f7f81166bef

AlynxZhou commented 3 years ago

maybe it's vendor related? I don't have other phones to test...

AlynxZhou commented 3 years ago

maybe it's vendor related? I don't have other phones to test...

gibsson commented 3 years ago

Nah, the whole point of ADK is not to be vendor specific. But is your phone properly recognized in Windows Device Manager? If not that's probably why libusb can't access it. Then if it's recognized, are you use you're trying with the same version of libusb?

AlynxZhou commented 3 years ago

Nah, the whole point of ADK is not to be vendor specific. But is your phone properly recognized in Windows Device Manager? If not that's probably why libusb can't access it. Then if it's recognized, are you use you're trying with the same version of libusb?

I have a Samsuna Android Device (or something similiar).

gibsson commented 3 years ago

If you're not answering my questions I can't help you.

AlynxZhou commented 3 years ago

I mean it's recognized in Device Manager.

I'll try this version tomorrow.

gibsson commented 3 years ago

Do you have an update? If not I'll close this issue as can't repro.

AlynxZhou commented 3 years ago

Please close it because I am on vacation and cannot try it, I'll reopen if I can try and reproduce it.

gibsson commented 3 years ago

Sounds good, thanks for your feedback