aboutsummaryrefslogtreecommitdiff
path: root/README
blob: ba6eb5e80861c61a7bfd0a6bb791a89fe55109a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Marson MT606-1 USBLink Daemon
=============================

What is it?
-----------

marsond is a daemon for Linux that fixes an issue with a particular
model of PS/2 => USB keyboard adaptor. The symptom: in games and
emulators, the Enter key only works sometimes. This is caused by the
firmware in the adaptor sending the keypress and release events only 8
milliseconds apart, which is about 10x as fast as a human could press
and release a key.

The specific hardware that has the Enter key problem for me is USB
vendor ID 04b4, product ID 0101, "Marson Keyboard and Mouse Link
Ver:ps2120L". It has a label on the front that says "USBLink", and on
the back, the model number is "MT606-1".

marsond uses the Linux uinput layer, so it's not portable to other
operating systems. If you're looking for a non-Linux solution, see:

https://slackware.uk/~urchlay/sdl-usblink-hack/


Prerequisites
-------------

- Recent-ish Linux kernel. Anything from 4.x up should be fine.
- glibc and kernel headers.
- uinput support in the kernel. Most distros should have this.
- gcc or clang.
- make.
- perl.
- The usual Linux development stuff (shell, coreutils, etc).


Building
--------

The usual "make" and "make install". See the Makefile for variables
you can adjust.

If you want to build a static binary, you can't do it with glibc,
due to it needing libnss_compat at runtime (for the getpwnam() and
getgrnam() calls). You'll have to use something like musl-libc.

After installation, or any time you edit the udev .rules file,
run this:

# udevadm control --reload

If you're packaging this for a Linux distro, you can run the
above command from your package system's post-install hook (e.g.
doinst.sh on Slackware). See also the variables at the top of
the Makefile.


Running the daemon
------------------

After "make install", it will run via udev when the device is plugged
in. See /etc/udev/rules.s/99-marsond.rules to change the options,
if needed. If it doesn't start automatically, check the vendor and
product IDs in dmesg against the ones in the .rules file. If you have
a different vendor/product ID that has the Enter key problem, please
contact me so I can add them to the udev rule.

When the device is unplugged, the daemon will exit.

For testing purposes, you can start it manually. Usually when you do
this, you'll want the -v and -f options (verbose, foreground).


Contact
-------

Email: B. Watson, <urchlay@slackware.uk>
IRC: Urchlay on irc.libera.chat