Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.94k stars 10.48k forks source link

Could not find any USB device #3052

Open QkiZMR opened 2 years ago

QkiZMR commented 2 years ago

Environment

Describe the bug I'm trying to run program with --otg option and gets:

scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
ERROR: Could not find any USB device

I have mouse and keyboard connected via USB. lsusb -v output

Bus 001 Device 002: ID 0c45:8508 Microdia USB DEVICE
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0c45 Microdia
  idProduct          0x8508 
  bcdDevice            1.01
  iManufacturer           1 SONiX
  iProduct                2 USB DEVICE
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x003b
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              400mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      79
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     113
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
...
Bus 001 Device 003: ID 046d:c542 Logitech, Inc. Wireless Receiver
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x046d Logitech, Inc.
  idProduct          0xc542 
  bcdDevice            3.02
  iManufacturer           1 Logitech
  iProduct                2 Wireless Receiver
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0022
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower               50mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      90
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               4
rom1v commented 2 years ago

Couldn't open device, some information will be missing

Probably a permission issue. Check your "android udev rules".

If you enable USB debugging, is your device detected by adb?

rom1v commented 2 years ago

Also:

scrcpy --otg -Vdebug
gilxion117 commented 2 years ago

I'm having the same problem and this is the result after running "scrcpy --otg -Vdebug"

D:\SCRCPY\ADB\VBS>scrcpy --otg -Vdebug scrcpy 1.23 https://github.com/Genymobile/scrcpy INFO: Killing adb daemon (if any)... DEBUG: Open USB device 04e8:6860: libusb error: Operation not supported or unimp lemented on this platform ERROR: Could not find any USB device

rom1v commented 2 years ago

Do you have any program using USB (like adb daemon, but this one is killed, so there might be another one)?

gilxion117 commented 2 years ago

You mean programs using the phone? Nothing. I also unplug the phone, just to make sure, before running scrcpy again.

rom1v commented 2 years ago

You mean programs using the phone?

Not necessarily the phone, but something which opens USB devices (see https://github.com/Genymobile/scrcpy/issues/2773#issuecomment-1032283712, but in fact this is not the exact same error).

I don't know, USB on Windows is very weird.

gilxion117 commented 2 years ago

So after some reading and tinkering I somehow manage to make it work.

I just install some "libusbK" driver then the error "DEBUG: Open USB device 04e8:6860: libusb error: Operation not supported or unimplemented on this platform" is gone. After that, I turned the USB Debugging on and off to reset it then it works.

Here's the log:

D:\SCRCPY\ADB\VBS>scrcpy --otg -Vdebug scrcpy 1.23 https://github.com/Genymobile/scrcpy INFO: Killing adb daemon (if any)... DEBUG: USB device found: DEBUG: --> RRRRRRRRRRR (04e8:6860) SAMSUNG SAMSUNG_Android INFO: USB device: RRRRRRRRRRR (04e8:6860) SAMSUNG SAMSUNG_Android WARN: On this platform, libusb does not have hotplug capability; device disconnection will not be detected properly DEBUG: Starting AOA thread DEBUG: Using icon (portable): D:\SCRCPY\ADB\icon.png

gilxion117 commented 2 years ago

So apparently, installing the "libusbK" driver though make the OTG feature work it will, on the other hand, prevent scrcpy from launching the default mirror mode. So after too many trial and error on installing the drivers I finally make it work that it could finally launch interchangeably in OTG and Mirror mode while maintaining the MTP access.

shadyx49 commented 2 years ago

So apparently, installing the "libusbK" driver though make the OTG feature work it will, on the other hand, prevent scrcpy from launching the default mirror mode. So after too many trial and error on installing the drivers I finally make it work that it could finally launch interchangeably in OTG and Mirror mode while maintaining the MTP access.

how did you manage to do that, I still can't make them work interchangeably, the libusbK driver systematically disables MTP access and Mirror mode

Kamix-GLX commented 1 year ago

So apparently, installing the "libusbK" driver though make the OTG feature work it will, on the other hand, prevent scrcpy from launching the default mirror mode. So after too many trial and error on installing the drivers I finally make it work that it could finally launch interchangeably in OTG and Mirror mode while maintaining the MTP access.

how do you update the driver ?

YounusAbbasi commented 1 year ago

So after some reading and tinkering I somehow manage to make it work.

I just install some "libusbK" driver then the error "DEBUG: Open USB device 04e8:6860: libusb error: Operation not supported or unimplemented on this platform" is gone. After that, I turned the USB Debugging on and off to reset it then it works.

Here's the log:

D:\SCRCPY\ADB\VBS>scrcpy --otg -Vdebug scrcpy 1.23 https://github.com/Genymobile/scrcpy INFO: Killing adb daemon (if any)... DEBUG: USB device found: DEBUG: --> RRRRRRRRRRR (04e8:6860) SAMSUNG SAMSUNG_Android INFO: USB device: RRRRRRRRRRR (04e8:6860) SAMSUNG SAMSUNG_Android WARN: On this platform, libusb does not have hotplug capability; device disconnection will not be detected properly DEBUG: Starting AOA thread DEBUG: Using icon (portable): D:\SCRCPY\ADB\icon.png

where can we download these drivers

simp6969 commented 1 year ago

hello?? have u fixed yet

simp6969 commented 1 year ago

I got a fix for this u have uninstall the adb device driver and install the google drive for android from google's official page and install it. It worked for me.