libvncserver icon indicating copy to clipboard operation
libvncserver copied to clipboard

Connect android-vnc-server success,but PC side vnc viewer got black screen

Open eric0593 opened this issue 8 years ago • 11 comments

The log is below, How to debug it。I test is in android 4.4.4 andriod 8.1, both failed. @bk138 Initializing framebuffer device /dev/graphics/fb0... xres=720, yres=1280, xresv=720, yresv=2560, xoffs=0, yoffs=0, bpp=32 Initializing keyboard device /dev/input/event3 ... Initializing touch device /dev/input/event0 ... Initializing VNC server: width: 720 height: 1280 bpp: 32 port: 5901 Initializing server... 13/03/2018 15:00:05 Listening for VNC connections on TCP port 5901 13/03/2018 15:00:05 Listening for VNC connections on TCP6 port 5900 13/03/2018 15:01:59 Got connection from client 192.168.7.34 13/03/2018 15:01:59 other clients: 13/03/2018 15:01:59 Normal socket connection 13/03/2018 15:01:59 Client Protocol Version 3.8 13/03/2018 15:01:59 Protocol version sent 3.8, using 3.8 13/03/2018 15:01:59 rfbProcessClientSecurityType: executing handler for type 1 13/03/2018 15:01:59 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8 13/03/2018 15:01:59 Pixel format for client 192.168.7.34: 13/03/2018 15:01:59 8 bpp, depth 8 13/03/2018 15:01:59 true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6 13/03/2018 15:02:00 rfbProcessClientNormalMessage: ignoring unsupported encoding type ultraZip 13/03/2018 15:02:00 Using compression level 9 for client 192.168.7.34 13/03/2018 15:02:00 Using image quality level 0 for client 192.168.7.34 13/03/2018 15:02:00 Using JPEG subsampling 1, Q15 for client 192.168.7.34 13/03/2018 15:02:00 Enabling X-style cursor updates for client 192.168.7.34 13/03/2018 15:02:00 Enabling full-color cursor updates for client 192.168.7.34 13/03/2018 15:02:00 Enabling cursor position updates for client 192.168.7.34 13/03/2018 15:02:00 Enabling KeyboardLedState protocol extension for client 192.168.7.34 13/03/2018 15:02:00 Enabling NewFBSize protocol extension for client 192.168.7.34 13/03/2018 15:02:00 Enabling LastRect protocol extension for client 192.168.7.34 13/03/2018 15:02:00 Enabling SupportedMessages protocol extension for client 192.168.7.34 13/03/2018 15:02:00 Enabling SupportedEncodings protocol extension for client 192.168.7.34 13/03/2018 15:02:00 Enabling ServerIdentity protocol extension for client 192.168.7.34 13/03/2018 15:02:00 Using tight encoding for client 192.168.7.34

eric0593 avatar Mar 14 '18 03:03 eric0593

Hi! Are you running the server as root?

bk138 avatar Mar 14 '18 10:03 bk138

@bk138 Yes I have run it as root This is the process below root 27540 27532 13712 1144 c01fc0b8 b6f6d8bc S androidvncserver

eric0593 avatar Mar 16 '18 07:03 eric0593

@bk138 I found that AOSP have add libvncserver in AOSP/external dir from android M . But there is a compile error. No one fixed it.

eric0593 avatar Mar 16 '18 08:03 eric0593

@bk138 My email is [email protected]. I have device beside. But I dont know how to debug it?

eric0593 avatar Mar 16 '18 08:03 eric0593

It is the same as him PC side vnc viewer got black screen; I used android7.1 ; rfbGetScreen(&argc, argv, scrinfo.xres, scrinfo.yres, 8, 3, 3); was wrong?

houwentaoff avatar Jul 13 '18 06:07 houwentaoff

That's my fault. I used cat /dev/graphics/fb0 fbfile to get framebuffer file, but found all is zero in fbfile. in android 7.1 ; zero is black.

houwentaoff avatar Jul 17 '18 06:07 houwentaoff

DRM will replace framebuffer? why?

houwentaoff avatar Jul 18 '18 02:07 houwentaoff

The same problem. Use today's fresh repo. Got black screen. Tried many vnc viewers Any solution? Even through your multivnc app

More info about android: version MM (6.0), kernel 3.18.19, cpu mtk6580, ram 1gb.

How I built

cmake .. -DANDROID_NDK=~/tmp/ndk/ -DCMAKE_TOOLCHAIN_FILE=~/tmp/ndk/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=23 -DWITH_PNG=OFF
/cache # ./androidvncserver                                          
Initializing framebuffer device /dev/graphics/fb0...
xres=1024, yres=600, xresv=1024, yresv=1800, xoffs=0, yoffs=0, bpp=32
Initializing keyboard device /dev/input/event1 ...
Initializing touch device /dev/input/event3 ...
Initializing VNC server:
        width:  1024
        height: 600
        bpp:    32
        port:   5901
Initializing server...
01/01/2010 04:12:01 Listening for VNC connections on TCP port 5901
01/01/2010 04:12:01 Listening for VNC connections on TCP6 port 5900
01/01/2010 04:12:32 Got connection from client 10.10.21.27
01/01/2010 04:12:32   0 other clients
01/01/2010 04:12:32 Normal socket connection
01/01/2010 04:12:32 Client Protocol Version 3.8
01/01/2010 04:12:32 Protocol version sent 3.8, using 3.8
Dirty page: 188x479+500+121...
01/01/2010 04:12:33 rfbProcessClientSecurityType: executing handler for type 1
01/01/2010 04:12:33 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
01/01/2010 04:12:33 Pixel format for client 10.10.21.27:
01/01/2010 04:12:33   8 bpp, depth 3
01/01/2010 04:12:33   true colour: max r 1 g 1 b 1, shift r 0 g 1 b 2
01/01/2010 04:12:33 Enabling LastRect protocol extension for client 10.10.21.27
01/01/2010 04:12:33 Enabling NewFBSize protocol extension for client 10.10.21.27
01/01/2010 04:12:33 Enabling cursor position updates for client 10.10.21.27
01/01/2010 04:12:33 Using ZRLE encoding for client 10.10.21.27
01/01/2010 04:12:33 Disabling cursor position updates for client 10.10.21.27
01/01/2010 04:12:54 Client 10.10.21.27 gone
01/01/2010 04:12:54 Statistics             events    Transmit/ RawEquiv ( saved)
01/01/2010 04:12:54  FramebufferUpdate   :      1 |         0/        0 (  0.0%)
01/01/2010 04:12:54  raw                 :      1 |    614412/   614412 (  0.0%)
01/01/2010 04:12:54  TOTALS              :      2 |    614412/   614412 (  0.0%)
01/01/2010 04:12:54 Statistics             events    Received/ RawEquiv ( saved)
01/01/2010 04:12:54  PointerEvent        :    299 |      1794/     1794 (  0.0%)
01/01/2010 04:12:54  SetEncodings        :      1 |        36/       36 (  0.0%)
01/01/2010 04:12:54  FramebufferUpdate   :      2 |        20/       20 (  0.0%)
01/01/2010 04:12:54  SetPixelFormat      :      1 |        20/       20 (  0.0%)
01/01/2010 04:12:54  TOTALS              :    303 |      1870/     1870 (  0.0%)
01/01/2010 04:12:58 Got connection from client 10.10.21.27
01/01/2010 04:12:58   0 other clients
01/01/2010 04:12:58 Normal socket connection
01/01/2010 04:12:58 Client Protocol Version 3.8
01/01/2010 04:12:58 Protocol version sent 3.8, using 3.8
01/01/2010 04:12:58 rfbProcessClientSecurityType: executing handler for type 1
01/01/2010 04:12:58 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
01/01/2010 04:12:58 Pixel format for client 10.10.21.27:
01/01/2010 04:12:58   8 bpp, depth 3
01/01/2010 04:12:58   true colour: max r 1 g 1 b 1, shift r 0 g 1 b 2
01/01/2010 04:12:59 Enabling LastRect protocol extension for client 10.10.21.27
01/01/2010 04:12:59 Enabling NewFBSize protocol extension for client 10.10.21.27
01/01/2010 04:12:59 Enabling cursor position updates for client 10.10.21.27
01/01/2010 04:12:59 Using ZRLE encoding for client 10.10.21.27
01/01/2010 04:12:59 Disabling cursor position updates for client 10.10.21.27
Got keysym: ff1b (down=0)
injectKey (158, 0)
01/01/2010 04:13:07 Client 10.10.21.27 gone
01/01/2010 04:13:07 Statistics             events    Transmit/ RawEquiv ( saved)
01/01/2010 04:13:07  FramebufferUpdate   :      1 |         0/        0 (  0.0%)
01/01/2010 04:13:07  raw                 :      1 |    614412/   614412 (  0.0%)
01/01/2010 04:13:07  TOTALS              :      2 |    614412/   614412 (  0.0%)
01/01/2010 04:13:07 Statistics             events    Received/ RawEquiv ( saved)
01/01/2010 04:13:07  KeyEvent            :      1 |         8/        8 (  0.0%)
01/01/2010 04:13:07  PointerEvent        :     25 |       150/      150 (  0.0%)
01/01/2010 04:13:07  ClientCutText       :      1 |        16/       16 (  0.0%)
01/01/2010 04:13:07  SetEncodings        :      1 |        36/       36 (  0.0%)
01/01/2010 04:13:07  FramebufferUpdate   :      2 |        20/       20 (  0.0%)
01/01/2010 04:13:07  SetPixelFormat      :      1 |        20/       20 (  0.0%)
01/01/2010 04:13:07  TOTALS              :     31 |       250/      250 (  0.0%)
01/01/2010 04:13:11 Got connection from client 10.10.21.27
01/01/2010 04:13:11   0 other clients
01/01/2010 04:13:11 Normal socket connection
01/01/2010 04:13:11 Client Protocol Version 3.8
01/01/2010 04:13:11 Protocol version sent 3.8, using 3.8
01/01/2010 04:13:11 rfbProcessClientSecurityType: executing handler for type 1
01/01/2010 04:13:11 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
01/01/2010 04:13:11 Pixel format for client 10.10.21.27:
01/01/2010 04:13:11   32 bpp, depth 24, little endian
01/01/2010 04:13:11   true colour: max r 255 g 255 b 255, shift r 0 g 8 b 16
01/01/2010 04:13:12 Enabling LastRect protocol extension for client 10.10.21.27
01/01/2010 04:13:12 Enabling NewFBSize protocol extension for client 10.10.21.27
01/01/2010 04:13:12 Enabling cursor position updates for client 10.10.21.27
01/01/2010 04:13:12 Using ZRLE encoding for client 10.10.21.27
01/01/2010 04:13:12 Disabling cursor position updates for client 10.10.21.27
Got keysym: ff1b (down=0)
injectKey (158, 0)
01/01/2010 04:13:17 Client 10.10.21.27 gone
01/01/2010 04:13:17 Statistics             events    Transmit/ RawEquiv ( saved)
01/01/2010 04:13:17  FramebufferUpdate   :      1 |         0/        0 (  0.0%)
01/01/2010 04:13:17  raw                 :      1 |   2457612/  2457612 (  0.0%)
01/01/2010 04:13:17  TOTALS              :      2 |   2457612/  2457612 (  0.0%)
01/01/2010 04:13:17 Statistics             events    Received/ RawEquiv ( saved)
01/01/2010 04:13:17  KeyEvent            :      1 |         8/        8 (  0.0%)
01/01/2010 04:13:17  PointerEvent        :     17 |       102/      102 (  0.0%)
01/01/2010 04:13:17  ClientCutText       :      1 |        16/       16 (  0.0%)
01/01/2010 04:13:17  SetEncodings        :      1 |        36/       36 (  0.0%)
01/01/2010 04:13:17  FramebufferUpdate   :      2 |        20/       20 (  0.0%)
01/01/2010 04:13:17  SetPixelFormat      :      1 |        20/       20 (  0.0%)
01/01/2010 04:13:17  TOTALS              :     23 |       202/      202 (  0.0%)
01/01/2010 04:13:24 Got connection from client 10.10.21.27
01/01/2010 04:13:24   0 other clients
01/01/2010 04:13:24 Normal socket connection
01/01/2010 04:13:24 Client Protocol Version 3.8
01/01/2010 04:13:24 Protocol version sent 3.8, using 3.8
01/01/2010 04:13:24 rfbProcessClientSecurityType: executing handler for type 1
01/01/2010 04:13:24 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
01/01/2010 04:13:24 Pixel format for client 10.10.21.27:
01/01/2010 04:13:24   8 bpp, depth 6
01/01/2010 04:13:24   true colour: max r 3 g 3 b 3, shift r 0 g 2 b 4
01/01/2010 04:13:25 Enabling LastRect protocol extension for client 10.10.21.27
01/01/2010 04:13:25 Enabling NewFBSize protocol extension for client 10.10.21.27
01/01/2010 04:13:25 Enabling cursor position updates for client 10.10.21.27
01/01/2010 04:13:25 Using ZRLE encoding for client 10.10.21.27
01/01/2010 04:13:25 Disabling cursor position updates for client 10.10.21.27
Got keysym: ff1b (down=0)
injectKey (158, 0)
01/01/2010 04:13:30 Client 10.10.21.27 gone
01/01/2010 04:13:30 Statistics             events    Transmit/ RawEquiv ( saved)
01/01/2010 04:13:30  FramebufferUpdate   :      1 |         0/        0 (  0.0%)
01/01/2010 04:13:30  raw                 :      1 |    614412/   614412 (  0.0%)
01/01/2010 04:13:30  TOTALS              :      2 |    614412/   614412 (  0.0%)
01/01/2010 04:13:30 Statistics             events    Received/ RawEquiv ( saved)
01/01/2010 04:13:30  KeyEvent            :      1 |         8/        8 (  0.0%)
01/01/2010 04:13:30  PointerEvent        :     32 |       192/      192 (  0.0%)
01/01/2010 04:13:30  SetEncodings        :      1 |        36/       36 (  0.0%)
01/01/2010 04:13:30  FramebufferUpdate   :      2 |        20/       20 (  0.0%)
01/01/2010 04:13:30  SetPixelFormat      :      1 |        20/       20 (  0.0%)
01/01/2010 04:13:30  TOTALS              :     37 |       276/      276 (  0.0%)

DrRamm avatar Aug 20 '19 14:08 DrRamm

Seems like port-related error. I mean 5901

DrRamm avatar Aug 21 '19 08:08 DrRamm

DRM will replace framebuffer? why?

same problem, do you find the answer? why all zero in framebuffer when use DRM/KMS

tonypig avatar Oct 24 '19 07:10 tonypig

Non-ancient Android versions (I think starting with Kitkat) do graphics compositing using the GPU, thus the framebuffer device is simply not used anymore and returns all zeros aka black. I encountered at least one Android 6 device where the system wrote back the composited screen to /dev/graphics/fb0, but this seems vendor-dependent.

bk138 avatar Jun 10 '20 19:06 bk138