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

[1.15.1] Screen is off when scrcpy is started #1655

Closed
char101 opened this issue Aug 9, 2020 · 10 comments
Closed

[1.15.1] Screen is off when scrcpy is started #1655

char101 opened this issue Aug 9, 2020 · 10 comments
Milestone

Comments

@char101
Copy link

char101 commented Aug 9, 2020

(#40 (comment))

Always? Does MOD+p work (Alt+p by default)?

Always. Alt+p works.

Could you test again with v1.14? (then retest with v1.15.1)

  1. tested with 1.14 -> screen on
  2. tested with 1.15.1 -> screen black

Tracking events with getevent shows that 1.14 sends some events when it is started but not when its windows is closed while 1.15.1 sends some events when the scrcpy window is closed but sends nothing when it is started.

1.14> scrcpy -V debug

# getevent -t
130|OnePlus6:/ # getevent -t
add device 1: /dev/input/event6
  name:     "uinput-tri-state-key"
add device 2: /dev/input/event5
  name:     "sdm845-tavil-snd-card Button Jack"
add device 3: /dev/input/event4
  name:     "sdm845-tavil-snd-card Headset Jack"
add device 4: /dev/input/event0
  name:     "qpnp_pon"
add device 5: /dev/input/event1
  name:     "gf_input"
could not get driver version for /dev/input/mice, Not a typewriter
add device 6: /dev/input/event2
  name:     "gpio-keys"
add device 7: /dev/input/event3
  name:     "synaptics"
[  515074.915124] /dev/input/event3: 0003 002f 00000000
[  515074.915124] /dev/input/event3: 0003 0039 00000489
[  515074.915124] /dev/input/event3: 0003 0039 ffffffff
[  515074.915124] /dev/input/event3: 0003 002f 00000001
[  515074.915124] /dev/input/event3: 0003 0039 0000048a
[  515074.915124] /dev/input/event3: 0003 0039 ffffffff
[  515074.915124] /dev/input/event3: 0003 002f 00000002
[  515074.915124] /dev/input/event3: 0003 0039 0000048b
[  515074.915124] /dev/input/event3: 0003 0039 ffffffff
[  515074.915124] /dev/input/event3: 0003 002f 00000003
[  515074.915124] /dev/input/event3: 0003 0039 0000048c
[  515074.915124] /dev/input/event3: 0003 0039 ffffffff
[  515074.915124] /dev/input/event3: 0003 002f 00000004
[  515074.915124] /dev/input/event3: 0003 0039 0000048d
[  515074.915124] /dev/input/event3: 0003 0039 ffffffff
[  515074.915124] /dev/input/event3: 0003 002f 00000005
[  515074.915124] /dev/input/event3: 0003 0039 0000048e
[  515074.915124] /dev/input/event3: 0003 0039 ffffffff
[  515074.915124] /dev/input/event3: 0003 002f 00000006
[  515074.915124] /dev/input/event3: 0003 0039 0000048f
[  515074.915124] /dev/input/event3: 0003 0039 ffffffff
[  515074.915124] /dev/input/event3: 0003 002f 00000007
[  515074.915124] /dev/input/event3: 0003 0039 00000490
[  515074.915124] /dev/input/event3: 0003 0039 ffffffff
[  515074.915124] /dev/input/event3: 0003 002f 00000008
[  515074.915124] /dev/input/event3: 0003 0039 00000491
[  515074.915124] /dev/input/event3: 0003 0039 ffffffff
[  515074.915124] /dev/input/event3: 0003 002f 00000009
[  515074.915124] /dev/input/event3: 0003 0039 00000492
[  515074.915124] /dev/input/event3: 0003 0039 ffffffff
[  515074.915124] /dev/input/event3: 0000 0000 00000000

>>> scrcpy runs
1.15.1> scrcpy -V debug

# getevent -t

130|OnePlus6:/ # getevent -t
add device 1: /dev/input/event6
  name:     "uinput-tri-state-key"
add device 2: /dev/input/event5
  name:     "sdm845-tavil-snd-card Button Jack"
add device 3: /dev/input/event4
  name:     "sdm845-tavil-snd-card Headset Jack"
add device 4: /dev/input/event0
  name:     "qpnp_pon"
add device 5: /dev/input/event1
  name:     "gf_input"
could not get driver version for /dev/input/mice, Not a typewriter
add device 6: /dev/input/event2
  name:     "gpio-keys"
add device 7: /dev/input/event3
  name:     "synaptics"

>>> scrcpy runs
>>> scrcpy window closed

[  515109.132680] /dev/input/event3: 0003 002f 00000000
[  515109.132680] /dev/input/event3: 0003 0039 0000049d
[  515109.132680] /dev/input/event3: 0003 0039 ffffffff
[  515109.132680] /dev/input/event3: 0003 002f 00000001
[  515109.132680] /dev/input/event3: 0003 0039 0000049e
[  515109.132680] /dev/input/event3: 0003 0039 ffffffff
[  515109.132680] /dev/input/event3: 0003 002f 00000002
[  515109.132680] /dev/input/event3: 0003 0039 0000049f
[  515109.132680] /dev/input/event3: 0003 0039 ffffffff
[  515109.132680] /dev/input/event3: 0003 002f 00000003
[  515109.132680] /dev/input/event3: 0003 0039 000004a0
[  515109.132680] /dev/input/event3: 0003 0039 ffffffff
[  515109.132680] /dev/input/event3: 0003 002f 00000004
[  515109.132680] /dev/input/event3: 0003 0039 000004a1
[  515109.132680] /dev/input/event3: 0003 0039 ffffffff
[  515109.132680] /dev/input/event3: 0003 002f 00000005
[  515109.132680] /dev/input/event3: 0003 0039 000004a2
[  515109.132680] /dev/input/event3: 0003 0039 ffffffff
[  515109.132680] /dev/input/event3: 0003 002f 00000006
[  515109.132680] /dev/input/event3: 0003 0039 000004a3
[  515109.132680] /dev/input/event3: 0003 0039 ffffffff
[  515109.132680] /dev/input/event3: 0003 002f 00000007
[  515109.132680] /dev/input/event3: 0003 0039 000004a4
[  515109.132680] /dev/input/event3: 0003 0039 ffffffff
[  515109.132680] /dev/input/event3: 0003 002f 00000008
[  515109.132680] /dev/input/event3: 0003 0039 000004a5
[  515109.132680] /dev/input/event3: 0003 0039 ffffffff
[  515109.132680] /dev/input/event3: 0003 002f 00000009
[  515109.132680] /dev/input/event3: 0003 0039 000004a6
[  515109.132680] /dev/input/event3: 0003 0039 ffffffff
[  515109.132680] /dev/input/event3: 0000 0000 00000000

Originally posted by @char101 in #40 (comment)

@char101
Copy link
Author

char101 commented Aug 9, 2020

I think using KEYCODE_WAKEUP as in this commit 322f151 does not work, at least in my device.

Running adb shell input keyevent KEYCODE_WAKEUP also does not turn on the screen.

@rom1v
Copy link
Collaborator

rom1v commented Aug 9, 2020

For information, which device is it? (and which ROM?)

rom1v added a commit that referenced this issue Aug 9, 2020
WAKEUP does not work on some devices.

Fixes #1655 <#1655>

This reverts commit 322f151.
@rom1v
Copy link
Collaborator

rom1v commented Aug 9, 2020

Could you test branch issue1655 please?

Just replace this file in your v1.15.1 release:

  • scrcpy-server
    SHA256: 57400efdf9c52da40dacff1980b7e0997ec257f0bb7f20ca83df3f05c2efd3cf

@char101
Copy link
Author

char101 commented Aug 9, 2020

I have tested it and yes it works: the screen turns on when running scrcpy and when right clicking on the window.

@char101
Copy link
Author

char101 commented Aug 9, 2020

Rather than sending KEYCODE_WAKEUP can't KEYCODE_POWER be wrapped in a test to check if the screen is on?

@rom1v
Copy link
Collaborator

rom1v commented Aug 9, 2020

That's already the case: 322f151#diff-509c29a21966507216472f73cb7bc62eR50

But it's more racy. It's not important though.

@char101
Copy link
Author

char101 commented Aug 9, 2020

For information, which device is it? (and which ROM?)

Sorry, I missed the question. The device is OnePlus 6 running Paranoid Android Quartz 2 (Android 10) with magisk installed.

@rom1v rom1v added this to the v1.16 milestone Aug 9, 2020
@rom1v
Copy link
Collaborator

rom1v commented Aug 10, 2020

Merged in dev: 38940ff

@rom1v rom1v closed this as completed Aug 10, 2020
@rom1v
Copy link
Collaborator

rom1v commented Aug 10, 2020

And it's in v1.16 😉

@char101
Copy link
Author

char101 commented Aug 11, 2020

Version 1.16 works great, thanks.

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