VNC Viewer for the RiscPC

updated 13 Dec 1999

for more about the Remote Frame Buffer Protocol other VNC viewers and servers see the RealVNC website.

See also smbclient.

!VNC

Intro

!VNC will allow your Acorn computer to connect to PCs and Unix desktops via a network, add a network file system like NFS, Omniclient or smbclient or the like and you have complete access to the machine and you won't be sitting in front of it. I have a more recent build of smbclient available if anyone is interested, I've not got around to releasing it yet.

I've been getting loads of good feedback of users so keep it coming. I started the port in early June 98. If anyone is interested in working on this program I will consider releasing source code on the understanding that I am the only person to make public releases, any changes submitted to me will be fully credited. I want to be able to provide some measure of stability to this project. It's looking like I shall release all the source with the program some time in the future.

Getting Started

You will need to run a vnc server on the machine you want to connect to. You cannot connect to a standard X server you will need to start Xvnc from an xterm or telnet session and then connect to the new X display you just started.

you can use a saved password file as encoded by the tools in the server. Use the command line option '-passwd filename' to authenticate automatically. I shall put in a more support for encrypted password files later.

Warning:

Storing your password on disc is a serious security risk, consider the risks before doing this.

Note:
If you have set up your server with no password then you will have to use the -passwd <FileName> command line option. This is currently the only way to stop !VNC complaining about an empty password field in the connection dialogue box.

Recent Changes

1.12.2 13 December 1999
Another Source split has occured. I now have 1.12 (the previous release), 1.12.2 (This release with full screen support), and 2.00 which is a code reviewed and consolidated design.

The unreleased 2.00 features wimp message access to all the internals including rectangle updates to support multiple windows into the session. I've had over 12 windows updating will little or no perceptable loss of performance! If anyone would like to know more about this mail me.

Anyway, back to this release. This has been in testing since around September 1999. You know have a full screen mode which can be toggled between using Ctrl-Alt-BackSpace. I must thank Christopher Dawkins of Felsted School, Essex for his help testing, his encouragement and support amongst other things and for pompting me to produce this version. He has put it to an interesting use. FreeBSD running a linux binary of VMware which in turn is running Windows which is piped out to Acorns via VNC! now thats IT. At the end of the day it looks like an Acorn machine running Windows.

1.12 11 July 1999 1999
Fixed stupid bug that has caused !VNC to work by accident since day 1. Thanks go to Vincent Sanders for providing useful crash dump information. VNCSupport module should now work on RISC OS 4. Thanks to Andrew Veitch for pointing this out and testing the patch.

There has been a split of the source here as I have done a full code review on the source and now added lots of new features to produce a version 2.00. The code review even identified the problem I fixed above but having seen the program work for over a year without any unexpected side effects I thought it must be ok so didn't investigate further.

1.11 25 Feb 1999
Added Clipboard send, drop a text file on the session window and it'll be sent to the clipboard on the other machine.

Added better keyboard support. now supports CapsLock and NumLock, Alt is also supported but you will not see anything different. Also added support for loading new keymaps into the module. This will enable foreign keyboard support and can generate any XKeySym from most combinations of key presses. The Caps and NumLock status will be read as the module starts.
I can supply details of how to implement new key maps, they are a collection of tables containing XKeySym values. It is very easy to generate new key codes for Alt-Key combinations and to change regular upper/lower mappings for different keyboards.

1.10 15 Sep 1998
Added Clipboard Save dialogue.

Session menu now also available from toolbar.

Partially completed code to provide multiple views of the session screen. This should allow you to have 1 RISC OS window for each window on the remote desktop so should make it easier to manage your workspace between two computers at once.

1.09 01 Aug 1998
viewonly option has never worked so I've added the necessary code. should the session gain focus (which is difficult) it will not send any key or mouse events.

Added small state machine to watch modifier keys. These keys are now released for you whenever focus is lost from the session window. It should stop problems occuring when for example you do Ctrl-F12. The Ctrl-F12 will be sent to the session but when you lose focus the vnc server will be told you've released the ctrl key. This will at least stop your session getting into an unexpected state. Previously the Ctrl Key would remain down since it lost focus before you released. Then when you return to typing it generates garbage. The perfect solution would have been to release only those keys not pressed as you regain focus but it's not a perfect world and I don't want to write loads of extra code. I think the compromise I have come to should not cause problems under normal use.

Added two new options to the configuration.

Changed mouse button state changes so that they must start on the window before mouse state is sent to the server. This should for example stop drags that start in a filer window and cross the vncviewer while it has focus from starting a drag at the server as well.

I've also tried to add clipboard support but I've been foiled by the text gadget so it's been removed again and I'm back to the drawing board on that one.

minor code changes to reduce the number of warnings in one of the legacy files.

I can now test against Win95 again, but I don't like using it.

1.08 12 July 1998
VNCSupport Module now at version 1.02, support for RISCOS 3.xx. !VNC will not work on 3.00 machines as I use colourtrans_generate_table. I will put in fallback support to use coloutrans_select_table if I am requested to do so. I need someone to test this for me.

Mouse updates, screen change requests and WimpPolls are now under control of sliders so you can change the responsiveness of the session without restarting !VNC. Anyone using this feature with a slow net link eg modem, serial etc please tell me how you get on with it.

1.07 09 July 1998
Added Config option to hide Toolbar.

More dead code removal and streamlining of code. Found and fixed a bug that caused 8bpp AsServer mode to select 16bpp sprite. Mistake was to test < instead of <=.

While investigating AsServer format sessions I noted some more optimisations that can be made to all 8bpp mode code. All 8bpp mode sessions now appear to run faster.

It is now safe to connect to a new session while another is open. The session window will appear to remain open while the old connection is closed and the new connection is made.

The pointer now changes to a tiny version of the default pointer while inside the session window.

1.06 08 July 1998
I've started to add error boxes and code to recover from errors that the X vncviewer would normally exit from. All the common networking errors during early stages of initialisation are covered along with low memory problems and socket errors while the session is in progress. There are now only 2 unwanted exits in the code. One is in some dead code that I shall remove soon, the second will only occur if you manage to configure your Xvnc wrongly and then a set sequence of operations in !VNC. There is a third which occurs when you enter the wrong command line options and it prints out the available options. I can't be bothered to add code to fix up the mistakes and work as normal as many times you may actually want the list of options.

No more optimisations in this version, the next one might be to reorganise the whole protocol redraw code to write directly into the sprite in possible situations. This may not prove useful as it won't make any difference to performance on a slow or long latency network.

This version is more of a code review and tidying exercise along with the start of dead code removal and streamlining of code.

1.05 06 July 1998
Early implimentation of colour lookup cache resulted in some interesting results. Cache size of 4 gave hit counts that maxed out at around 2,000 to 3,000. Cache size of 8 gave hit counts that maxed out at around 20,000 to 30,000. The large hits were due to lots of xterm operations and window manager menus in all tests. I would expect larger caches to reduce performance too much for misses which tend to be for long runs. I performed these tests using fvwm, Imagemagic and xterm in a 16bpp server with the viewer set to AsServer. Cache uses round robin replacement. For some of the smaller logs which were a full screen redraw, followed by longishuse of an xterm then random menu selections resulted in around 80,000 to 100,000 hits and < 40,000 misses. logs were often > 40MB for a couple of minutes.

Added a few performance enhancements, should really shift most of the time.

Oops, broke the default colour format in Config, should read the ErrorLog! It was broken in 1.04 release fixed as of 1.05.

1.04 05 July 1998
Added Keyboard Auto repeat. I've been using it for over a week but had problems with the module. Once or twice it would mess up the mouse while !VNC was starting. It turns out I was corrupting SVC_R14 from IRQ mode. Of all the modules I've written this is the first that I've called a SWI from IRQ mode! I must remember RTFM RTFM RTFM.
New Colour mapping support.

All non-8bpp formats are slow as they take no advantage of similarities to local sprite formats. This was so I can prove the conversions work before obscuring their operation with optimisations and special cases. My analysis of the conversions performed over many sessions has shown there to be at least 3 basic improvements that can be made. These will be added soon. And yes I have tested most of the option combinations (some execute the same code I wanted to test Fixed 8bpp and TrueColour 8bpp). Tests on rre, corre, hextile, raw in 8,16,32 modes all passed. AsServer option was also tested in most combinations of options but many use the same code so some were skipped.

I am no longer able to test against the Win95/NT servers as I've moved to a new dungeon/office.

1.03 29 June 1998
You can now click Adjust on the icon bar to open the connect dialogue box.
Added Config file and code to set the controls. It was pointed out that my assumption that message files were used at run time was incorrect. Only the _TaskName is used, and that's the one I want hardcoded into the program. Toolbox screws up again.
Thanks to Darrell Taylor for the !VNC icon.
Added PollDelay configuration option.

1.02 28 June 1998
Added -useRMA and -noRMA options to command line this forces the application to use dynamic areas or RMA, the default being to use the dynamic area if no option is specified. Reorganised some command line passing code and removed a few options.

Now supports BGR233 and RGB332 ordering of bits when you specify BGR233 encoding of pixels in the viewer. This should fix some problems found with colours not being correct (when set to use RGB332 format). There is still the outstanding problem that the PC server I use only sends data as 16bpp and so far the port of my viewer only uses 8bpp. The viewer will no longer generate any picture for non 8bpp modes.

1.01 25 June 1998

I've added RRE, CoRRE, Hextile encodings to the existing Raw and CopyRect support. Although they have only been tested for a couple of days, I've managed to stuff a few hundered Meg of screen updates through. These compressed encodings should help anyone trying to use this over a modem. To provide some idea of how this performs I've seen better than 13:1 compression on many sessions to my X server even when using programs like gimp and xv. Note, there is still only 8bpp support.

Added Refresh button to toolbar, this should help when connecting to PC's. (30th June) Nope PCs send 16bit data it was luck that caused it to appear to work.

Problems

Network configuration problems (ensure that the server can be found by dns or is contained within your !Internet.files.hosts file) and early versions had the hostname field too short meant that some users needed to enter the address as a dotted quad instead of by name. If you are having problems connecting to a particular server try and ping the machine, if this works then domain name lookups are probably ok. The remaining possibilities are the server has died or there really is a problem with VNC.

If for some reason you have a session window iconised, and then reopen it after you have disonnected, !VNC will die with a data abort.
I have had very few crashes caused by unexplained circumstances, although netscape appears to cause problems occasionally when using raw encoding (seen in pre 1.02).

During testing of the vncsupport module with keyboard auto repeat I had occasional problems with the mouse. A software gravity caused the mouse to be dragged to either the left or bottom of the screen. This version was NEVER released but if it re-appears I've fixed a problem that had not manifested iteself and I've still got some thinking to do before fixing vncsupport.

Should your session crash then it is probably worth rmkilling the vncsupport module before restarting !VNC.

I used the X viewer as the basis for this port which right now will just exit with an error message should anything go wrong. check the ErrorLog file inside !VNC. I do plan to add proper error boxes soon. Most of this work is done.

Notes

While using Pre1.07 I got the keyboard confused. and the terminal I was using wouldn't respond properly. If you find that you can't see anything as you type or it's coming out wrong then this may have happened to you too. Try the following: tap each of the ctrl, Alt, Shift keys in turn, both left and right sides. This should bring things back into order. What happens is that one of these keys is held down while in the window and when focus is removed the key is released, the result is that the remote machine never gets the key release. As of 1.09 this problem should not occur.

Server Configuration
I use X for testing so here are some of the options I use and have worked for me.
vncserver -geometry 1152x968 -depth 16
This produces a nice sized screen for a 1280x1024 display on my RiscPC. I've found the -depth 16 option to be important for some programs like gimp which fail when running in the Xvnc default of 8bpp. It should be noted that although Xvnc uses 16bpp it sends the viewer 8bpp data, this appears not to be possible on the PC. I have a Win95 box with 8bpp screen but it always sends the viewer 16bpp which when using the BGR233 option will give a picture (not as of 1.02) but tends to crash the machine sometimes.

As of 1.02 I've tested the useBGR233 option with both '-pixelformat BGR233' and '-pixelforma RGB332', the colours produced are now correct in both formats.

I've written a keyboard handler that generates XKey events and sends them down the wire, . There is now a swi to load a new map into the module. The module swi number will probaly clash with something so I will be getting an allocation soon. VNC is much more careful about what happens when it loses focus and some keys are held down.

If you need support other than for the standard UK RiscPC keyboard then contact me and I can provide help and tools to generate new keymaps.

Future Plans

This is a list of suggestions and my wishes for this program. I make no promises I will ever get around to doing them.
A full Screen mode. Done, see version 1.12.2
Auto repeat of keyboard. Done, see version 1.04
GUI config. No more config files
Dialogue boxes for errors. Mostly Done, see version 1.06

Downloading

I'm sure you want to download the VNC viewer and try it out, so here it is.

The current !VNC archive (1.12.2) is < 60k. Also available as Sparkive(Zip)
version 1.12 of VNC
version 1.11 of VNC
version 1.10 of VNC

These archives can be decompressed using !ArcFSr/w. you will also need a server application, you can find links to the various servers from the RealVNC web site.

comments, bug reports etc about !VNC to simon@bigblue.....
I don't promise to do anything mind ;-)