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

A Question on the scrcpy --otg can't work #5185

Closed
1 task done
Xenoare opened this issue Aug 12, 2024 · 11 comments
Closed
1 task done

A Question on the scrcpy --otg can't work #5185

Xenoare opened this issue Aug 12, 2024 · 11 comments

Comments

@Xenoare
Copy link

Xenoare commented Aug 12, 2024

  • I have read the FAQ

Enviroment:

  • Os: Windows 10
  • scrcpy version: 2.5
  • installation method: choco install scrcpy
  • Android version : 12
  • More information:
    • USB Cable from Laptop to Phone
    • Phone is Poco X3 Pro from which condition is the touchscreen is dead, so I can't use the screen without using the scrcpy for mirroring

Description:
So basically, it was working fine, until I decided to install nox emulator to work with various devices in Android Studio, but on the next day, I find some strange situtation where I can use the scrcpy or scrcpy --otg , also with adb devices I don't see any devices even though that I have already connect the usb to the laptop, Here's the log of that.

PS C:\Users\ACER> scrcpy --otg
scrcpy 2.5 <https://github.com/Genymobile/scrcpy>
INFO: Killing adb server (if any)...
ERROR: Could not find any USB device

PS C:\Users\ACER> scrcpy --otg -Vdebug
scrcpy 2.5 <https://github.com/Genymobile/scrcpy>
INFO: Killing adb server (if any)...
DEBUG: Open USB device 04f2:b64f: libusb error: Entity not found
DEBUG: Open USB device 2717:ff40: libusb error: Operation not supported or unimplemented on this platform
ERROR: Could not find any USB device
PS C:\Users\ACER>

PS C:\Users\ACER> adb devices
List of devices attached

Also since I looking through the FAQ and issues, I accidentally set the connection mode to be charging only and delete the my device
(Poco X3 Pro) out of device manager and restarted the phone which made things even worse I think. And then I can't see my devices as for in this steps issue
image

Since my phone touchscreen is dead, and I can't use the scrcpy --otg, I wonder does there any way I can solve this?

@rom1v
Copy link
Collaborator

rom1v commented Aug 12, 2024

For some reason, libusb does not detect / cannot access your device. This might be related to the USB mode (charging, MTP…), where only some of them are "detected" by the computer. Read https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#otg-issues-on-windows for Windows.

I suggest that you try on a computer with Linux or macOS, it should work out-of-the-box.

@Xenoare
Copy link
Author

Xenoare commented Aug 12, 2024

Interesting, does working with wsl are accepted? since when I use wsl, install the scrcpy and run --otg, it show this.
image

Also for your first statement, how can I get the access to the USB charging mode since my phone is locked and needed a pin to unlock. also on the issue itself, I guess it required your device in the device manager before you put your usb_driver in there which I didn't have.

@rom1v
Copy link
Collaborator

rom1v commented Aug 12, 2024

Interesting, does working with wsl are accepted?

Probably not, since it still runs on Windows, and use Windows drivers I guess.

Also for your first statement, how can I get the access to the USB charging mode since my phone is locked and needed a pin to unlock.

I don't know, but on Linux (or macOS) the device should be detected in all modes I think.

@Xenoare
Copy link
Author

Xenoare commented Aug 12, 2024

Hi mate, since I doesn't know how to Dual Boot, I decided to use the VM with Ubuntu, but interestingly, for the installation steps on the linux here on the VM, it gives an error when I follow the steps like this

No such file or directory '/home/username/scrcpy/setup' 

when running the ./install_release.sh. Then I try to install the scrcpy with snap, but the same things still happen. Maybe u can elaborate for this.

image

Thanks

@rom1v
Copy link
Collaborator

rom1v commented Aug 12, 2024

I decided to use the VM with Ubuntu

It will probably not work either: I think the device will be acceded through the host, which is Windows.

No such file or directory '/home/username/scrcpy/setup'

What exact commands did you execute from when you opened a terminal and when you got that error message?

@Xenoare
Copy link
Author

Xenoare commented Aug 12, 2024

Well, I do your steps on the linux.md on this part

git clone https://github.com/Genymobile/scrcpy
cd scrcpy
./install_release.sh

@rom1v
Copy link
Collaborator

rom1v commented Aug 12, 2024

Well, I do your steps on the linux.md on this part

That should not generate this error:

No such file or directory '/home/username/scrcpy/setup'

Please post a screenshot of the terminal with the commands you typed and the results.

Anyway, it won't work in the VM if your host does not detect the device in the first place. So you must try on a native Lknux or macOS.

@Xenoare
Copy link
Author

Xenoare commented Aug 13, 2024

Halo sir, curious question. I tried to recreate the problem with another Phone (Xiaomi Redmi 4 A - Android 7.1.2), I found that USB Debugging is required within scrcpy --otg? I try to enable the USB Debugging and use the scrcpy --otg, it's works fine. Next, i do disable the usb debugging and run the scrcpy --otg and it doesnt work and the log is mostly like this (same as my Poco X3 Pro),

PS C:\Users\ACER> scrcpy --otg
scrcpy 2.5 https://github.com/Genymobile/scrcpy
INFO: Killing adb server (if any)...
ERROR: Could not find any USB device

PS C:\Users\ACER> scrcpy --otg -Vdebug
scrcpy 2.5 https://github.com/Genymobile/scrcpy
INFO: Killing adb server (if any)...
DEBUG: Open USB device 04f2:b64f: libusb error: Entity not found
DEBUG: Read string: libusb error: Entity not found
ERROR: Could not find any USB device

PS C:\Users\ACER> adb devices

But in docs, usb debugging is not required to run with otg mode? May to elaborate about this? Btw I'm try to dual boot and see what can I find with that

Thanks

@rom1v
Copy link
Collaborator

rom1v commented Aug 13, 2024

@Xenoare On Windows, disabling USB debugging may prevent the device from being detected/used at all: #3050.

This is a Windows-specific issue.

@Xenoare
Copy link
Author

Xenoare commented Aug 13, 2024

I see, btw I just realized that the OTG Usb is exist for a more or less of a buck, and now I can solve this for my problem. A bonus question, does running the scrcpy and nox emulator simuntaneously will result in some bad things or it doesn't? Because the nox have its nox_adb and scrcpy also have its adb, But as I can see, every time I start the scrcpy and nox emulator, everything is somehow is fine, but maybe sometimes my phone went into the unauthorized mode and the pop up doesn't show up which made me have to re-enable the usb-debugging again, which is fine. But kinda annoying.

Thanks

@rom1v
Copy link
Collaborator

rom1v commented Aug 13, 2024

Because the nox have its nox_adb and scrcpy also have its adb

If they are the same version, no problem. If they are not the same version, you can make scrcpy to use the one from nox: https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#conflicts-between-adb-versions

everything is somehow is fine, but maybe sometimes my phone went into the unauthorized mode

In developer options, enable "Disable adb authorization timeout" (which automatically unauthorize after 7 days).

@Xenoare Xenoare closed this as completed Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants