Soarer desparately needed!

Arakula

20 Feb 2015, 19:18

Muirium wrote: Hmm…
Same here 8-)
Muirium wrote: Arakula: reckon you've learned enough that you could write your own, distinct, equivalent of Soarer's converter and controller?
I guess so, at least for the converter; I haven't looked at the controller yet (don't need that).
I was going to anyway. Long story follows ...

Because, you see - Soarer's Converter simply doesn't work for me.

Basically, it does what it should do - convert my Model M-122 terminal keyboards to USB - but it doesn't work with a KVM switch I have to use @office. Instant belly-up - the KVM switch won't transmit a single mouse or keyboard event until Soarer's is unplugged again, and with a bit of bad luck I have to reset it, too. That's why I started to recreate the source code - to get my wonderful big keyboard working on that KVM switch.

Playing with tmk as an alternative, I found out that the KVM switch absolutely HATES this NKRO stuff; if I configure the ps2_usb project in tmk to use the "normal", boot-compatible method without NKRO, it works with the switch. Unfortunately, tmk_keyboard is not exactly easy to understand or modify, and the idea of compiling a new firmware to change the layout isn't really as appealing as the EEPROM-based configuration used by Soarer.

So, since talking to Soarer obviously is impossible, I set out to get Soarer's Converter to do what I want. As a nice and educating exercise, I reverse-engineered it, then tried to modify it so that it works with the ***censored*** KVM switch.

Turns out that isn't so easy. While Soarer's Converter still contains the boot-compatible keyboard code, he deliberately crippled the HID descriptor for it, so only the NKRO stuff is really used for communication with the PC. OK, so I added the HID descriptor stuff ... compiled, reflashed, and ... haha. Now it sent all keys twice. Once for the boot device, once for the NKRO device. To me, it looks like he didn't add code to determine which interface the computer really uses, and I'm not versed enough in the matter to correct that (please keep in mind that I soldered my first Teensy into a terminal keyboard about 5 months ago; that was my first exposure to an ATmega32u4). So, next step: remove the NKRO device. Hmmmm, much better. When attached directly to a PC, this works just nicely, and would be exactly what I need.

But not with that blasted KVM switch. If I attach Soarer's Converter with boot HID configuration to that, it passes on the keys - YAY! - but for each key, it also moves the mouse pointer. There's a USB mouse attached to the KVM switch as well, and obviously Soarer's Converter does the USB communication in a way that causes the KVM switch to replay the last mouse movement whenever a key press or release is reported. To find out whether this is a bug in Soarer's Converter, I played with the code example from PJRC that obviously was one of the original cornerstones that Soarer's Converter was built on. And, guess what - this exhibits the same behaviour. I've asked for guidance in the PJRC forum, but never got an answer.

The LUFA-based tmk_keyboard code, however, does not exhibit this weird behaviour, which seems to indicate that the PJRC code causes the problem. The two approaches (PJRC and LUFA as used in tmk_keyboard) are vastly different, making a comparison extremely difficult; I couldn't find out in a reasonable amount of time what exactly makes the one work correctly, but not the other.

So I'd rather use the ps2_usb project in tmk_keyboard as a base and add EEPROM-based configurability to that.

User avatar
bhtooefr

20 Feb 2015, 19:32

All of that behavior is very much intentional, because his NKRO method was designed around broken BIOSes that didn't properly request boot mode.

In theory, the keyboard should come up in NKRO with an NKRO descriptor and advertise boot mode capability on ONE endpoint, the BIOS should request boot mode, and then the keyboard should switch to boot mode. However, some BIOSes assume that a keyboard that advertises boot mode actually is running in boot mode, and fail to request it (which is a safe assumption on 99.9% of keyboards, but violates the spec). If a BIOS follows the spec and requests that the boot mode endpoint switch to boot mode, I believe Soarer is shutting down the NKRO endpoint.

Then, per the spec, once the OS comes up and resets all USB devices, it'll parse all the descriptors. His boot mode endpoint intentionally doesn't have a descriptor, because there is no way to reliably sense that there's a real OS here, but his NKRO endpoint has one, so the OS ignores everything coming from the boot mode endpoint (but it still has to be sent in case a BIOS sees boot mode capability and assumes it's good to go). I'd guess that your KVM is violating the spec in even worse ways than the BIOSes, and there's really no way to get compatibility for that and NKRO to coexist.

User avatar
Muirium
µ

20 Feb 2015, 19:33

I've never used a KVM I didn't hate. In fact, I've never used one whose cables I didn't want to use to choke whoever's idea it was to skimp on screens! The things are fundamentally heinous. They have to maintain fake keyboard and mouse presence for inactive hosts, and the ways they go about that are invariably wrong.

Anywho, if you manage to make something as useable as Soarer's for the rest of is, I'm all ears. I don't need the NKRO stuff either really. But it doesn't hurt, in my simple case where I run the USB ports!

User avatar
XMIT
[ XMIT ]

20 Feb 2015, 19:39

+1 for hatred of pathological KVM implementations. (But between SSH and x11vnc who needs a KVM? 8-) )

One day I'd like to sit down and wrap my head around the USB HID stuff. PS/2 was so much simpler.

andrewjoy

20 Feb 2015, 19:43

Its not that KVMs are a terrible idea , its just that they are all designed my muppets

User avatar
Muirium
µ

20 Feb 2015, 19:51

Well, it all really depends on the muppet…

Image

User avatar
bhtooefr

20 Feb 2015, 19:55

Maybe the solution is an open source KVM, instead of an open source keyboard controller. (Or, rather, in addition to one.)

We're Deskthority, after all, not Keybthority.

User avatar
XMIT
[ XMIT ]

20 Feb 2015, 20:03

Yes. This. Woe be unto you if you also want to make the KVM support DisplayPort. That spec isn't public but through my day job I've looked through much of it. In short: :cry:

User avatar
0100010

20 Feb 2015, 20:30

jsoltren wrote: Yes. This. Woe be unto you if you also want to make the KVM support DisplayPort. That spec isn't public but through my day job I've looked through much of it. In short: :cry:
Yeah, it's not that much worse than the HDMI spec though (and I abhor the HDMI spec).

User avatar
HaaTa
Master Kiibohd Hunter

20 Feb 2015, 21:04

What's the KVM you're using? And how can I get one?
I can try to get it working with my implementation of USB NKRO which I use on the Infinity keyboard.

I've fought many hours with Windows 8.1, Mac OSX and Linux USB HID issues to get them all working correctly (Windows 8.1 changed a bunch of things I found from previous Microsoft implementations of USB HID).

Arakula

21 Feb 2015, 07:31

HaaTa wrote: What's the KVM you're using? And how can I get one?
Digitus DVi 3-port. I can't tell how / where to get it, as this has been supplied by my employer (ironically, it had to be specially approved).

User avatar
fifted

21 Feb 2015, 16:49

Manager approval form:

Code: Select all

REQUEST: one ***censored*** KVM
COST: mildly exorbitant
JUSTIFICATION: will give employee extensive pain and frustration and keep him in check

Arakula

22 Feb 2015, 07:44

Nice, but rather "approved for a highly paranoid environment by some unknown team somewhere in the hierarchy and therefore used throughout the whole company" (... and not against me personally 8-) ).
Also, it works quite nicely with all "normal" PS/2 (my IBM and Unicomp Model Ms) and USB keyboards (employer's Dell and Lenovo RD atrocities that came with the computers) I've thrown at it, just not with Soarer's Converter.

User avatar
XMIT
[ XMIT ]

22 Feb 2015, 14:40

FWIW, Cindy's question regarding this thread was "why not just use PS/2?". She has plenty of PS/2 KVMs in stock. Not all modern computers support PS/2, nor do all modern keyboards without a converter. I'm just annoyed that there are half-baked products out there that don't follow the spec well. (I assume the failure is with the KVM and not Soarer's code.)

andrewjoy

22 Feb 2015, 21:39

I don't see what's so hard about making a good KVM, should they not just look like a keyboard and mouse to the computer and then when that computer is not selected it does not send any commands but does not disconnect it. Its not as if its just a switch. And could the KVM not just read the device ID of the connected device and send that directly to the computer rather than appearing as a generic thing.

User avatar
XMIT
[ XMIT ]

22 Feb 2015, 22:06

KVMs act as interposers and intercept certain key commands. Most do this in order to be able to capture key presses and hide them from the connected system(s) for things like hot key switching.

Some KVMs (like the iogear branded one I've got at work) specifically expose a "keyboard" and "mouse" device to the connected system. They will often have a specific "keyboard" and "mouse" USB port. The trouble can be that they expect a certain device, or only allow one device ID. For example the USB Ultranav keyboards I own often have issues with KVMs since they expose a keyboard, a mouse, and two downstream USB ports behind a hub. Often times only the keyboard will work. :evil:

I have a SIIG branded USB-Displayport KVM at home. I think it just appears as a USB hub to each connected system, maintains that illusion when switched away, and simply routes actual USB events to the active system? I don't know enough about the details of USB to know if this makes sense.

andrewjoy

23 Feb 2015, 00:27

Hmm strange. Why does it not simply pass all the USB IDs to the system as if they where directly connected and then just sniff the data and block it when that system is not selected ?

User avatar
hasu

23 Feb 2015, 01:16

This gives me clear idea about Soarer's NKRO trick. I didn't know how the trick works exactly. Thanks for detailed explanation.
bhtooefr wrote: Then, per the spec, once the OS comes up and resets all USB devices, it'll parse all the descriptors. His boot mode endpoint intentionally doesn't have a descriptor, because there is no way to reliably sense that there's a real OS here, but his NKRO endpoint has one, so the OS ignores everything coming from the boot mode endpoint (but it still has to be sent in case a BIOS sees boot mode capability and assumes it's good to go).

Arakula

23 Feb 2015, 07:19

jsoltren wrote: FWIW, Cindy's question regarding this thread was "why not just use PS/2?".
If that means "use another KVM" - I'm already stretching regulations a bit by using my own keyboards (my boss and his boss know, so it's semi-official); replacing the KVM as well might be a bad idea ... and, as said, it works quite well with all normal keyboards, PS/2 and USB, since it can do PS/2 as well. Currently, I'm using a PS/2 Unicomp Classic with it.

And using the 122-key IBM Terminal Keyboard I intend to use as a PS/2 device might be a bit ... difficult. 8-)

Sigmoid

09 May 2015, 02:41

bhtooefr wrote: Yeah, we don't get the right to use his stuff outside of Soarer's terms until (at best - in some countries (like the US) it's longer) 50 years after his death, unless he explicitly releases it for this use.
Well the thing is, there are no terms. "Hey guys I made this but I don't want too many forks of it" is not "terms". Without a license, everyone who has downloaded it and used it on a keyboard is in infringement.

On the other hand, releasing it on-line for the community, without naming any terms, might be interpreted as intent to place the product in the public domain - especially looking at the deeply engrained morals of re-use, hacking and remixing in the "maker" and "hacker" communities.

Also, of course, I'm an IP anarchist when it comes to abandonware. I'm almost ridiculously dogmatic in not using stolen software (even when everyone is using it, like Solidworks in the 3d printing / CNC community), but if you're not selling it (as in a way that I could buy if I can and am willing to pay your price), then you're fair game.
It's the same thing as if the decision is between pirating a movie / song or letting it be literally destroyed, then pirating it is not only acceptable, it's morally imperative. Pirating the original, non-"improved" version of Star Wars for example, is a moral good.

So yea. I'd say go ahead and post it online under a simplistic "public domain" / Creative Commons attribution license, attribute Soarer as the creator and disclaim ownership. If Soarer has any qualms, he can come and tell you to cease and desist.

User avatar
jou

09 May 2015, 04:08

Sigmoid wrote:
bhtooefr wrote: Yeah, we don't get the right to use his stuff outside of Soarer's terms until (at best - in some countries (like the US) it's longer) 50 years after his death, unless he explicitly releases it for this use.
Well the thing is, there are no terms. "Hey guys I made this but I don't want too many forks of it" is not "terms". Without a license, everyone who has downloaded it and used it on a keyboard is in infringement.

On the other hand, releasing it on-line for the community, without naming any terms, might be interpreted as intent to place the product in the public domain - especially looking at the deeply engrained morals of re-use, hacking and remixing in the "maker" and "hacker" communities.
The problem is License-Free Software is not quite free software. Without explicit release into Public Domain, all software is copyrighted in most jurisdictions…

User avatar
fohat
Elder Messenger

09 May 2015, 15:23

I have not gone back to the beginning and re-read the whole thing, but, as I recall, Soarer hinted that he would release the source code at some point when he was satisfied that it was ready.

Wasn't one of our English friends going to investigate his disappearance a bit, on the ground?

User avatar
Muirium
µ

09 May 2015, 15:31

I sent him a letter. But I'm Scottish, so it didnae work!

Sigmoid

09 May 2015, 22:54

jou wrote: The problem is License-Free Software is not quite free software. Without explicit release into Public Domain, all software is copyrighted in most jurisdictions…
And pot is illegal in most jurisdictions and people still smoke it. ;) The thing with laws is that we need them to live in a society, but mistaking "legal" for "moral" is a major fallacy. Also, the chance of getting into any sort of trouble over license-free software is negligible.
The worst it can get you is an email from the owner saying "please remove the content".

User avatar
fohat
Elder Messenger

10 May 2015, 01:54

We could get philosophical and wonder what will happen with all this abandoned digital stuff. Decline will only accelerate.

I have several gmail addresses which will presumably die with me.

A couple of generations from now, if computer and "email" sorts of things actually survive, all the good easy desirable names and whatnot will have died with their owners.

Sigmoid

11 May 2015, 19:10

The most legal way would be to "pull a Compaq", that is, a cleanroom implementation. The process goes as such:

First, team 1 (or person 1) reverse engineers the original, and writes up an extensive documentation of its behavior.
Then, with absolutely no other communication, team 1 hands the doc to team 2.
Team 2 then uses this document as a set of requirements and implements the product from scratch.

This is the technique Compaq used to reimplement the PC BIOS to make the first non-IBM pc compatible computer in the world, and defeat the legal department of IBM (which of course was hell bent on stopping this from happening). :)

I guess if Arakula doesn't want to do a pirate release, a Compaq-style reimplementation of the more interesting functionalities within TMK might make sense. More interesting includes all the legacy protocols and the initial scancode maps, and the dynamic config part.
fohat wrote: I have several gmail addresses which will presumably die with me.

A couple of generations from now, if computer and "email" sorts of things actually survive, all the good easy desirable names and whatnot will have died with their owners.
I sure hope to outlive Google Mail. ;)

User avatar
Muirium
µ

11 May 2015, 19:46

Compaq went to all that bother in the 80s because it meant they could pick IBM's lock on the entire PC industry.

Soarer's controller is neat and all, but I doubt there's quite the same motivation in it!

User avatar
Muirium
µ

24 Aug 2015, 11:45

Much time has passed. Can we move forward with this project? Any chance of a build / port for Teensy 3.1 for instance?

http://deskthority.net/post249408.html#p249408

antonizoon

30 Aug 2015, 18:30

What if we used Arakula's code as merely an inspiration for a Teensy 3.0/3.1/LC port? Create a drop-in replacement that also uses the same keyboard configs, but works differently under the hood.

The Teensy 3.0/3.1/LC uses an ARM microcontroller, so the code will be rebuilt ground up from scratch anyway, and will end up with little resemblance to Soarer's original code.

This inexpensive controller will also significantly reduce the cost of production for the community ($12 vs $20 for Teensy 2.0).

Vizir

16 Nov 2015, 05:55

i`m waiting for an update on this too. came across your encrypted arakulas-soarer-converter.7z file. antonizoon.

what i'm trying to understand is how did soarer do the config file uploading and reading from the avr. tmk doesn't have that feature.

Post Reply

Return to “Workshop”