Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
110.59k stars 10.6k forks source link

[Qcom 8155 development board without display]No Window open after Startup #1068

Open deeplee opened 4 years ago

deeplee commented 4 years ago

sometimes show this

INFO: scrcpy 1.12 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 1.8 MB/s (26196 bytes in 0.014s)
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.AssertionError: 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:25)
    at com.genymobile.scrcpy.Device.computeScreenInfo(Device.java:50)
    at com.genymobile.scrcpy.Device.<init>(Device.java:29)
    at com.genymobile.scrcpy.Server.scrcpy(Server.java:19)
    at com.genymobile.scrcpy.Server.main(Server.java:163)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:340)
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.DisplayManager.getDisplayInfo(DisplayManager.java:17)
    ... 6 more

and sometime show this

INFO: scrcpy 1.12 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 1.1 MB/s (26196 bytes in 0.024s)
INFO: Initial texture: 1920x720

and no more

deeplee commented 4 years ago

I use Ubuntu 18.04 and install scrcpy by snap

rom1v commented 4 years ago

See #932

deeplee commented 4 years ago

I think this is different of #932

I Use dumpstate see display info is

DisplayDevice: Built-in Screen
   type=0, hwcId=0, layerStack=0, (1920x 720), ANativeWindow=0x7b83e23010 (8:8:8:8), orient= 0 (type=00000000), flips=31212, isSecure=1, powerMode=2, activeConfig=0, numLayers=2
   v:[0,0,1920,720], f:[0,0,1920,720], s:[0,0,1920,720],transform:[[1.000,0.000,-0.000][0.000,1.000,-0.000][0.000,0.000,1.000]]
   wideColorGamut=0, hdr10=0, colorMode=ColorMode::NATIVE, dataspace: Default (0)
  FramebufferSurface: dataspace: Default(0)
   mAbandoned=0
   - BufferQueue mMaxAcquiredBufferCount=2 mMaxDequeuedBufferCount=1
     mDequeueBufferCannotBlock=0 mAsyncMode=0
     default-size=[1920x720] default-format=1 transform-hint=00 frame-counter=1
deeplee commented 4 years ago

and I can get display info like this

 DisplayManager dm = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
 Display dp = dm.getDisplay(Display.DEFAULT_DISPLAY);
 Log.d(TAG, "getDisplayInfo: " + dp.getWidth() + "x" + dp.getHeight());

and output

 getDisplayInfo: 1920x720