Open ObsydianBlackKnight opened 9 months ago
lsusb
?
The relevant line is:
Bus 001 Device 081: ID 18d1:4ee7 Google Inc. Nexus/Pixel Device (charging + debug)
adb
and scrcpy
(without --otg
) work via USB, so I'm tempted to assume everything is fine on the USB level.
scrcpy -Vdebug --otg
lsusb -vd 18d1:4ee7
$ scrcpy -Vdebug --otg
scrcpy v2.2 <https://github.com/Genymobile/scrcpy>
[...]
DEBUG: Open USB device 18d1:4ee7: libusb error: Access denied (insufficient permissions)
[...]
ERROR: Could not find any USB device
$ lsusb -vd 18d1:4ee7
Bus 001 Device 081: ID 18d1:4ee7 Google Inc. Nexus/Pixel Device (charging + debug)
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.10
bDeviceClass 0 [unknown]
bDeviceSubClass 0 [unknown]
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x18d1 Google Inc.
idProduct 0x4ee7 Nexus/Pixel Device (charging + debug)
bcdDevice 5.10
iManufacturer 1 Google
iProduct 2 Pixel 6 Pro
iSerial 3 XXX
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0020
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 66 [unknown]
bInterfaceProtocol 1
iInterface 4
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
...I just realized that it does work if I use sudo scrcpy --otg -s ...
.
Is scrcpy
meant to be use by root, in OTG mode?
Your device could not be opened due to permissions issues:
DEBUG: Open USB device 18d1:4ee7: libusb error: Access denied (insufficient permissions)
$ lsusb -vd 18d1:4ee7 Bus 001 Device 081: ID 18d1:4ee7 Google Inc. Nexus/Pixel Device (charging + debug) Couldn't open device, some information will be missing
Probably an issue with your udev rules.
Is
scrcpy
meant to be use by root, in OTG mode?
No. It should never be run as root.
OK. Thanks.
I'm using the udev rules set up in /usr/lib/udev/rules.d/51-android.rules
by the package extra/android-udev.
I'm surprised that it works with adb
and scrcpy
, but not with scrcpy --otg
. I'll try to learn how udev works to find the problem, then report it upstream.
I'm surprised that it works with
adb
andscrcpy
,
The adb
daemon runs in another process, which probably has the correct permissions. scrcpy
calls adb
which communicates with the daemon. But in --otg
mode, scrcpy accesses the device directly over USB.
OK, I understand. Thanks.
I think this issue can be closed then.
The otg mode does not work for me as well... I get this message:
ERROR: Multiple (2) USB devices:
ERROR: --> 303NTQD4G740 (043e:9a39) LG Electronics Inc. LG Monitor Controls
ERROR: --> SN0000000001 (1ea7:0907) SEMITEK USB-HID Gaming Keyboard
ERROR: Select a device via -s (--serial)
But if I select the semitek usb-hid gaming keyboard it gives me this error:
INFO: FLAC audio: audio buffer increased to 120 ms (use --audio-buffer to set a custom value)
INFO: Killing adb server (if any)...
INFO: USB device found:
INFO: 303NTQD4G740 (043e:9a39) LG Electronics Inc. LG Monitor Controls
INFO: --> SN0000000001 (1ea7:0907) SEMITEK USB-HID Gaming Keyboard
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
I am using a logitech mechanical mini keyboard over bluetooth/bolt receiver on a samsung galaxy a34. I don't know why it shows semitek usb hid gaming keyboard ...... I don't have such a keyboard....
Does the otg mode not work over bluetooth devices?
@rp1231 In your case, it is on Windows.
Your android device is just not detected at all (but other devices are detected by libusb). See https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#hidotg-issues-on-windows
Just wanted to share an easy solution I've found.
If you have installed scrcpy from Ubuntu store (snap) - regardless of the outdated 1.25 version.
Go to its page in store, and Click Permissions
, then Turn ON Access USB hardware directly
.
Ubuntu 20.04.6 LTS
Environment
pacman
(Arch's package manager; package: https://archlinux.org/packages/extra/x86_64/scrcpy/)Issue
scrcpy
works:However
scrcpy --otg
does not: