OTG on Windows 10/11 (libusb error: Operation not supported or unimplemented on this platform)
Environment
- OS: Windows 10 Pro & Windows 11 Pro
- scrcpy version:
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
Dependencies (compiled / linked):
- SDL: 2.0.22 / 2.0.22
- libavcodec: 59.18.100 / 59.18.100
- libavformat: 59.16.100 / 59.16.100
- libavutil: 57.17.100 / 57.17.100
- libusb: - / 1.0.26
- installation method: choco install scrcpy
- device model: Samsung Galaxy Tab S7+ (SM-T970)
- Android version: 13
- More details: - USB cable from PC to Tablet - problem recreated with two systems (Win10 vs Win11) and two tablets (both same model/release) with and without adb installed
Describe the bug While screen remoting works great (impressively clean implementation!), I am unable to get --otg mode to work. It appears like an incompatibility or limitation in Windows? There are a number of issues that smell similar but have cryptic titles and slightly different output, so I've made this as a new issue.
My aim is to get a clear answer as to whether otg support for windows is confirmed a no-go or not.
PS ~> scrcpy --otg
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
INFO: Killing adb daemon (if any)...
INFO: USB device: 0D6F385C3731 (046d:c08b) Logitech G502 HERO SE
WARN: On this platform, libusb does not have hotplug capability; device disconnection will not be detected properly
ERROR: REGISTER_HID: libusb error: Entity not found
WARN: Register HID keyboard failed
PS (admin) ~> scrcpy --otg -M
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
INFO: Killing adb daemon (if any)...
INFO: USB device: 0D6F385C3731 (046d:c08b) Logitech G502 HERO SE
WARN: On this platform, libusb does not have hotplug capability; device disconnection will not be detected properly
ERROR: REGISTER_HID: libusb error: Entity not found
WARN: Register HID mouse failed
PS (admin) ~> scrcpy --otg -Vdebug
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
INFO: Killing adb daemon (if any)...
DEBUG: Open USB device 04e8:6860: libusb error: Operation not supported or unimplemented on this platform
DEBUG: USB device found:
DEBUG: --> 0D6F385C3731 (046d:c08b) Logitech G502 HERO SE
INFO: USB device: 0D6F385C3731 (046d:c08b) Logitech G502 HERO SE
WARN: On this platform, libusb does not have hotplug capability; device disconnection will not be detected properly
ERROR: REGISTER_HID: libusb error: Entity not found
WARN: Register HID keyboard failed
PS (admin) ~> scrcpy --otg -s 0D6F385C3731 -Vdebug
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
INFO: Killing adb daemon (if any)...
DEBUG: Open USB device 04e8:6860: libusb error: Operation not supported or unimplemented on this platform
DEBUG: USB device found:
DEBUG: --> 0D6F385C3731 (046d:c08b) Logitech G502 HERO SE
INFO: USB device: 0D6F385C3731 (046d:c08b) Logitech G502 HERO SE
WARN: On this platform, libusb does not have hotplug capability; device disconnection will not be detected properly
ERROR: REGISTER_HID: libusb error: Entity not found
WARN: Register HID keyboard failed
It seems it does not detect your device over USB (but it happens to detect a mouse, so of course it does not work).
My aim is to get a clear answer as to whether otg support for windows is confirmed a no-go or not.
On Windows, it works, except when it does not. :wink:
Try without USB debugging enabled (#3050), or try on Linux.
Let's begin with USB debugging off, default mode:
PS ~ > scrcpy -Vdebug
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
* daemon not running; starting now at tcp:5037
* daemon started successfully
ERROR: Could not find any ADB device
ERROR: Server connection failed
Well that's no good. Let's enable USB debugging.
PS ~ > scrcpy -Vdebug
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
DEBUG: ADB device found:
DEBUG: --> (usb) R52RA02S2VT device SM_T970
DEBUG: Device serial: R52RA02S2VT
DEBUG: Using server (portable): C:\ProgramData\chocolatey\lib\scrcpy\tools\scrcpy-server
C:\ProgramData\chocolatey\lib\scrcpy\tools\scrcpy-server: 1 file pushed, 0 skipped. 29.7 MB/s (41159 bytes in 0.001s)
[server] INFO: Device: samsung SM-T970 (Android 13)
[server] DEBUG: Using encoder: 'OMX.qcom.video.encoder.avc'
DEBUG: Server connected
DEBUG: Starting controller thread
DEBUG: Starting receiver thread
INFO: Renderer: direct3d
DEBUG: Trilinear filtering disabled (not an OpenGL renderer)
DEBUG: Using icon (portable): C:\ProgramData\chocolatey\lib\scrcpy\tools\icon.png
INFO: Initial texture: 2800x1752
DEBUG: Starting demuxer thread
DEBUG: User requested to quit
DEBUG: quit...
DEBUG: End of frames
DEBUG: Receiver stopped
[server] DEBUG: Controller stopped
WARN: Killing the server...
DEBUG: Server disconnected
DEBUG: Server terminated
Cool. But not the problem.
Let's try again, to remember where we began:
PS ~ > scrcpy --otg -Vdebug
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
INFO: Killing adb daemon (if any)...
DEBUG: Open USB device 04e8:6860: libusb error: Operation not supported or unimplemented on this platform
DEBUG: USB device found:
DEBUG: --> 0D6F385C3731 (046d:c08b) Logitech G502 HERO SE
INFO: USB device: 0D6F385C3731 (046d:c08b) Logitech G502 HERO SE
WARN: On this platform, libusb does not have hotplug capability; device disconnection will not be detected properly
ERROR: REGISTER_HID: libusb error: Entity not found
WARN: Register HID keyboard failed
Right.
disables USB debugging again
PS ~ > scrcpy --otg -Vdebug
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
INFO: Killing adb daemon (if any)...
DEBUG: Open USB device 04e8:6860: libusb error: Operation not supported or unimplemented on this platform
DEBUG: USB device found:
DEBUG: --> 0D6F385C3731 (046d:c08b) Logitech G502 HERO SE
INFO: USB device: 0D6F385C3731 (046d:c08b) Logitech G502 HERO SE
WARN: On this platform, libusb does not have hotplug capability; device disconnection will not be detected properly
ERROR: REGISTER_HID: libusb error: Entity not found
WARN: Register HID keyboard failed
The exact same behavior? So the problem is still with scrcpy.
What benefit would trying on linux offer?
I just tried this on my Windows 11 and Galaxy S22 Ultra. It didn't worked at first, but reading the other issues I saw users complaining about different ADB/Device drivers for their devices.
With the official Samsung Android USB drivers installed it didn't work. I uninstalled this package from Control panel, then I uninstalled the drivers from Windows Device Manager.
After uninstalling all drivers, it works:

Windows 11 + S22 Ultra Android 13 + without official Samsung Android drivers - it works excellent.
With the official Samsung drivers I get the following error:

@geekaz01d I recommend you to try different ADB drivers for your device and see if it works. Some documentation about USB drivers from Google: https://developer.android.com/studio/run/oem-usb#Drivers. Maybe you find something there
Offtopic: @rom1v I appreciate all your work, excellent application and blog posts about the app development. I learned a lot from you! Thank you a lot for your hard work!
Ok, I've played a little bit more with the drivers, and at least for me, with the Google USB Driver everything works (ADB, scrcpy, scrcpy --otg), but you need to do some extra steps to install them.
- Uninstall all Android USB drivers from Windows Control panel.
- Open Device Manager and uninstall all drivers for your Android device
- Download and unzip the Google USB Driver ZIP file from here: https://developer.android.com/studio/run/win-usb
- Open Device manager -> Right click your device -> Update driver -> Browse for drivers on your computer -> Browse the unzipped folder -> Let me pick from a list of available drivers -> Show all devices -> Have disk -> Browse for
android_winusb.inffrom unzipped folder -> Choose Android ADB Interface
https://user-images.githubusercontent.com/3103859/210287349-fd0e3cbc-5506-4d75-a4a9-f6baada2ceeb.mp4
Try without USB debugging enabled (#3050), or try on Linux.
I installed Ubuntu 22.04 on my laptop and tested scrcpy...
ubuntu_laptop:~$ scrcpy --otg
scrcpy 1.21 <https://github.com/Genymobile/scrcpy>
scrcpy: unrecognized option '--otg'
ubuntu_laptop:~$ scrcpy --version
scrcpy 1.21 <https://github.com/Genymobile/scrcpy>
scrcpy 1.21
dependencies:
- SDL 2.0.16
- libavcodec 58.134.100
- libavformat 58.76.100
- libavutil 56.70.100
- libavdevice 58.13.100
ubuntu_laptop:~$ scrcpy --Vdebug
scrcpy 1.21 <https://github.com/Genymobile/scrcpy>
scrcpy: unrecognized option '--Vdebug'
ubuntu_laptop:~$ scrcpy -Vdebug
scrcpy 1.21 <https://github.com/Genymobile/scrcpy>
DEBUG: Device serial: R52RA02S2VT
DEBUG: Using server: /usr/share/scrcpy/scrcpy-server
/usr/share/scrcpy/scrcpy-server: 1 file pushed. 1.6 MB/s (39473 bytes in 0.023s)
DEBUG: Screensaver enabled
[server] INFO: Device: samsung SM-T970 (Android 13)
DEBUG: Server connected
DEBUG: Starting controller thread
DEBUG: Starting receiver thread
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 22.0.5
INFO: Trilinear filtering enabled
DEBUG: Using icon: /usr/share/icons/hicolor/256x256/apps/scrcpy.png
INFO: Initial texture: 2800x1752
DEBUG: Starting stream thread
[server] DEBUG: Using encoder: 'OMX.qcom.video.encoder.avc'
DEBUG: User requested to quit
DEBUG: quit...
WARN: Killing the server...
DEBUG: Server disconnected
DEBUG: Server terminated
DEBUG: End of frames
DEBUG: Receiver stopped
Thank you for the details :+1:
I installed Ubuntu 22.04 on my laptop and tested scrcpy...
In Ubuntu 22.04, the packaged scrcpy version (1.21) is too old (it's 1.24 in Ubuntu 22.10). Uninstall the package and install the latest version manually: https://github.com/Genymobile/scrcpy/blob/master/BUILD.md#simple
Ok, I've played a little bit more with the drivers, and at least for me, with the Google USB Driver everything works (
ADB,scrcpy,scrcpy --otg), but you need to do some extra steps to install them.
This is definitely the key to the issue. USB Debugging has to be on, because it is using the adb device to connect. Once I found that device and forced it to use the downloaded google version, I was able to get it to work. A window pops up with an android icon and I have mouse control of the tablet.
Importantly, the devices in my devmgr are totally different than your screencap. I had to unhide stuff and go deep.
So the challenge for scrcpy on windows is to either implement the known good driver or test around the more commonly installed one. This brute force method you found is a fairly heavy handed workaround.
Great work!
USB Debugging has to be on, because it is using the adb device to connect.
(not in OTG mode)
(or maybe you're saying that this is necessary for the driver to work?)
I just added a FAQ entry: https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#hidotg-issues-on-windows
Hey guys, i'm using a workbased laptop (HP EliteBook Win10) and a workbased tablet (Panasonic FZ-A3) and i would love to use the keyboard / mouse HID configuration, since i can't root my tablet or make USB Debugging work.
Here's what i get:

What do i choose in the tablet for the USB: File Transfer / PTP / Nothing ? Thanks.
If scrcpy can't be made to work with those samsung drivers, it would be nice if it could detect them to identify the issue. Thanks
Okay, I am having the same issue as the original poster, but downloading the Google Driver did nothing. I just want to get a HID mouse to work.
I am currently using scrcpy v2.1.1, I am on Windows 10 and I am connecting to a Samsung 23
With the official Samsung Android USB drivers installed it didn't work.
This is true. Because Windows USB API is bad, programs have to use an allowlist to determine which device is accessible. Usually, they only include the Windows built-in composite device driver (usbccgp), so they ignore devices with Samsung's custom driver.
I had previously filed a bug for Chrome at https://crbug.com/1127206, and I have created a PR for libusb (https://github.com/libusb/libusb/pull/1331) to fix that.
Could you please retry with scrcpy v2.4? Refs https://github.com/Genymobile/scrcpy/pull/4713#issuecomment-1974296780
Hi! Good evening, I am addressing this post because I have been reading and reading posts related to this topic about this problem for approximately 4 hours. I am going to clarify that this took a lot of time for me because I don't know English, I only speak Spanish and therefore I use Google Translate to better understand everything they say. Having said that, I want to say that my problem is the following, when I want to use the OTG mode, when typing that command in the CMD it gives me the same error as several of those who commented and I tried many things and I still can't solve it, I want to use the OTG mode on my Xiaomi redmi note 11 cell phone and I can't do it yet, I have only been able to use the normal mode. I'll probably have to make a separate post because I don't know if this comment will have enough attention to my problem because it's been more than 3 weeks, but I'm going to try. From already thank you very much!.
@rom1v
It detected your logitech gaming mouse as USB device.
Pass the serial of your Xiaomi phone:
scrcpy --otg -s 371b85e0
It'd be nice if it could detect these HID type of devices and ignore them, or have a config file where it could be manually listed to eliminate requiring a special command line each time. That said, I do use a batch file for this to automate connecting my device via IP debugging. I kind of wish it'd be incorporated. I might just create something for this myself one day... 🙂
It'd be nice if it could detect these HID type of devices and ignore them
Yes, it should only list adb devices. It's not that straightforward to detect unambiguously IIRC). PR welcome.
There is an environment variable ANDROID_SERIAL which can replace the -s. Unfortunately, it's not used for OTG mode (PR welcome too :wink:).