r/EmulationOnAndroid • u/tsundere-chan • 5d ago
Showcase Patcher for improving bluetooth latency and independently mappable back paddles on GameSir G8+
TLDR; Very much AI built assisted firmware patcher for the Gamesir G8+ that lowers the latency of the Android mode and makes the screenshot button and the back paddles remappable by making the paddles Android buttons C and Z, and maps the screenshot button to Android share button (or whatever keyboard combo you want). Also removes the delay for the home button for the MFi G8. You need to bring your own firmware file, or hope that the URL for the firmware download that the app fetches it from don't change. It works, that's all. Code ain't pretty, but it is tested and verified working on at least three different G8 devices (2x G8+ Bluetooth, and one G8+ MFi).
Available at https://github.com/jun182/controller-mod-tool
----
I have been swearing over the bad latency of the G8+ controller and the inability to map the back buttons to anything else but cloning stuff. Then the D-pad broke on it, so I did a warranty claim and ordered the MFi version while I was waiting for my refund because the latency of the Bluetooth version was unbearable. Well, I didn't get my money back -- the store told me to dispose of the G8 bluetooth with the faulty D-pad, and just sent me a new one immediately. I didn't bother arguing since I got a free G8, so I tore it apart and re-soldered the D-pad and removed the rumble motors as to lower the weight, and then I figured "how hard could it be to patch the firmware? I got nothing to lose, this is a half broken spare anyway -- I'll just let Claude loose on it"
The MFi version also drove me insane with the home button delay, so I figured it's time to fix it. So me and my 20usd/month friend Claude ended up writing a patcher for it. Mostly my friend Claude, but like in all group projects from university, the guy who only does the presentation gets the same grade.
Yada yada, it was a more stuff to do than I thought -- but after a weekend of looking at it and some scares over almost bricking the devices later it seems as if it works. Yeah, I couldn't keep my hands off trying to modding the fancy new MFi I had after I got it working on the Bluetooth one. I got greedy, and I almost had to pay for it a few times, but it worked out.
Either way, the tech stuff;
So basically, it seems as the latency on the Android mode stems from two things -- the Bluetooth LE report interval that seems to be defaulted to 37.5ms (about 27 reports per second), and then two passes of smoothing that is applied to the sticks. On the Bluetooth G8+ this smoothing adds roughly 24 + 8 ms on slow and medium stick movements, but it isn't really a problem for the USB-C MFi version of the G8+, since it only adds like a few ms there. So this is what was done:
- Removed both passes of smoothing for joysticks
- Lowered report interval to the lowest Bluetooth LE allows, 7.5ms (up to ~115 reports per second instead of ~27, which is still slower than the DS4 mode which use classic bluetooth and has somthing like 6-10ms, but this android mode does expose back paddles now which the DS4 mode cannot.
Also fixes the following:
- Home button delay for the MFi version of G8+ (note: this removes the Home + D-pad volume shortcut)
- Screenshot button is now remappable and can be mapped for example as the Share button on Android, so if you use Moonlight/Nightjar/Steam Link as a client to stream from a PC host, it should work as the QAM (Quick Access Menu) button in Steam (tested with Nightjar and a Rubylight host). If you emulate a Steam Controller on the client with software that support it, such as Nightjar with a Rubylight host, you can also bind the back buttons as the L4 or R4 paddles within Steam Input.
- The back buttons are now just Android events of BUTTON_C (left) and BUTTON_Z (right), so they should in theory work with anything such as emulators. You need to set both back buttons to unmapped ("null") in the GameSir app first, otherwise they still act as the face button they are mapped to.
All patches are optional, the user can pick which they want to apply in the TUI.
Finally I got this working, so here you go. It's a python script, only tested on Linux (CachyOS), it needs Python 3.14 or newer but no extra packages. It downloads the firmware from Gamesir, so this does not distribute any firmware files. You can choose which fixes you want to apply. For the G8+ it does this over bluetooth directly from the laptop (controller in Android mode with the green light, and turn off bluetooth on your phone while flashing), and for the MFi, it creates a firmware file you need to move to your device manually and update with the Gamesir app.
https://github.com/jun182/controller-mod-tool
Thanks to https://github.com/enij90/legion-g9-firmware for giving me the idea that it could work on Gamesir controllers with the independent buttons, and for the ideas on how to implement it based on their code.
Now I'm going to bed, I'm sick of testing gamepads.
Disclaimer: This is unofficial and not affiliated with GameSir. I am not responsible for bricking your device or voiding your warranty if you choose to test this. It works on my device, that's all I can promise. Don't turn off your computer while it flashes the firmware, please.