Skip to content

automatic resolution change after turning stopped working #5908

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

Closed
tmu-sprd opened this issue Mar 7, 2025 · 8 comments
Closed

automatic resolution change after turning stopped working #5908

tmu-sprd opened this issue Mar 7, 2025 · 8 comments

Comments

@tmu-sprd
Copy link

tmu-sprd commented Mar 7, 2025

Environment

  • OS: Gentoo
  • Scrcpy version: 3.1
  • Installation method: from Portage
  • Device model: Google Pixel 8a
  • Android version: 15 (Build: BP1A.250305.019)

Describe the bug

My Google Pixel 8a got a system update this week to build number BP1A.250305.019 of Android 15. In the previous build of Android 15, turning the phone changed the screen resolution of scrcpy from landscape to portrait automatically. In this build, this stopped working.

tmu@sag-n323 ~ √$ scrcpy -wS --tcpip=10.100.130.192
scrcpy 3.1 <https://github.com/Genymobile/scrcpy>
INFO: Connecting to 10.100.130.192:5555...
INFO: Connected to 10.100.130.192:5555
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 236.9 MB/s (90640 bytes in 0.000s)
[server] INFO: Device: [Google] google Pixel 8a (Android 15)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 25.0.0
INFO: Trilinear filtering enabled
INFO: Texture: 1080x2400
[server] INFO: Device display turned off

Before the update, turning the phone printed INFO: Texture: 2400x1080 and changed the resolution.

Now it looks like this, without resolution change:

Image

@rom1v
Copy link
Collaborator

rom1v commented Mar 7, 2025

Looks like your device does not trigger a display changed event as expected: e26bdb0 39d51ff

@tmu-sprd
Copy link
Author

tmu-sprd commented Mar 7, 2025

Seems like a duplicate of #5881 and #5853, but with Android 15.

@rom1v
Copy link
Collaborator

rom1v commented Mar 7, 2025

I just upgraded my Pixel 8 after reading this issue, and I can reproduce.

At least, the timing is perfect, I should have some free time this evening. I know what I'm going to do 😅

@tmu-sprd
Copy link
Author

tmu-sprd commented Mar 7, 2025

Thanks a bunch in advance.

@rom1v
Copy link
Collaborator

rom1v commented Mar 7, 2025

Given the work already done for this same problem for Android 14, the fix is in fact trivial:

diff --git server/src/main/java/com/genymobile/scrcpy/video/DisplaySizeMonitor.java server/src/main/java/com/genymobile/scrcpy/video/DisplaySizeMonitor.java
index ff863aa86..b6d77181f 100644
--- server/src/main/java/com/genymobile/scrcpy/video/DisplaySizeMonitor.java
+++ server/src/main/java/com/genymobile/scrcpy/video/DisplaySizeMonitor.java
@@ -23,7 +23,7 @@ public class DisplaySizeMonitor {
 
     // On Android 14, DisplayListener may be broken (it never sends events). This is fixed in recent Android 14 upgrades, but we can't really
     // detect it directly, so register a DisplayWindowListener (introduced in Android 11) to listen to configuration changes instead.
-    private static final boolean USE_DEFAULT_METHOD = Build.VERSION.SDK_INT != AndroidVersions.API_34_ANDROID_14;
+    private static final boolean USE_DEFAULT_METHOD = Build.VERSION.SDK_INT < AndroidVersions.API_34_ANDROID_14;
 
     private DisplayManager.DisplayListenerHandle displayListenerHandle;
     private HandlerThread handlerThread;

Please replace this server in your 3.1 release (or set SCRCPY_SERVER_PATH=/path/to/this/scrcpy-server):

  • scrcpy-server SHA-256: e5b4c0f10bd7985694d96a33f9be45097b2e9640971182fe1b79597fcfb2d4b

@tmu-sprd
Copy link
Author

tmu-sprd commented Mar 7, 2025

Replaced, tested and it works.

@vintotal
Copy link

The provided patch also work for Pixel 7 Pro under Android 15 after Mars update.

@Temujin0
Copy link

Temujin0 commented Mar 11, 2025

Pixel 6 fully updated. Running Linux fedora 41 fully up to date . Updated scrcpy about an hour ago. Test just now and I'm having the same problem. Earlier today before I updated scrcpy it was working fine.

wonder if any one here can teach a man to fish? I usually wait for the fix to be done by the coders of scrcpy. I've been trying to add the patch in this thread with no luck. The problem is that that my phones battery is over heating and it has swelled to the point that it has popped the screen out lol. ordered a new battery from ifixit wont be here till Saturday the latest. so I try to keep the screen off phone calls and the hot spot for the cpu only. the battery stays cool. i figure if I can install the patch and keep the screen off I can you the phone as normal on the pc screen. Soon on the 20th I get a new amount of hot spot data so I can use the cpu when Im on the road but I would still like to learn this for future use Thanks anyone.

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

4 participants