droidVncServer icon indicating copy to clipboard operation
droidVncServer copied to clipboard

Android 4.3 working but with screen capture weirdness.

Open psm14 opened this issue 10 years ago • 12 comments

I modified flinger.cpp to build against sdk18 and got everything built. It captures the screen, but doesn't properly encode it:

kinda-vnc

My first guess is that maybe the size of the captured surface doesn't match the reported screen size, if that makes any sense. I've poked around updateScreen.c, adding random constants in various places to see if anything helps, but I feel like I am fumbling around in the dark here. Do you have any ideas about what could be happening?

psm14 avatar Nov 01 '13 19:11 psm14

I am having a similar problem on my Nexus 5 running on 4.4.2. Please fix this. I wish to control my phone via vnc. 69tdfbo

seang96 avatar Dec 15 '13 06:12 seang96

My phone has root via SuperSU and busybox. I changed "Display Access Method" and other settings several times, but that was no good. I got the same scrambled screen on Jiayu G4 Advanced (chinese phone) with android 4.2.1. Note: SCR Screen Recorder app works fine to record the screen to an mp4 video file. I would like VNC though!

droid-vnc-server-scrambled-screen

petesimon avatar Dec 18 '13 20:12 petesimon

Just wanted to post an update here since I recently came back to this and figured it out. ScreenshotClient has a "stride" property in addition to width. Stride represents the number of pixels per row of the image. Yeah, it sounds like that should be identical to width, but it isn't in this case. There appears to be some room for overdraw or something.

I did a quick hack fix by changing getWidth() to getStride() in the SurfaceFlinger cature code, however a cleaner fix would probably want to crop the image back down to the "proper" width.

psm14 avatar Dec 30 '13 21:12 psm14

Hi psm14,

Just wondering if you have a working APK for Android 4.3/4.4. I've had the same issues and I'd be thrilled to get VNC working. If you have a branch or a fork of this project please let me know! Looks like the author has abandoned this.

Cheers!

mikenemat avatar Jan 08 '14 20:01 mikenemat

I don't at the moment, but it shouldn't be too difficult to produce a build that works all the way up to 4.4 if I have time.

psm14 avatar Jan 08 '14 20:01 psm14

Hey, I would be interested in fixing that issue, too. Has anyone been successful so far or got a new insight?

wilzbach avatar Jan 13 '14 21:01 wilzbach

Additional info: I'm running v1.1RC0 from the Play Store on i9505 phone with ProBAM ROM 1.2.4 (KitKat-based). There's no image on the VNC viewer but the tap/drag/keyboard events work.

radj avatar Jan 14 '14 08:01 radj

Hi psm14, thanks for documenting the fix, could you provide an apk?

fbreitwieser avatar Feb 08 '14 22:02 fbreitwieser

Wow after a long wait a promising note psm14!! Do notify here if you push things to public repo.

ghost avatar Feb 12 '14 15:02 ghost

Hey psm14, Did you ever get this working with 4.4?

RobertDaleSmith avatar Apr 09 '14 16:04 RobertDaleSmith

@psm14 found proper fix for 4.3??? how abt it in 4.4?

ghost avatar May 23 '14 18:05 ghost

@psm14 thank you very much!

I have fixed this error in my fork (https://github.com/baohaojun/droidVncServer), and can see correct VNC images.

I didn't get the apk working though, need to start the androidvncserver from adb shell command line, and then use adb forward tcp:5901 tcp:5901. Usb transfer speed is much quicker than wifi I think:D

baohaojun avatar Nov 18 '15 03:11 baohaojun