Wraith Master 1.0.0 is out!

After months of work, Wraith Master is finally feature complete, and I’m ready to show it to the world. Or Reddit, more accurately. You can check it out on GitLab.

What’s Wraith Master?

Wraith Master is an open-source Linux-only RGB control application for the Wraith Prism, written in Kotlin and compiled down to a native binary. It has feature parity with the official Windows application by Cooler Master, and has two interfaces: a CLI and a GUI. Both are native Linux binaries, and the command-line interface only requires libusb to function, while the graphical interface additionally requires GTK3 (and glib2 on some distributions). 1.0.0 is the first stable release!

Edit: Here’s what the program looks like. This is using the Plata GTK theme, although I have tested with other themes as well.

Shows a screenshot of the application on the Fan tab

Here’s my own Wraith Prism running on a configuration set with Wraith Master:

What can it do?

When working on a piece of software, I find it helpful to decide on an end goal; what you want the project to look like upon the first stable release. For Wraith Master, I wanted this initial release to include every configuration option that the official Cooler Master software has– and I’m happy to say that it does. Speed and brightness? Yep. Every mode? Absolutely. Color randomization? Indeed. Mirage frequencies? You bet. Morse text? For some ungodly reason, I even included that. Everything is supported.

How do I get it?

It depends on the distribution. For Solus, you can install it directly from the Software Center (just search for wraith-master). For Arch, the two frontends are in the AUR under wraith-master-gtk and wraith-master-cli. For other Linux distributions, there are prebuilt packages available on the releases page in deb, rpm, and tar.xz formats. If you’d rather build it yourself, the information required to do so is on the project wiki.

How do I set it up?

Wraith Master uses the Wraith Prism’s USB protocol to communicate with the device. This requires an internal USB cable, which is provided with the cooler in the processor’s retail box. The two ends look like this:

A split image showing both sides of the internal USB cable

One end is plugged into the bottom of the cooler (the side that faces towards the bottom of the case), and the other end is plugged into a USB 2 header on the motherboard. Once this cable is plugged in, Wraith Master can communicate with the cooler.

The Backstory

In late August of 2019, I started experimenting with the USB interface of the Wraith Prism. I’d noticed that no one had attempted to make a configuration tool for the cooler that worked on Linux, so I figured I might as well give it a shot. I soon found out that complete reverse-engineering a USB protocol is actually pretty hard, surprisingly enough. I’d never attempted something like that before, so I figured I might as well ask Cooler Master directly if I wanted some information on the protocol.

Unfortunately, this turned out to be a dead end. Cooler Master informed me that they didn’t actually know how the protocol worked, and that I’d have to talk to AMD if I wanted the information I sought. I thanked them, and sent out a support request to AMD asking for the same information. They responded, and informed me that I’d need to call one of their corporate offices and request NDA access. As far as I was concerned, that wasn’t going to happen, so I put the project on the back burner.

Then, in late December, I became aware of a different project that had surfaced: gfduszynski’s cm-rgb. While it only had a command-line interface and didn’t implement all the functionality of the official Cooler Master application, it laid enough groundwork and had enough documentation that I decided to use it as a reference to make my project functional.

Looking at Wireshark Packets

On December 30th of 2019, I made the first few commits to the project that would become Wraith Master. On December 31st, I put out the first release, version 0.0.1. It could only change colors, nothing else. But it was something. Over the next few weeks, I implemented everything I could using cm-rgb as reference. Once I had everything from cm-rgb implemented, I used Wireshark to sniff packets from the official Cooler Master application using a Windows 10 VM and USB passthrough. This amounted to changing a setting in the VM, finding the relevant packet in Wireshark, copying the bytes to a text editor, and then repeating until I could find a pattern. It was tedious, but effective, and I eventually got every setting implemented.

The most difficult part of this process had to be the mirage setting. Even after figuring out which bytes corresponded to each color channel (red, green, and blue), the bytes that were being sent didn’t make much sense in relation to the frequency that was entered by the user. It took me a few weeks of pondering and some help from others, but I eventually figured out that it was using a sort of bootleg decimal format with three bytes corresponding to a formula (first + 1) * third.second, which corresponded to a constant divided by the input frequency. After figuring out a formula, implementing the function to convert a frequency to the required bytes was relatively trivial.

Final Thoughts

I’d like to thank everyone who supported me in this endeavor. This has arguably been my most successful project to date, and it’s taught me a lot in the process of making it. I hope some of you will find it useful!