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

[Amazon FireTV Stick] No Window open after Startup #932

Closed
zer0de opened this issue Nov 17, 2019 · 16 comments
Closed

[Amazon FireTV Stick] No Window open after Startup #932

zer0de opened this issue Nov 17, 2019 · 16 comments
Labels

Comments

@zer0de
Copy link

zer0de commented Nov 17, 2019

C:\Users\XXXXXX\scrcpy-64>scrcpy.exe
INFO: scrcpy 1.10 <https://github.com/Genymobile/scrcpy>
* daemon not running; starting now at tcp:5037
* daemon started successfully
C:\Users\XXXXXXX\scrcpy-64\scrcpy-serv...shed. 1.5 MB/s (22546 bytes in 0.014s)
INFO: Initial texture: 1920x1080

nothing more!

any solution? Why?

@rom1v
Copy link
Collaborator

rom1v commented Nov 17, 2019

Is the device a Meizu?

If yes: #888 (comment)

@zer0de
Copy link
Author

zer0de commented Nov 17, 2019

No the device is a Amazon FireTV Stick Rev.1

@rom1v
Copy link
Collaborator

rom1v commented Nov 17, 2019

Could you please still test the jar from #888 (comment)?

If this does not work, please paste the output of adb logcat when you start scrcpy.

@zer0de
Copy link
Author

zer0de commented Nov 17, 2019

adb.log
yes i do, and then i make an edit.

thx

starts with this error:

[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.AssertionError: java.lang.NullPointerException: Attempt to invoke virt
ual method 'java.lang.Class java.lang.Object.getClass()' on a null object refere
nce
        at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayM
anager.java:25)
        at com.genymobile.scrcpy.Device.computeScreenInfo(Device.java:49)
        at com.genymobile.scrcpy.Device.<init>(Device.java:28)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:17)
        at com.genymobile.scrcpy.Server.main(Server.java:133)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:256)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'jav
a.lang.Class java.lang.Object.getClass()' on a null object reference
        at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayM
anager.java:17)
        ... 6 more

The Log doesnt end...^^

@rom1v
Copy link
Collaborator

rom1v commented Nov 17, 2019

Hmm, so the device does not return any display info.

Let's use a fake one not to crash:

diff --git a/server/src/main/java/com/genymobile/scrcpy/wrappers/DisplayManager.java b/server/src/main/java/com/genymobile/scrcpy/wrappers/DisplayManager.java
index 568afac..3e0651b 100644
--- a/server/src/main/java/com/genymobile/scrcpy/wrappers/DisplayManager.java
+++ b/server/src/main/java/com/genymobile/scrcpy/wrappers/DisplayManager.java
@@ -13,6 +13,8 @@ public final class DisplayManager {
     }
 
     public DisplayInfo getDisplayInfo() {
+        // return fake display info
+        if (true) return new DisplayInfo(new Size(800, 600), 0);
         try {
             Object displayInfo = manager.getClass().getMethod("getDisplayInfo", int.class).invoke(manager, 0);
             Class<?> cls = displayInfo.getClass();

scrcpy-server.jar SHA256: 3d1c63dc2d15b15bda73ea55c54d5e8a5cfed3aaecfc7727bb880b0604c8a73e

(replace it in your v1.10 directory)

Does it work?

@zer0de
Copy link
Author

zer0de commented Nov 17, 2019

[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.AssertionError: java.lang.NullPointerException: Attempt to invoke virt ual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
        at com.genymobile.scrcpy.wrappers.WindowManager.registerRotationWatcher(WindowManager.java:39)
        at com.genymobile.scrcpy.Device.registerRotationWatcher(Device.java:132)

        at com.genymobile.scrcpy.Device.<init>(Device.java:29)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:17)
        at com.genymobile.scrcpy.Server.main(Server.java:133)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:256)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
        at com.genymobile.scrcpy.wrappers.WindowManager.registerRotationWatcher(WindowManager.java:30)
        ... 6 more

@rom1v
Copy link
Collaborator

rom1v commented Nov 17, 2019

OK, let's also bypass this.

diff --git a/server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java b/server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java
index 56330f9..6d54213 100644
--- a/server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java
+++ b/server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java
@@ -26,6 +26,7 @@ public final class WindowManager {
     }
 
     public void registerRotationWatcher(IRotationWatcher rotationWatcher) {
+        if (true) return;
         try {
             Class<?> cls = manager.getClass();
             try {

scrcpy-server.jar SHA256: 8eb2fe8aa6b6f34d8c4049f1f252f59a15b5a0752613c03e166a47b96b870549

(if it "works", you should see the top-left 800x600 part of the screen)

@zer0de
Copy link
Author

zer0de commented Nov 17, 2019

INFO: scrcpy 1.10 <https://github.com/Genymobile/scrcpy>
C:\Users\zer0.de\scrcpy-64\scrcpy-serv...shed. 0.2 MB/s (32126 bytes in 0.132s)
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.NullPointerException: Attempt to invoke interface method 'void android
.hardware.input.IInputManager.registerInputDevicesChangedListener(android.hardwa
re.input.IInputDevicesChangedListener)' on a null object reference
        at android.hardware.input.InputManager.populateInputDevicesLocked(InputM
anager.java:709)
        at android.hardware.input.InputManager.getInputDevice(InputManager.java:
216)
        at android.view.KeyCharacterMap.load(KeyCharacterMap.java:334)
        at com.genymobile.scrcpy.Controller.<init>(Controller.java:20)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:23)
        at com.genymobile.scrcpy.Server.main(Server.java:133)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:256)
INFO: Initial texture: 800x600
Press any key to continue...

and again... :-(

@rom1v
Copy link
Collaborator

rom1v commented Nov 17, 2019

OK, it seems the device does not behave like a "normal" Android device:

  • we cannot retrieve display information
  • there is no keymap (so text injection will not work)

Maybe we could adapt to avoid crashing and make it "work" in a degraded way, but I'm not even sure. Anyway, it would require investigations with the device, so if someone have the device and is comfortable in Java to investigate… your help is welcome.

@rom1v rom1v removed the bug label Nov 17, 2019
@rom1v rom1v changed the title [Win7-64bit] No Window open after Startup [Amazon FireTV Stick] No Window open after Startup Nov 17, 2019
@rom1v
Copy link
Collaborator

rom1v commented Nov 17, 2019

INFO: Initial texture: 1920x1080

I'm surprised that you get this, given that retrieving the display info crashes the server: #932 (comment)

@zer0de
Copy link
Author

zer0de commented Nov 17, 2019

ok, thanks a lot. "IF" I have a solution i will be edit or leave a comment

sry, typo mistake

@rom1v
Copy link
Collaborator

rom1v commented Nov 18, 2019

I have a solution

@sweenwolf
Copy link

Scrcpy works fine on Firestick 4K, it should also work fine on regular firestick.

@ManuLinares
Copy link

Still not working on a Firestick V1

@ManuLinares
Copy link

Bump, as it still not working for Firestick v1,

#1916

I'm willing to test, debug, etc...

@doom-man
Copy link

not working for redroid . any solution?


scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     --> (tcpip)  172.28.0.10:5555                device  redroid11_arm64
/opt/homebrew/Cellar/scrcpy/2.4/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 92.1 MB/s (69007 bytes in 0.001s)
[server] INFO: Device: [redroid] redroid redroid11_arm64 (Android 11)
[server] ERROR: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
	at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayManager.java:89)
	at com.genymobile.scrcpy.Device.<init>(Device.java:73)
	at com.genymobile.scrcpy.Server.scrcpy(Server.java:121)
	at com.genymobile.scrcpy.Server.internalMain(Server.java:259)
	at com.genymobile.scrcpy.Server.main(Server.java:214)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants