Rig

Both boxes are wired like this on one PC, and tested one at a time.

+--------------------------------+
|       PC: tests, usbmon        |
+-------+-----------------+------+
        |                 |
+-------+-------+   +-----+-----+
|    STT hub    |   |  MTT hub  |
+---+-------+---+   +-----+-----+
    |       |             |
  USB1    USB2        emulator
  clone   control     control
    |       |             |
+---+-------+---+         |
|      box      |         |
+-------+-------+         |
        | USB3            |
+-------+-----------------+------+
|      USB device emulator       |
+--------------------------------+
ItemDetail
FirmwareStock V4.122, Medius 3.5.0
Real deviceA USB device emulator on each box's USB3, presenting the same device and native reports to both
STT hubA USB 2.0 hub with one transaction translator for all its ports, for both boxes' USB1 and USB2
MTT hubA USB 2.0 hub with a transaction translator per port, for the emulators' control ports and the native reference
Box not under testIts emulator presents a silent mouse, or is the native reference
Native referenceThe other box's emulator on the PC, presenting the same device, for every result compared with native
PCLinux

Rules

RuleDetail
RowOne condition, run on both boxes with the same test, settings, sample size and timing layer
TableOne quantity in one unit
TimeThe median (p50), unless the table names another statistic
RangeLowest to highest over the runs. The fainter part of a bar spans it
CountA count of a total adds up the box's runs: 3, or 1 where stock runs a test once
BarDrawn to the largest value in its table, or in its row on the Overview
ResultThe box ahead, worked out from the values. The box behind is dimmed
FaithfulIf a test records native behaviour, the box that matches it is ahead
EqualThe outcomes match, or the gap between the two measures is within their noise. Each box's runs are pooled, weighing each run's sampling error and the spread between runs. A box leads only past Student's t for the runs' degrees of freedom: 2.78 standard errors with 3 runs a box, 4.30 where a box ran once and takes the other's spread between runs. A count of a total is equal where the two ranges overlap
DiffersThe boxes behave differently. Neither is better, or no test shows which is faithful
DefectA fault that reproduces, marked on its row and listed on the Overview

Timing layers

LayerDetail
WireUSB packets on the PC's bus, timed by the kernel's usbmon
evdevInput events, timed by the kernel as the HID driver handles each report
hidrawEach report byte for byte, timed when the reading program wakes
HostThe PC's clock, read by the test program when it writes a command, or when the clone connects or disconnects
EmulatorWhen the emulator queued each native report, on its clock. Its control link's packets on usbmon map that clock to the bus clock within ±95 µs

Data

The results as JSON, all in one file or split by area, and the run files they were built from.

FileArea
comparison.jsonAll
devices.jsonDevices
passthrough.jsonPassthrough
injection.jsonInjected motion
control-link.jsonControl link
input.jsonButtons, keys and locks
recovery.jsonRecovery
features.jsonFeatures
software.jsonSoftware

Comparison tool

medius-compare.pyz is the tool the published results come from. Without the USB device emulator, it runs the tests a still mouse or keyboard can drive, on any MAKCU box. Every other test is skipped and named in the run file with its reason.

Top view, chips up
Main chipMouse-side chipBOOTBOOTUSB1This PCUSB2This PCUSB3Mouse/keyboard
  • USB1This PC
  • USB2This PC
  • USB3Mouse/keyboard
ItemDetail
PCLinux, run as root
Python3.11 or newer
PackagesThe medius package release made for the box's firmware, and pyserial, for the Python run as root

A venv keeps them off the system Python:

python3 -m venv ~/medius-compare && ~/medius-compare/bin/pip install medius pyserial

Run the tool

  1. On stock, find the box's control port with ls /dev/serial/by-id/ and run:
    sudo ~/medius-compare/bin/python medius-compare.pyz run --box stock \
        --port /dev/serial/by-id/usb-1a86_USB_Single_Serial_<serial>-if00 \
        --usb-port <clone's USB port>
    Leave out --usb-port and it lists this PC's input devices by USB port. The clone is the one with the real device's VID:PID and name.
  2. On Medius, the same with --box medius and no --usb-port (the box says what it cloned):
    sudo ~/medius-compare/bin/python medius-compare.pyz run --box medius \
        --port /dev/serial/by-id/usb-1a86_USB_Single_Serial_<serial>-if00
  3. Each run writes runs/<box>/<stamp>.json. Compare two:
    python3 medius-compare.pyz report <stock file> <Medius file>

While the tool runs, the clone is kept off the desktop, so nothing injected reaches the desktop. The tool puts the clone back at exit, Ctrl-C included. Leave the real device untouched: a leg refuses to start if it moved.

On stock, bad-input, buttons-keys, clump-probe, exit-recovery, keyboard, move-accept, stock-intake and typing-long can leave the box's parser one command behind until a power cycle (Control link). Each runs once on stock unless --stock-jam-runs asks for more. When one leaves the parser behind, the tool asks for both the box's cables to be unplugged for 3 s and plugged back in, and waits for Enter. A full run takes ~12-20 power cycles: our stock run needed 12 inside two of these tests, and each can need one more after it. To leave these out, name the tests to run with --test (repeat it for more).

Tool tests