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

Can not turn screen off in android Q with 1.10 scrcpy #835

Closed
vivian27 opened this issue Oct 2, 2019 · 7 comments
Closed

Can not turn screen off in android Q with 1.10 scrcpy #835

vivian27 opened this issue Oct 2, 2019 · 7 comments

Comments

@vivian27
Copy link

vivian27 commented Oct 2, 2019

My device is Oneplus 7 pro with OxygenOS Android Q openbeta 2. I found ctrl + o cannot turnoff the screen of my device, and program carshed with following:

INFO: Initial texture: 1440x3120
[server] ERROR: Exception on thread Thread[Thread-1,5,main]
java.lang.AssertionError: java.lang.reflect.InvocationTargetException
at >com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplayPowerMode(SurfaceControl.java:96)
at com.genymobile.scrcpy.Device.setScreenPowerMode(Device.java:165)
at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:113)
at com.genymobile.scrcpy.Controller.control(Controller.java:73)
at com.genymobile.scrcpy.Server$1.run(Server.java:45)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at >com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplayPowerMode(SurfaceControl.java:94)
... 5 more
Caused by: java.lang.IllegalArgumentException: displayToken must not be null
at android.view.SurfaceControl.setDisplayPowerMode(SurfaceControl.java:1523)
... 7 more

scrcpy --version shows:

scrcpy 1.10

dependencies:o

  • SDL 2.0.10
  • libavcodec 58.35.100
  • libavformat 58.20.100
  • libavutil 56.22.100

So I noticed you had fixed this issues, but it seems don't work to me...

@agsola
Copy link

agsola commented Oct 3, 2019

I'm having this issue since latest Android 10 update --> Android 10.0.0 (Release 3) - QP1A.190711.020.C3

When I turn on scrcpy, it shows this:

INFO: Initial texture: 1080x2248
[server] ERROR: Exception on thread Thread[Thread-1,5,main]
java.lang.AssertionError: java.lang.reflect.InvocationTargetException
        at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplayPowerMode(SurfaceControl.java:96)
        at com.genymobile.scrcpy.Device.setScreenPowerMode(Device.java:165)
        at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:113)
        at com.genymobile.scrcpy.Controller.control(Controller.java:73)
        at com.genymobile.scrcpy.Server$1.run(Server.java:45)
        at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplayPowerMode(SurfaceControl.java:94)
        ... 5 more
Caused by: java.lang.IllegalArgumentException: displayToken must not be null
        at android.view.SurfaceControl.setDisplayPowerMode(SurfaceControl.java:1520)
        ... 7 more

And..., not only the screen doesn't turn off, but I cannot use the mobile from the computer. It just reflects the mobile screen, but slows the mobile down.

@rom1v
Copy link
Collaborator

rom1v commented Oct 3, 2019

And..., not only the screen doesn't turn off, but I cannot use the mobile from the computer.

(The exception you get crashes the controller thread, so this is not surprising.)

rom1v added a commit that referenced this issue Oct 17, 2019
Call getInternalDisplayToken(), which retrieve the id of the first
physical display (which is not necessarily 0 anymore).

Fixes <#835>
@rom1v
Copy link
Collaborator

rom1v commented Oct 17, 2019

My device just received the Android 10 upgrade tonight, so I fixed the issue on dev branch: c33a147

@BambooWave
Copy link

My device just received the Android 10 upgrade tonight, so I fixed the issue on dev branch: c33a147

Excuse me, can you add a compiled version of windows that has fixed this problem?

@crazyserb
Copy link

Is there a compiled Windows version of this with this issue fixed?

I'm still experiencing this on v1.13.

@rom1v
Copy link
Collaborator

rom1v commented May 20, 2020

Could you paste the error you get in the console please?

@crazyserb
Copy link

Could you paste the error you get in the console please?

I did, here:

#1409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants