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

[WARNING][PSA] Possible soft-lock with Scrcpy is a real problem. Beware! #843

Closed
rdlf4 opened this issue Oct 7, 2019 · 1 comment
Closed

Comments

@rdlf4
Copy link

rdlf4 commented Oct 7, 2019

OK so this report comes from my personal experience with Scrcpy.
As stated on this thread, the one inconvenience I came across about Scrcpy is because recharging the phone using the USB cable does break ADB over TCP connection, which is the one you're probably using to remotely control your phone with Scrcpy.
However, the big problem is what comes up next. So after my phone is fully charged, I did:

adb forward tcp:5555 tcp:7612

And then:

adb tcpip 7612

Prior to unplugging it from the USB port. I chose to go with port 7612, but that's irrelevant, even if you do adb tcpip 5555 in order to "keep connected" to your phone after it's been unplugged, if you decide to run a processor-intensive application (for example, a game) from within Scrcpy, chances are your phone will hang and you'll think Scrcpy has frozen on you.
But the fact is, your phone has been soft-locked.

And this is bad news for those new-gen phones that have it's back glued together, as the only way to make your phone usable again is if you remove the battery and insert it again, then turn your phone back on.

This has been the case with SimCity Build it. I also tried with less-demanding tasks, but those seem to not trigger this behavior. Additionally, after doing the steps above and launching the game, it took a few tries (got one the third time I launched the game when using Scrcpy, sometimes, it happens the first time after the phone has been disconnected from the USB port); One other game I tried was Townsmen, which did soft-lock my phone but the screen would stay on, the time and pretty much everything won't change. But with Townsmen, I did manage to get this piece of code, which I hope will be helpful to Scrcpy's devs figure it out:

INFO: scrcpy 1.10 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server.jar: 1 file pushed. 0.8 MB/s (22546 bytes in 0.025s)
error: more than one device/emulator
ERROR: "adb reverse" returned with value 1
WARN: 'adb reverse' failed, fallback to 'adb forward'
/usr/share/libdrm/amdgpu.ids: No such file or directory
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.AssertionError: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
	at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayManager.java:25)
	at com.genymobile.scrcpy.Device.computeScreenInfo(Device.java:49)
	at com.genymobile.scrcpy.Device.<init>(Device.java:28)
	at com.genymobile.scrcpy.Server.scrcpy(Server.java:17)
	at com.genymobile.scrcpy.Server.main(Server.java:133)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:262)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
	at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayManager.java:17)

If there's a way to dive even further in order to get more information that may be relevant to the devs, please let me know how to do it and I'll be happy to provide the details.

@rom1v
Copy link
Collaborator

rom1v commented Oct 7, 2019

Something probably crashed on the device. If you still have access to adb, check adb logcat (or run it continuously).

@rom1v rom1v closed this as completed May 25, 2020
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