uSynergy with RISC OS?
Pages: 1 2
Tristan M. (2946) 1036 posts |
This probably sounds a bit crazy. I know there is an abandoned version of Synergy for RISC OS, but when I was building Synergy for the Raspberry Pi and Orange Pi PC I noticed there’s another thing that builds. usynergy. it appears to be a bare bones client for embedded systems. It builds to a tiny 10.2kB executable in Armbian. The source just seems to be catching packets and triggering events more or less. If I had the faintest idea how their build system worked I’d try to feed it though GCCSDK to see how far it gets… but I don’t. Does it seem plausible? |
Glen Walker (2585) 469 posts |
Is there? Interesting… I remember discussing it on here but hadn’t realized it had gone as far as that. I would be quite interested to see how you get on with building it…and if I had more time would love to have a go! |
Tristan M. (2946) 1036 posts |
It seems to have RISC OS specific files in it. Last activity was in 2012. It says it’s an unofficial mirror so I really have no idea what the deal is. usynergy does seem like a potential starting point though. Up to date source, and much less of it. My time is at a severe premium too. If I’m lucky I can wrangle a few minutes at odd hours. Usually when a person has no business being awake. I just had another quick glance at the usynergy source for *nix and Windows. It’s better than I thought. The callbacks haven’t been implemented. All it appears to do is splat events to the terminal. It’s just a template that compiles. Unfortunately I don’t know how much of synergy needs to be fed through the toolchain for usynergy though. I’ll have to see if GCCSDK is buildable on armhf linux. I can’t remember. Since the electricity price hike it’s been ARM devices only in this household unless absolutely needed. I’m using an RPi3 and an Orange Pi PC with Synergy as a sort of dual monitor setup in a loose sense. If I were smarter I suspect the OPi PC could support dual monitors via an HDMI 3D splitter, but I’m not. |
Glen Walker (2585) 469 posts |
Sounds familiar! I will put it on my “maybe look at when I get the chance list” because its definitely something I would find useful…seeing that I own too many computers and only have one pair of hands/eyes!
I do regret creating an x86 media server…but hopefully soon replace it with an ARM based solution! |
Tristan M. (2946) 1036 posts |
I had an old PC as a loungeroom media player for a while. So intrusive. Game consoles work well enough for my needs now. However I am using an ARM based device as a smb/nfs NAS and DLNA server with a Seagate USB hard drive attached. It works really well, for my needs anyway. Everything is pretty outdated. I’m using an Orange Pi Zero for that. Haven’t regretted it for a second. They can be a little hungry but it spends the vast majority of its life idle. |
David Feugey (2125) 2687 posts |
Would be so much simple to call it Raspberry Pi Micro :) |
Tristan M. (2946) 1036 posts |
Ha! Yes, but I meant the orange Pi Zero. While other *Pi names are clearly copying Raspberry Pi I can understand why. Finding what other SBCs are available is nearly impossible without a name. Besides being small, the Orange Pi Zero has completely different uses. It doesn’t have the RPi style GPIO header. It has a quad core H2+ SoC and has built in ethernet and WiFi so it’s not what I’d call a low power device, and it does not have HDMI out. Those who do not remember history are doomed to repeat it. I left the OPiPC to compile GCCSDK. It wasn’t until after it failed I remembered that building fails on ARM devices. I did find an entry on the GCCSDK mailing list from a couple of years ago http://www.mail-archive.com/gcc@gccsdk.riscos.info/msg02328.html however a lot seems to have changed so I have to work out where to define SUBTARGET_EXTRA_SPEC_FUNCTIONS as a null macro. |
Tristan M. (2946) 1036 posts |
It doesn’t mean a massive amount on it’s own but I just built uSynergy.c and uSynergy.h as a static library in RISC OS using gcc without so much as a grumble from the toolchain. |
Glen Walker (2585) 469 posts |
That sounds quite promising! So what is it doing right now? Listening on a network port and outputing data to nowhere? Can this output to a Task Window? |
Tristan M. (2946) 1036 posts |
It literally does nothing, except crash if I call uSynergyUpdate(&context); which is fair enough because I haven’t initialised anything. |
Tristan M. (2946) 1036 posts |
https://github.com/joeld42/imgui/blob/ios_example/examples/ios_example/imguiex/imgui_impl_ios.mm All I’ve actually done is add the sleep function and build it to make sure I wasn’t doing anything dumb. I’m also purposefully leaving the uSynergy lib and header untouched. If a client can work without a specially baked version of the library code that’s a big positive. |
Glen Walker (2585) 469 posts |
Would love to but I am doing far too much already! Definitely keep us posted here though. Good things come to those who wait. |
Tristan M. (2946) 1036 posts |
Well okay then. Probably the first thing to do is stub out the necessary functions and tape together enough network code to see if it catches fire or functions. There does seem to be an issue that would bother some about uSynergy. I don’t think it supports SSL. |
Tristan M. (2946) 1036 posts |
A little update: For some reason I couldn’t get it to connect to the Synergy server using a hostname so I hardwired in the IP address. Both client and server registered a connection! My uSynergy client doesn’t have a program loop yet. It just tries to connect, updates then ends. I haven’t done it yet simply because I’m concerned about multitasking implications. I might make sure I’ve saved everything and give it a shot for the sake of it. edited edit: So far it can:
So it can connect to the server, and the server’s mouse can dissapear off the screen. RISC OS displays the “mouse” coordinates. What this means is messages are successfully being sent and received. |
Glen Walker (2585) 469 posts |
Wow! I wasn’t expecting so much so soon! Very promising :—) |
Jeffrey Lee (213) 6046 posts |
I’d say now is a good time to try and get the code running as a module. Ultimately that’s going to be the best way of allowing remote control over the computer (a Wimp app won’t cut it, e.g. if a Wimp error box appears then the Wimp will stop polling apps until the user dismisses it) May I suggest ‘my’ VNC server as a good example of how to do socket management, remote keyboard & mouse control, etc.? ;-) |
Tristan M. (2946) 1036 posts |
That’s a good idea. It’s currently a bailing wire and duct tape affair. There are a few things I have to pin down.
I’ve also been putting off learning about making modules too. I know it needs to be done that way, but an executable dumping output to the task window is easy to work with while I catch the big bugs. |
andym (447) 464 posts |
Not sure it’s exactly what you are looking for, but KMSwitch on Thomas Milius software pages may also help. Seems like a RISC OS only implementation of a Synergy type thingy and the source is available further down the page too. |
Tristan M. (2946) 1036 posts |
Thanks for that andym. I haven’t seen that page before. What I’m looking for doesn’t exist so I’m just doing what I do. Making it! What I want is a cross platform solution, which Synergy is. Just with my brief bit of work it does stuff. As far as the server running on Linux is concerned the RISC OS client is functional. Sure, all it does is display messages that things are happening instead of actually making it so, but as far as I’m concerned that’s the worst part done. Ie getting an OS agnostic library with no documentation functional on RISC OS, without altering a single byte of said library. I want Synergy in particular because it means I don’t need to juggle mice and keyboards because I’m constantly switching between computers on a small desk. Plus it means I can copy / paste between them. |
andym (447) 464 posts |
And I for one hope you get there with it because it’ll be a really useful tool for many of us. I always thought there should be a simple option in VNC servers on RISC OS and other systems to just ‘turn off’ the video part! But a more standardised method that works with Linux and maybe Windows would be fantastic! |
Glen Walker (2585) 469 posts |
I used to use Synergy all the time when I had a Linux machine next to a Windows one (now all my Linux machines are headless so I just connect remotely…except my laptop which is in lots of pieces and isn’t accepting connections right now!) When I first started using RISC OS I had a quick look at Synergy but didn’t get anywhere near uSynergy so its great to see some progress here. So, yes, it does work with Windows—or at least Windows 7. I think it works with macs too. |
Tristan M. (2946) 1036 posts |
I’ve been hunting around. Is there no official means to set mouse state like X, Y, mouse button states? The reason I started to think something has gone a little peculiar was HAL_CounterDelay wasn’t delaying, and Wimp_GetPointerInfo seemed to be returning a pointer to uninitialized memory. I haven’t had any time to do anything really. Just search for how to gain control of the mouse and keyboard. Been travelling. Not the fun sort. It never is. Just hours in the car. |
Jeffrey Lee (213) 6046 posts |
Pointer position can be set using OS_Word 21, 5 Button states need to be set via KeyV – you’ll need to generate key up/down events as appropriate. Keyboard handling (or at least the way it’s done in the VNC server) is a mix of KeyV and inserting bytes into the keyboard buffer. VNC keyboard handling is mostly character-based – i.e. the client controls key repeat and decides which characters should be input on the server, so most of the time the server puts them directly into the keyboard buffer. But some keys like Ctrl are only available via KeyV, and some modifiers require special attention, so KeyV is used as well. I’d assume Synergy will need to behave in a similar manner. There’s a reason I said to look at the VNC server sources :-) |
Tristan M. (2946) 1036 posts |
I did have a look. I just wasn’t sure what I was looking for. I also found a BASIC ASM listing for MouseKey. Now I know it what I wanted it really stands out! I haven’t really looked at the keyboard code yet. I believe it’s scancode and event driven. KeyV would probably be the right solution for most of it. On the subject of I/O. uSynergy, and of course Synergy handles joysticks. Is there anyone that would actually want to use a joystick via network on a RISC OS machine? |
Tristan M. (2946) 1036 posts |
I’ve been pretty busy. Had some time to get the mouse pointer working on the client. No buttons yet and the resolution and unit multiplier are hardcoded but it is incredibly satisfying to have the mouse go off the side of the Linux screen and appear and move around on the RISC OS screen. Not going to lie. I was hung up for ages on OS_Word 21. It took me way too much time to realise I couldn’t feed it a byte and a couple of 16 bit ints because of the word alignment. It was staring at me the whole time. |
Pages: 1 2