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

Meizu M6s display issue #1985

Closed
Hippobotus opened this issue Dec 21, 2020 · 9 comments
Closed

Meizu M6s display issue #1985

Hippobotus opened this issue Dec 21, 2020 · 9 comments

Comments

@Hippobotus
Copy link

  • [YES] I have read the FAQ.
  • [YES] I have searched in existing issues.

Environment

  • OS: Windows 10
  • scrcpy version: v1.14 onwards
  • installation method: Windows 64-bit zipped file
  • device model: Meizu M6s
  • Android version: Nougat 7.0

Describe the bug
Scrcpy cannot display the output when connected to Meizu M6s from v1.14 onwards.
For the record, version 1.13 works well

I tried the adb shell screenrecord command as suggested in other threads and it works on this phone.
Also tried these command-line options but to no avail.

scrcpy --render-driver=opengl
scrcpy -b2M -m1024

On errors, please provide the output of the console (and adb logcat if relevant).

These are the console outputs when running different version(s).

[server] INFO: Device: Meizu Meizu M6s (Android 7.0)
INFO: Created renderer: direct3d
INFO: Renderer: direct3d
INFO: Initial texture: 720x1440
ERROR: SDL failed to get a vertex buffer for this Direct3D 9 rendering batch!
ERROR: Dropping back to a slower method.
ERROR: This might be a brief hiccup, but if performance is bad, this is probably why.
ERROR: This error will not be logged again for this renderer.
v1.15\scrcpy-server:... file pushed, 0 skipped. 44.0 MB/s (33618 bytes in 0.001s)
[server] INFO: Device: Meizu Meizu M6s (Android 7.0)
INFO: Renderer: direct3d
INFO: Initial texture: 720x1440
v1.16\scrcpy-server:... file pushed, 0 skipped. 43.0 MB/s (33622 bytes in 0.001s)
[server] INFO: Device: Meizu Meizu M6s (Android 7.0)
INFO: Renderer: direct3d
INFO: Initial texture: 720x1440

logcat0001.txt
logcat0002.txt

Please find attached the logcat files. Hope these information help in figuring out a solution.

Thank you.

@rom1v
Copy link
Collaborator

rom1v commented Dec 21, 2020

Could you follow these steps to help resolving this specific issue, please? #240 (comment)

@Hippobotus
Copy link
Author

I tried the linked binaries and again the console window appears but not the UI window.

[server] INFO: Device: Meizu Meizu M6s (Android 7.0)
[server] INFO: ### 1
[server] INFO: ### 2
INFO: Renderer: direct3d
INFO: Initial texture: 720x1440

logcat0003.txt

Here is the logcat for your reference.

Thank you.

@rom1v
Copy link
Collaborator

rom1v commented Dec 21, 2020

Thank you for the test.

The commit introducing the "regression" is 62c0c13.
The problem is that I can't revert it, since it fixes other issues.

This should work for your device:

diff

diff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
index c7c104e4..b723cf32 100644
--- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
+++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
@@ -55,17 +55,8 @@ public class ScreenEncoder implements Device.RotationListener {
 
     public void streamScreen(Device device, FileDescriptor fd) throws IOException {
         Workarounds.prepareMainLooper();
-
-        try {
-            internalStreamScreen(device, fd);
-        } catch (NullPointerException e) {
-            // Retry with workarounds enabled:
-            // <https://github.com/Genymobile/scrcpy/issues/365>
-            // <https://github.com/Genymobile/scrcpy/issues/940>
-            Ln.d("Applying workarounds to avoid NullPointerException");
-            Workarounds.fillAppInfo();
-            internalStreamScreen(device, fd);
-        }
+        Workarounds.fillAppInfo();
+        internalStreamScreen(device, fd);
     }
 
     private void internalStreamScreen(Device device, FileDescriptor fd) throws IOException {

If you are comfortable with editing and building, could you try removing the Workarounds.prepareMainLooper() call, or call only parts of Workarounds.fillAppInfo()?

Here is the logcat for your reference.

Thank you, but like others with that device, the logcat is broken (it only prints the ~500 first lines).

@Hippobotus
Copy link
Author

If you are comfortable with editing and building, could you try removing the Workarounds.prepareMainLooper() call, or call only parts of Workarounds.fillAppInfo()?

Unfortunately I am not familiar with programming. In this case, I can make a separate folder for scrcpy v1.13 and use it to connect to this Meizu phone only.

Thank you, but like others with that device, the logcat is broken (it only prints the ~500 first lines).

Is there any way to fix the logcat?

Thank you.

@HEZI0427
Copy link

HEZI0427 commented Jul 28, 2021

@rom1v
this issue not like problem on oppo device(cause NPE error): #921
Meizu device you need set Looper.prepare() and check by Looper.myLooper(), this is code work for me ( Too urgly!!!)。

-        if (Looper.getMainLooper() != null) {
-            return;
+        if (Build.BRAND.toLowerCase().contains("meizu")) {
+            if (Looper.myLooper() != null) {
+                return;
+            }
+            Looper.prepare();
+        } else {
+            if (Looper.getMainLooper() != null) {
+                return;
+            }
+            Looper.prepareMainLooper();
         }
-        Looper.prepareMainLooper();
     }

@rom1v
Copy link
Collaborator

rom1v commented Aug 12, 2021

@HEZI0427 Thank you for the details.

But scrcpy just calls Looper.prepareMainLooper(); unconditionally, where does this diff apply?

On meizu, is scrcpy stuck in Looper.prepareMainLooper(); or somewhere else?

@rom1v
Copy link
Collaborator

rom1v commented Sep 10, 2021

@HEZI0427 ?

@HEZI0427
Copy link

@HEZI0427 ?
so sorry reply too slow.
i can get error in scrcpy version 1.19 on meizu 17 Pro, it seem like system error.
thank you for help !!!

@rom1v
Copy link
Collaborator

rom1v commented Oct 21, 2021

This should be fixed by 8df42ce (on dev branch current, will be in v1.20).

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

3 participants