Forking swarm2linux: profiles, voice commands and battery estimates for the Stealth Pro II
A missing USB ID led me to fork a Linux app for the Turtle Beach Stealth Pro II. Five days later it had profiles, an audit, themes, a self-diagnostic, offline voice commands and a battery-time estimator, plus a few things I learned about the headset along the way.
My headset is a Turtle Beach Stealth Pro II. On Windows it’s configured
with Turtle Beach’s Swarm II app. On Linux there’s
swarm2linux by
tbt9czsdd4-droid: a daemon (stealthd), a desktop app, a terminal app and a
CLI that talk to the headset through its USB transmitter.
It worked, with one catch. This post is about that catch, and about everything that piled up in my fork over the next five days.
The Device page in my fork, with profiles, the selected profile in the header and the new About credits.
A missing USB ID
My copy of swarm2linux was a build that had been set up on my PC from a zip, so I compared it against GitHub. Every source file matched, except for two small additions:
# 10f5:2288 Stealth Pro II transmitter
KERNEL=="hidraw*", ATTRS{idVendor}=="10f5", ATTRS{idProduct}=="2288", TAG+="uaccess"
plus a matching row in the README’s device table.
My transmitter reports as 10f5:2288. The code already recognised that ID,
and the protocol notes described it, but the udev rule that lets a logged-in
user open the device without root only listed the other IDs. On a fresh
install, anyone with this transmitter couldn’t use the app without adding the
rule by hand.
I forked the project, committed those three lines and opened a pull request upstream. It’s still open at the time of writing.
Profiles
The program already covered almost every setting Swarm II knows about: EQ and presets, noise cancellation, Superhuman Hearing, the microphone, button and wheel mapping, auto-off, the charging hub LEDs. What it lacked was a way to switch between whole setups, like “Gaming”, “Calls” or “Music”.
Profiles live in stealthd, since the daemon already owns the headset. Each
one is a readable TOML file in ~/.config/swarm2linux/profiles/, so you can
edit or copy them by hand. A profile holds noise cancellation, Superhuman
Hearing, the mic settings, both EQs and the button functions. Applying it
writes only the settings that differ, using the same writes the app already
makes. Every client gets them: the desktop app, its tray menu, the terminal app
and stealthctl profile.
My first version marked a profile as active only when the headset matched it exactly. In practice that felt broken. Switching seemed to do nothing, because my two profiles were nearly identical, and nudging an EQ band “kicked me off” the profile. So I redesigned it:
- The selected profile stays selected, including after a restart.
- Edits mark it as modified, shown as “Bass · modified” in the header, on the Device page and in the tray, with Save and Revert buttons.
- The EQ preset is part of the profile, so presets and profiles stop overlapping.
Auditing AI-written code
The upstream README opened with a blunt warning: the project was 100% AI-generated, nobody had reviewed it, and the headset protocol was reverse-engineered by the same AI. That’s honest, and it’s also exactly the kind of thing you should take seriously before running a daemon that writes to your hardware. My fork’s own changes were written with AI help too, so reviewing it was the least I could do.
The audit was split into three read-only reviews: install and packaging, the HID protocol and device writes, and the daemon, D-Bus and apps. Each finding was then checked against the code before anything was fixed.
The reassuring part:
- No network access or telemetry. Apart from the installer’s optional rustup download, nothing contacts the internet.
- Every headset write goes through an allow-list of the settings and value ranges the official app was seen sending, and the firmware-update and storage commands are blocked outright.
- The only two
unsafeblocks are correct.
It still found real bugs, including some in my brand-new profile code:
- Two apps saving or applying profiles at the same moment could corrupt a profile file.
stealthctl eq band 2 NaN, or a huge number, quietly wrote 0 dB or a wrong value, and out-of-range numbers sent over D-Bus could wrap around into valid ones.- With no Stealth Pro II connected, the daemon could open another Turtle Beach device and write to it.
- A device that never stopped sending, a hung PipeWire or a slow notification
service could each freeze
stealthd. - The installer ran
apt-get updateon a Fedora system that happened to haveapt-get, and the service restarted a crashing daemon forever.
All of those are fixed. I also rewrote the README warning into something calmer that’s still accurate: the code is AI-written, the protocol was reverse-engineered, it only sends writes the official app was seen making, it has had an AI-assisted audit and testing on real hardware, and it hasn’t had a line-by-line human review.
A license detail: the Slint badge
The desktop app is built with Slint, and the About section
carried a big “Made with Slint” sticker. I wanted it smaller. Slint’s
royalty-free license requires attribution, either through its AboutSlint
widget in an About screen or a badge on a public web page. I kept the widget,
just at about half the size and beside the text, so the credit stays inside the
app wherever a copy ends up.
Themes
The desktop app’s colours lived in one theme file, apart from about 20 that were hard-coded elsewhere. After moving those into the theme, it now offers the same 22 palettes as mergewell, my Git client: Catppuccin, Dracula, Nord, Solarized, Gruvbox, Tokyo Night, Kanagawa and more. There’s also the original look as the default and a “Follow system” option. A test checks that text and accents stay readable on every theme, and light themes needed outlined slider knobs so they don’t vanish against white cards.
The Equalizer page.
A self-diagnostic
stealthctl doctor (and a Diagnostics card in the app) checks everything
between you and the headset: the device is plugged in and known, the udev rule
covers your ID, stealthd is installed, running and up to date, the headset
link is up, PipeWire has an output, and your settings files load. Each check
says pass, warn or fail, with a fix. It runs before trying to reach the
daemon, so it works even when nothing else does, and the copyable report strips
addresses and serial numbers so it’s safe to paste into a bug report.
On its first run it caught something real on my machine: the running daemon was an older build than the one installed.
Pop-ups for the wheel
The headset has a second, assignable wheel. Mine controls mic monitoring, and I
wanted the same on-screen bar KDE Plasma shows for volume. stealthd already
sees the headset report the new level whenever the wheel turns, and Plasma’s
OSD has a mediaPlayerVolumeChanged(percent, name, icon) call that draws
exactly that bar. Changes made from the app itself don’t pop up, turning the
wheel quickly updates one pop-up instead of stacking them, and other desktops
get a short notification instead.
Editable EQ presets
You could save custom EQ presets, but never change one: you had to make a new preset every time. The headset simply has no “edit preset” command, only save and delete. So “Update” deletes the preset and saves the current curve under the same name. Two side effects: the headset saves into the first empty slot, so an updated preset can move up the list, and if the save fails after the delete, the curve stays on the headset as unsaved bands.
Voice commands
The most fun experiment: say “Stealth, skip this song” or “Stealth, pause this video”.
- Recognition is offline, with whisper.cpp
in a separate
stealth-voiceprogram thatstealthdstarts and stops with a toggle. Nothing leaves the computer, and its 57 MB model is checked against a pinned checksum. - Media control uses MPRIS, so it works with Spotify, VLC and browser video. It can also change the volume, toggle noise cancellation and, later, answer “Stealth, how much battery?” with a pop-up.
Getting it to actually work took some debugging:
- It heard only silence. It recorded from the system’s default input, which had switched to the headset’s mic, and that mic’s sensitivity was at 0. I use my laptop’s mic, so the fix was a microphone picker just for voice commands.
- The laptop mic is loud even in silence. Its gain was set to +30 dB plus a +30 dB boost, so even a quiet room clipped. Speech detection had to get less strict.
- “Stealth” became “Third”. whisper always encodes a 30-second window (an 11-second clip took 1.7 s), so I shrank its audio context to make short commands fast, down to about 0.2 s for a 3-second command. But that also made short clips less accurate. A context of 768 was the smallest that got my recordings right, at about 0.6 s per command. On top of that, “Third” and “Steal” now count as the wake word, but only as the first word, so “play the third song” doesn’t trigger anything.
There was also a classic bug: an earlier fix to the pw-record arguments had
been chained after a command that failed, so it never applied.
Battery time estimates
The headset reports battery only as a whole percentage, nothing about time. So
stealthd times each percentage step and works out drain and charge rates from
the last few hours. It shows something like “82%, about 9 h 30 min left” or
“64%, charging, full in about 1 h 10 min”, saves its measurement so restarts don’t throw it
away, and remembers your typical rates so later estimates appear as soon as the
headset connects. On top of that:
- Warnings by time left: pop-ups at about 30 and 10 minutes left, or at 15% and 5% if that comes first, because 15% lasts very differently with noise cancellation on or off.
- An option to show clock time, like “lasts until about 23:40”.
The first real test was badly wrong: “about 25 minutes left” at 29%. The cause turned out to be the percentage itself. While charging it climbed from 26% to 45% in about 20 minutes, far faster than the headset really charges. After unplugging it fell straight back to about 30% within 8 minutes, then settled into normal drain. My best explanation, still unconfirmed, is that the headset derives the percentage from the battery’s voltage, which a charger pushes up and which relaxes over 10–15 minutes after unplugging. The estimator counted that settling as drain. The estimator now ignores drops that come too fast and rejects rates no real battery could have.
Is there a battery-health value?
I also wanted to show whether the inserted battery still has full capacity. The
headset reports one unexplained value, key 260, which reads 100 on mine. A
project for the Stealth 700 Gen 3 shows the same key at 86 while that headset’s
built-in battery is full, and another Linux tool reads the spare battery’s level
from a different record. That makes “battery health” plausible, but it’s still a
guess, so it’s documented as [guess] in the protocol notes and not shown in
the app. A worn battery would settle it.
Where it stands
Compared with upstream, the fork adds the 10f5:2288 transmitter, profiles,
the audit fixes, themes, the self-diagnostic, wheel pop-ups, editable presets,
voice commands and battery estimates. The README also got compacted from 567 to
84 lines, with the details split into pages under docs/. The original author
keeps full credit in the README, both apps’ About sections and the service file.
Everything is in curxxed-mc/swarm2linux.
If you have a Stealth Pro II and a transmitter that isn’t recognised, start with
stealthctl doctor.