scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

Device freezes sometimes when rotating the device screen using MOD+r

Open techsnap opened this issue 1 year ago • 2 comments

  • [x] I have read the FAQ.
  • [x] I have searched in existing issues.

Environment

  • OS: [Windows 7 32 bit]
  • scrcpy version: [1.24 and 2.0]
  • installation method: [Windows release...]
  • device model: Xiaomi Redmi 4
  • Android version: [7.1.2]

Describe the bug I frequently use MOD+r to rotate device screen to view YouTube videos in landscape mode. But sometimes the screen doesn't rotate when using this feature and no interaction is possible with device after this error. I have tried commands like adb kill-server, adb disconnect, adb reconnect but scrcpy doesn't start the mirroring screen after trying to start it again. I also can't turn the device screen on using its power button. I have to reboot the device to use it again.

Console output for v1.24(This is the only time that it showed a Java Exception after "Ignore touch events" messages):

F:\Softwares\Utilities\scrcpy-win32-v1.24>scrcpy -d -f -S -m1280 --shortcut-mod=
lctrl,rctrl
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
F:\Softwares\Utilities\scrcpy-win32-v1...ped. 19.3 MB/s (41159 bytes in 0.002s)
[server] INFO: Device: Xiaomi Redmi 4 (Android 7.1.2)
INFO: Renderer: direct3d
INFO: Initial texture: 720x1280
[server] INFO: Device screen turned off
INFO: New texture: 1280x720
INFO: New texture: 720x1280
INFO: New texture: 1280x720
INFO: New texture: 720x1280
INFO: New texture: 1280x720
INFO: New texture: 720x1280
INFO: New texture: 1280x720
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] INFO: Device rotation requested: landscape
[server] ERROR: Could not invoke method
java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.genymobile.scrcpy.wrappers.WindowManager.freezeRotation(WindowMan
ager.java:71)
        at com.genymobile.scrcpy.Device.rotateDevice(Device.java:311)
        at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:137)
        at com.genymobile.scrcpy.Controller.control(Controller.java:75)
        at com.genymobile.scrcpy.Server$3.run(Server.java:133)
        at java.lang.Thread.run(Thread.java:760)
Caused by: android.os.DeadObjectException
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(Binder.java:622)
        at android.view.IWindowManager$Stub$Proxy.freezeRotation(IWindowManager.
java:2795)
        ... 7 more
[server] ERROR: Could not invoke method
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] ERROR: Could not invoke method
java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.genymobile.scrcpy.wrappers.InputManager.injectInputEvent(InputMan
ager.java:35)
        at com.genymobile.scrcpy.Device.injectEvent(Device.java:195)
        at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:206)
        at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:210)
        at com.genymobile.scrcpy.Controller.injectKeycode(Controller.java:148)
        at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:88)
        at com.genymobile.scrcpy.Controller.control(Controller.java:75)
        at com.genymobile.scrcpy.Server$3.run(Server.java:133)
        at java.lang.Thread.run(Thread.java:760)
Caused by: java.lang.RuntimeException: android.os.DeadSystemException
        at android.hardware.input.InputManager.injectInputEvent(InputManager.jav
a:867)
        ... 10 more
Caused by: android.os.DeadSystemException
        ... 11 more
java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.genymobile.scrcpy.wrappers.InputManager.injectInputEvent(InputMan
ager.java:35)
        at com.genymobile.scrcpy.Device.injectEvent(Device.java:195)
        at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:206)
        at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:210)
        at com.genymobile.scrcpy.Controller.injectKeycode(Controller.java:148)
        at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:88)
        at com.genymobile.scrcpy.Controller.control(Controller.java:75)
        at com.genymobile.scrcpy.Server$3.run(Server.java:133)
        at java.lang.Thread.run(Thread.java:760)
Caused by: java.lang.RuntimeException: android.os.DeadSystemException
        at android.hardware.input.InputManager.injectInputEvent(InputManager.jav
a:867)
        ... 10 more
Caused by: android.os.DeadSystemException
        ... 11 more
[server] ERROR: Could not invoke method
java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.genymobile.scrcpy.wrappers.InputManager.injectInputEvent(InputMan
ager.java:35)
        at com.genymobile.scrcpy.Device.injectEvent(Device.java:195)
        at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:206)
        at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:210)
        at com.genymobile.scrcpy.Controller.injectKeycode(Controller.java:148)
        at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:88)
        at com.genymobile.scrcpy.Controller.control(Controller.java:75)
        at com.genymobile.scrcpy.Server$3.run(Server.java:133)
        at java.lang.Thread.run(Thread.java:760)
Caused by: java.lang.RuntimeException: android.os.DeadSystemException
        at android.hardware.input.InputManager.injectInputEvent(InputManager.jav
a:867)
        ... 10 more
Caused by: android.os.DeadSystemException
        ... 11 more

Console output for v2.0(I waited for Java Exception message to show up, but it didn't):

F:\Softwares\Utilities\scrcpy-win32-v2.0>scrcpy -d -f -S -m1280 --shortcut-mod=
ctrl,rctrl --max-fps=30 --push-target=/sdcard/pc_shared/
scrcpy 2.0 <https://github.com/Genymobile/scrcpy>
F:\Softwares\Utilities\scrcpy-win32-v2...ped. 25.7 MB/s (52867 bytes in 0.002s)
[server] INFO: Device: Xiaomi Redmi 4 (Android 7.1.2)
[server] WARN: Audio disabled: it is not supported before Android 11
INFO: Renderer: direct3d
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Initial texture: 720x1280
[server] INFO: Device screen turned off
[server] INFO: Device rotation requested: landscape
INFO: New texture: 1280x720
[server] INFO: Device rotation requested: portrait
INFO: New texture: 720x1280
[server] INFO: Device rotation requested: landscape
INFO: New texture: 1280x720
[server] INFO: Device rotation requested: portrait
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] INFO: Device rotation requested: landscape
[server] INFO: Device rotation requested: portrait
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] WARN: Ignore touch event, it was generated for a different device size
[server] INFO: Device rotation requested: landscape

techsnap avatar Mar 24 '23 13:03 techsnap

Looks like a device system crash. :/

rom1v avatar Mar 24 '23 15:03 rom1v

Why does this happen only when I try to rotate device screen back to portrait mode? Any solutions?

techsnap avatar Mar 24 '23 23:03 techsnap