Skip to content

automatic resolution change after turning stopped workingΒ #5908

Closed

Description

@sprd-tmu

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

Activity

  1. rom1v commented on Mar 7, 2025

    @rom1v
    Collaborator

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

  2. sprd-tmu commented on Mar 7, 2025

    @sprd-tmu
    Author

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

  3. rom1v commented on Mar 7, 2025

    @rom1v
    Collaborator

    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 πŸ˜…

  4. sprd-tmu commented on Mar 7, 2025

    @sprd-tmu
    Author

    Thanks a bunch in advance.

  5. rom1v commented on Mar 7, 2025

    @rom1v
    Collaborator

    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
  6. sprd-tmu commented on Mar 7, 2025

    @sprd-tmu
    Author

    Replaced, tested and it works.

  7. added a commit that references this issue on Mar 7, 2025
    c63d9e1
  8. vintotal commented on Mar 11, 2025

    @vintotal

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

  9. Temujin0 commented on Mar 11, 2025

    @Temujin0

    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.

  10. added a commit that references this issue on Apr 11, 2025
    ff82b68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions