-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
No display when connecting a Meizu phone #240
Comments
i am also meet this question,can anybody reslove this? |
cf #434 |
Some devices internally create a Handler when creating an input Surface, causing an exception: > Surface: java.lang.RuntimeException: Can't create handler inside > thread that has not called Looper.prepare() As a workaround, call Looper.prepareMainLooper() beforehand. Fixes: - <#240> - <#921> Signed-off-by: Romain Vimont <rom@rom1v.com>
Some devices internally create a Handler when creating an input Surface, causing an exception: > Surface: java.lang.RuntimeException: Can't create handler inside > thread that has not called Looper.prepare() As a workaround, call Looper.prepareMainLooper() beforehand. Fixes: - <#240> - <#921> Signed-off-by: Romain Vimont <rom@rom1v.com>
It has been fixed some time ago. |
I download archive and tried instructions(as far as I understood it) but gives following
Then I tried to extract and add the path of extracted files:
Seems I am doing something wrong... |
You need to clone the repo beforehand:
|
Hello! So I have done all those steps, and what we have here:
Many thanks for your assistance. But still no success. =( |
|
So, I just entered
happens =( sorry if I am mising some simple points I am noob in this kind of stuff. |
Then you must re-execute the meson/ninja commands. Then, to run your build without installing, just execute |
As I get:
then
is this correct actions? |
The file is |
Alright, now seems to be all correct, let`s try it =)
|
So, nothing =( |
You're compiling the current git checkout v1.13
ninja -Cx
./run x |
Genius! =) Many-many thanks! I owe you! =) |
Does v1.13 work better than v1.14? |
Actually, seems the only 1.13 works, as I understood it was last recommended and it works. |
OK, then there is a regression in v1.14 (the latest stable), that's bad. I need your help to fix now :) Could you confirm that if you replace |
Sure I will try my best, I already downloaded from #365 (comment) and now could you advice how to find this |
Oh, found! =) |
So, yeah I am confirming after replacement it is not working =( |
OK so the culprit is 62c0c13 :/ |
Too bad that your logs are not complete. Could you try to clear the logs again: adb logcat -c
./run x # the version which fails
adb logcat -d > log.txt |
After all these steps log is empty now |
Your logcat may have crashed. Could you reboot the device and try again, please? |
okay lets try this one, but I am not exactly sure that this is one which was crashed because none is working now... |
OK so your logs seems limited to 1100 lines, then nothing :/ Very annoying.
You probably overwrote server v1.13 :) Just to be sure, could you please try this one (it's v1.13 + the culprit commit in v1.14, without anything else):
|
could you please advice is I should do anything with this: |
It's the checksum, so that you can check that the file content is exactly the expected one. Once you downloaded the file, execute:
The sum should be the same. It avoids corruption, and it mitigate risks of malicious downloads (one would have to modify both the file on my server and the checksum on github). |
Here is checked sum:
seems to be ok So to make sure now I have to: rm -rf x
meson x --buildtype release --strip -Db_lto=true -Dprebuilt_server=/home/stanislav/Downloads/scrcpy-server1 # lately downloaded from your message 10 minutes ago
ninja -Cx
sudo ninja -Cx install
./run x Am I right? |
Yes (but no need to |
So:
and thats it nothing else happens |
Could we please continue after about 10 hours (it is 01:26 am now in Ukraine)? I just falling asleep now had a rush day. I will reply asap. BTW thank you. |
The request is for anyone having a Meizu having the problem, with a working |
Ah, alright! Then thank you ;) |
@Stanislavoloshchuk Just in case, could you try this (replace in v1.14), please?
diffdiff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
index d722388c..0da689d8 100644
--- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
+++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
@@ -53,11 +53,11 @@ public class ScreenEncoder implements Device.RotationListener {
try {
internalStreamScreen(device, fd);
- } catch (NullPointerException e) {
+ } catch (Throwable 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");
+ Ln.d("Applying workarounds to avoid exceptions");
Workarounds.fillAppInfo();
internalStreamScreen(device, fd);
} |
I plan to release a new version soon (v1.15), with or without this issue. If someone having this problem could find where (on which line) the server is blocked in v1.14, it would help. |
I added some logs. diffdiff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
index d722388c..a7855f3b 100644
--- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
+++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
@@ -49,17 +49,27 @@ public class ScreenEncoder implements Device.RotationListener {
}
public void streamScreen(Device device, FileDescriptor fd) throws IOException {
+ Ln.i("### 1");
Workarounds.prepareMainLooper();
+ Ln.i("### 2");
try {
internalStreamScreen(device, fd);
+ Ln.i("### 3");
} catch (NullPointerException e) {
+ Ln.i("### 4");
// 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");
+ Ln.i("### 5");
Workarounds.fillAppInfo();
+ Ln.i("### 6");
internalStreamScreen(device, fd);
+ Ln.i("### 7");
+ } catch (Throwable t) {
+ Ln.e("### 8", t);
+ throw new AssertionError(t);
}
}
@FredWe @olbb @Stanislavoloshchuk @ilceramista (from #434 (comment)) Could you test it please, and copy-paste the logs printed in the console when it is blocked. This should help to determine where it deadlocks. For windows users, take both For other platforms, take
|
Could you please test and paste the logs? This will help to fix the problem in the next version of scrcpy. |
Workarounds.fillAppInfo() is necessary for Meizu devices even before the first call to internalStreamScreen(), but it is harmful on other devices (#940). Therefore, simplify the workaround, by calling fillAppInfo() only if Build.BRAND equals "meizu" (case insensitive). Fixes #240 <#240> (again) Fixes #2656 <#2656>
Re-fixed, see #2656. |
Workarounds.fillAppInfo() is necessary for Meizu devices even before the first call to internalStreamScreen(), but it is harmful on other devices (#940). Therefore, simplify the workaround, by calling fillAppInfo() only if Build.BRAND equals "meizu" (case insensitive). Fixes #240 <#240> (again) Fixes #2656 <#2656>
same issue as comment in #151
Scrcpy: v1.3
Device: Meizu Pro 6 plus
Android version: 7.0.0
ROM: Flyme 7.8.7.24 beta
Host: Ubuntu 18.04
screenrecording by adb works well as following:
But issue appeared when executing
and hold on here... no response, no display window (as i expected)
and i got some logcat related to maybe a ROM bug:
Just for your reference, or for other who met the same issue.
The text was updated successfully, but these errors were encountered: