LockerGnomeTech news and nostalgia for today's technology professionals
Subscribe

Search

Software

usb-rea Watches a Windows App Boss Around Your USB Gadget, Then Drafts a Linux Driver in Python

Developer Emir Mrkaljevic's alpha project targets gear like case LCDs and smart lamps, though you still have to work the vendor's controls while it records.

Scrimshaw-style overhead view of Chris listening through a stethoscope to a cable that links a computer mouse and a desk lamp, one eyebrow raised in concentration.
Illustration: LockerGnome

Your mouse moves fine on Linux. Its lighting menu, however, still lives in a Windows app, along with whatever else the manufacturer decided penguins didn’t deserve.

Developer Emir Mrkaljevic’s answer is to eavesdrop. You record the USB conversation with USBPcap on Windows or usbmon on Linux, then tag what you did in the maker’s app at each step. Changed the fan speed? Tag it. Turned the RGB purple (a vital business function)? Tag that too.

Those tags are the Rosetta Stone. usb-rea lines up your actions with the bytes that crossed the cable and hunts for command structures, counters, lookup tables and checksums. A checksum is the little math receipt a gadget can demand with a command, and guessing it by hand is a lousy way to spend a Saturday.

Out comes Python you can run, along with a written account of what the tool thinks it found. The report matters because a driver you can’t question is only a mystery with a file extension.

The targets are the odds and ends piled around a PC: case LCDs, RGB controllers, mice and smart lamps. Many could work on Linux but lack official software for their extra features.

Checking the answers

There are early results against hardware the Linux crowd already understands. Mrkaljevic reports that usb-rea reconstructed the fan command byte for the NZXT Kraken X cooler byte for byte, identical to what the liquidctl project already implements.

Protocol details for the SteelSeries Rival 100 mouse were also cross-checked against rivalcfg, including DPI, polling and RGB settings.

That’s a sensible way to grade a code breaker: hand it a lock when you already hold the key. It also leaves the harder exam ahead, which is a gadget nobody has solved.

The fine print has a fan in it

Passing the project’s tests doesn’t mean your accessory will work. How-To Geek’s Jefferson Mangubat puts it plainly: “it’s not a one-click solution to compatibility.”

You’re still the lab assistant. The tool can only learn from what it hears, so a button you never press is a poor candidate for a Linux feature. Think of it as teaching a parrot: it won’t pick up words nobody says.

A likely good first project is something with a few clear controls and low stakes, such as a lamp. A cooler deserves more suspicion (your CPU would like a vote). Read the report and the generated code before sending commands to hardware you’d hate to replace.

The forecast, with moderate confidence: the report may end up being as useful as the driver. A documented guess about a protocol gives another owner something specific to confirm or correct, which beats a forum post reading “same problem here” for the eleventh time.

Mangubat sets the bar at whether people can use usb-rea to support accessories that existing Linux projects couldn’t. That’s where this gets fun. Somewhere there’s a tiny case LCD that has spent years waiting for Linux to learn its language.

Time to let it spill the bytes.

Orange links with a double underline go to Amazon. As an Amazon Associate, LockerGnome earns from qualifying purchases.

More Software

Every Software story →