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

--keep-awake flag doesn't seem to work on some phones, even when wired #4989

Closed
2 tasks done
ArtyIF opened this issue Jun 15, 2024 · 1 comment
Closed
2 tasks done

Comments

@ArtyIF
Copy link

ArtyIF commented Jun 15, 2024

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: Arch Linux
  • scrcpy version: 2.4
  • installation method: pacman, official extra repository
  • device model: realme 12+ 5G (RMX3867)
  • Android version: 14 (realme UI 5.0)

Describe the bug
When trying to connect to my phone over USB with the --keep-awake flag, an error occurs when scrcpy tries to change the setting, making the flag useless. Log output:

[artyif@artyif-desktop ~]$ scrcpy --select-usb --no-audio --turn-screen-off --stay-awake
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  <serial number>                device  RMX3867
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 119.3 MB/s (69007 bytes in 0.001s)
[server] INFO: Device: [realme] realme RMX3867 (Android 14)
[server] ERROR: Could not change "stay_on_while_plugged_in"
com.genymobile.scrcpy.SettingsException: Could not access settings: put global stay_on_while_plugged_in 7
        at com.genymobile.scrcpy.Settings.execSettingsPut(Settings.java:24)
        at com.genymobile.scrcpy.Settings.putValue(Settings.java:59)
        at com.genymobile.scrcpy.Settings.getAndPutValue(Settings.java:78)
        at com.genymobile.scrcpy.Server.initAndCleanUp(Server.java:75)
        at com.genymobile.scrcpy.Server.lambda$startInitThread$2(Server.java:206)
        at com.genymobile.scrcpy.Server$$ExternalSyntheticLambda0.run(Unknown Source:4)
        at java.lang.Thread.run(Thread.java:1012)
Caused by: java.io.IOException: Command [settings, put, global, stay_on_while_plugged_in, 7] returned with value 255
        at com.genymobile.scrcpy.Command.exec(Command.java:16)
        at com.genymobile.scrcpy.Settings.execSettingsPut(Settings.java:22)
        ... 6 more
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.1.1-arch1.1
INFO: Trilinear filtering enabled
INFO: Texture: 1080x2400
[server] INFO: Device screen turned off

The phone doesn't have a caffeine QS tile, as someone has suggested in a different issue, only the "Keep screen on while charging" setting in the developer options.

@rom1v
Copy link
Collaborator

rom1v commented Jun 15, 2024

Duplicate of #4021.

@rom1v rom1v closed this as completed Jun 15, 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