Why does VNC suck?
Posted 18 July 2008 - 01:50 PM
I'm connecting into this quad-core machine over gigabit Ethernet. This machine is fast enough to encode and stream extremely high quality video, and the network is fast enough to move it, and my dual-core laptop is fast enough to decode it. Why does it still look like crap?
(Yes, I'm aware that it's dependent on my setup, compression, client, resolution, server, polling, color depth...etc), but I've never seen really good VNC in general, like VNC so good that forgot you were using it. The only thing that I've seen that comes close is desktop sharing in iChat because it has some impressive compression system)
Posted 18 July 2008 - 02:38 PM
Posted 18 July 2008 - 03:11 PM
Not sure exactly why but it was something about the encoding, I switched to Hextile and everything just worked. Might try different encoding methods
Posted 18 July 2008 - 03:25 PM
Posted 18 July 2008 - 08:42 PM
Put another way, it's kind of like watching TV over a closed-circuit camera. Yes, if you were just watching TV natively or through a super-duper high-end elaborate videoconferencing setup, it would look and sound a lot better... but that's not what a closed-circuit camera is designed to do. :)
I have used and loved VNC for several years now; it is great in a pinch, and I wouldn't hesitate to recommend it to anyone in need of a remote control solution. It's not made to be pretty or slick; it's made to get the job done. And it does.
Posted 18 July 2008 - 10:27 PM
It is purely a remote control utility. Instead of just giving a "virtual" desktop like RDP or Citrix, it has to take everything that is on the screen, encode it, pipe it over the connection, un-encode it, then re-create the desktop... all in as close to real-time as possible.
I agree with the first part of your argument, I didn't think about it but you are right, they were all designed to be tools. I need a VNC that is actually designed to create a seamless experience. Somebody above said that the VNCs you pay for a better, and I think that makes sense. Like the Apple iChat Screen Sharing thing is pretty amazing in that it uses Variable Compression.
The second part of your statement, and I had to think about this for a while to make sure I wasn't wrong before destroying it like a prick, is completely nonsense. In a previous life I did professional multimedia production for a living, and the hardest computer related encoding task is determining what has changed in an image. Thats why codecs like h.264 take much longer to encode because the computer spends most of it's time trying to figure out how it can use the least amount of space to store the "most" amount of day, it's very very hard.
Given THAT is the hardest encoding problem, it does not apply (maybe a little, but not even close) to the desktop. In a video the pixels are constantly changing (lens noise, shadows, lighting...etc), and the computer decides which are important and which aren't. On the desktop it's perfectly easy for a computer to decede what has changed, because the screen will remain perfectly the same unless a change happens. The computer doesn't usually need to calculate tolerances, it never has to decide "Did the menu open enough for me to care about it?" because it's pretty black and white if the menu is open.
So not only is encoding for VNC significantly less difficult than encoding video, I'm using a machine that can handle it. When this machine was built (for video editing and encoding) like two years ago, it was arguably the fast machine that money could buy (for that task). The GPU, CPU, and RAM were all the fastest possible at the time. I get the same VNC experience now, that I got on my 1.2Ghz machine. But this machine has 3.0GHz(x4). VNC can monopolize 1, 2, or even 3 cores for it's processing if it can't unload some of that to the GPU (and it's my understand that only commercial VNC products really leverage GPU power).
"Pipe it over that connection", also doesn't apply because this network was built to support production class machines that had to move huge amounts of data between computers and a NAS. Not only does it have the bandwidth to support more data, it is correctly setup and can route data as fast as any network.
"Un-encode it", Decompressing doesn't take as much power as encoding/compressing. Even though my laptop is only a dual-core machine, that should be more than enough to decode anything sufficiently.
"Re-create the desktop", I don't actually know at all how that works, so you could have a point, maybe creative the desktop is very hard. But I have played games like bioshock and half-life on my laptop, and I would assume that those are going to work the system much harder.
Although I would completely agree that like CCTV systems, VNC was designed for a different purpose than creating a really smooth desktop session (cctv vs. video conferencing). And I don't all mean for this to sound like a personal attack, but your excuse that VNC is doing a difficult task and limited by processing/bandwidth, is completely wrong. (And it's possible that I misunderstood that, you could have just been pointing out the obvious significance of what it's doing, not necessarily that it's limited by any of those components)
Posted 18 July 2008 - 11:11 PM
Also, VNC has roots way way back. It was also originally designed to be as cross-platform (i.e. elegantly functional) as possible. A lot of the modern day flavors have simply taken the existing code and brought it forward, so there is legacy code in there that is likely in need of a nice rewrite. UltraVNC is a variant that caters to Windows, and I've noticed some performance gains when using that one compared to some others. TightVNC, by counterexample, is optimized for slow connections, so it is more "lossy" than other variants.
I dunno, I guess I just never had extremely high expectations for it. I was a kid when 2400 baud was king, so lag never bothered me. (I still recall how fast I thought a 14.4kbps modem was when I first saw one.) VNC works great as a tool, but not so much as a remote desktop.
Ah, here is what Wikipedia has to say about how it works: http://en.wikipedia....i/Vnc#Operation
The VNC protocol (RFB) is very simple, based on one graphic primitive from server to client ("Put a rectangle of pixel data at the specified X,Y position") and event messages from client to server.
The server sends small rectangles of the framebuffer to the client. In its simplest form, the VNC protocol can use a lot of bandwidth, so various methods have been devised to reduce the communication overhead. For example, there are various encodings (methods to determine the most efficient way to transfer these rectangles). The VNC protocol allows the client and server to negotiate which encoding will be used. The simplest encoding, which is supported by all clients and servers, is the raw encoding where pixel data is sent in left-to-right scanline order, and after the original full screen has been transmitted, only transfers rectangles that change. This encoding works very well if only a small portion of the screen changes from one frame to the next (like a mouse pointer moving across a desktop, or text being written at the cursor), but bandwidth demands get very high if a lot of pixels change at the same time, such as when scrolling a window or viewing full-screen video.
Posted 18 July 2008 - 11:41 PM
stuff like Citrix and RDP work pretty nicely
They use some neat methods of polling coupled with variable bit rates and black magic.
Posted 01 August 2008 - 01:45 AM
Another reason VNC is so slow is because it will refresh the entire screen with each little movement of the mouse. More robust remote applications will just refresh the portions of the screen that show movement. I think the paid VNC apps do this as well.
Edited by p0larized, 01 August 2008 - 01:49 AM.
BinRev is hosted by the great people at Lunarpages!