-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wireshark capture data for GX502 #33
Comments
Using a print statement to print the USB cfg in the python prototype I get this:
|
Extra data. As it turns out rogauracore works fine with this laptop (except for multi modes). I did reinstall Pop!_OS, but unsure what changed. Kernel is |
Did a cold reboot and now it doesn't work. Unsure what changed. On the flipside the keyboard now retains the last used setting... I'm going to reboot to Windows, change a setting, then reboot to Linux and try again. Might be an initialization thing as the sudden working in Linux was after I cycled through settings with wireshark. Not really sure how to capture the startup sequence - I'll try uninstall AmoryCrate and reinstall with wireshark going. |
I can confirm that Windows does initialise the LED controller, and after booting to Windows and opening ArmouryCrate it allows I disabled as much as possible on the USB bus the LED controller seems to be on, then opened Armoury (simply opening it did nothing), then switched to the Aura tab which then caused some traffic. Output from rogauracore is the same in both working and non-working:
|
Apologies; only just saw this thread. Thanks for the dumps! Your symptoms are weird. Let me clarify two things...
If those statements are accurate, then it sounds as though there's some wake-up message we're missing. Unfortunately, if we are missing a wake-up message, you haven't captured it. The messages sent when you switch to the Aura tab are just If it's helpful, these are some messages that play on my machine when ArmouryCrate is first installed:
If you're desperate, you can give those a shot. I like to just play them manually where Will is playing the SET/APPLY messages. Another theory is that asus-wmi is saying something stupid when it starts up. If I send garbage to my keyboard, it will start ignoring me, too. However, on my machine, this renders the keyboard completely inoperable. That said, other users have reported that various facets of their machines will become unresponsive when using rogauracore. In fact, on Will's machine, his aura brightness keys become inoperable after issuing any commands from rogauracore. Perhaps the opposite is true on your machine, and asus-wmi sets your keyboard in some BIOS compatibility mode. Even then, you may be able to reset your keyboard using the correct messages. Here's what I can see from your Wireshark dumps:
Sorry, that's a lot of information. If you have some free time, please read over that a couple of times, and you'll see there's a lot you can try. If none of that works, my recommended next step is to boot Windows, uninstall ArmouryCrate, reboot, start the ArmouryCrate install process, and then start Wireshark right before pressing "install." When the keyboard lights up, that payload will likely have anything we're missing to reset your keyboard in it. |
Actually, perhaps this is entirely a function of whether asus-wmi is installed. Is it listed under |
Very sorry about slow response. Been extremely busy with work.
I haven't had a chance to try your other suggestions. But I do know asus_wmi has no effect. I did uninstall then reinstall Crate. There appeared to be another driver somewhere enabling control, but I think this only enabled the secondary keys controller so that the aura effects cycled through the stock firmware ones. Hell, this sort of rubbish pisses me off a bit when it comes to Linux and gaming laptops. Damned good laptop, but boy howdy don't you dare use another OS 🙄 |
Finally had more time to pursue this. It looks like for the GX502GW:
Is the solve here. Somehow I missed this before. Putting the machine to sleep then waking resets all but the brightness. Edit: grumble turns out I must have booted windows first. |
Looks like this actually works, just after claiming the interface I put:
To send the:
Thanks for the help here! |
@flukejones @JoshDreamland amazing work guys. Do you think there is a PR in here? These init messages might fix issues for other people with similar hardware, I suppose. |
@wroberts C isn't my strong suit (I'm pretty much exclusively using Rust for systems work these days) and I've barely got time. It seems that we would be well off to create a wiki page or similar with more in-depth details for each laptop model such as;
that sort of thing. I've been considering rewriting this in Rust (yeah I know, it's a crappy trope now) with the goal of running as a daemon to enable coms over a socket, and so enable plain users to set lighting without sudo. You might want to do this with the existing code? |
I can certainly put them in a PR, just like that, but I'm not sure the best angle to go about it. Do we want a new I'm skeptical of putting them in by default (eg, at startup) until we answer a couple questions:
Also, to clarify, the extra APPLY call does not matter on your machine, Luke? |
I just did a few cold-boots to test things properly.
Looks like the controller on this machine ignores any excess calls. It also seems to retain the last colour mode but not brightness. |
Interesting... my machine also doesn't care when I send that message. Could be safe. It is the first meaningful message ArmouryCrate sends, so if that's all it takes, maybe we could always send it. Or, out of an abundance of caution, maybe we should instead create To clarify, my best guess is that the first message stands alone, the next two are step one of a handshake, and the next two are step two. I am grasping at straws, there, though. |
It's a strange thing to send though. It definitely doesn't make any difference to my laptop if those messages are sent at all, only seems to require the first one.
with a small change to the first byte to Another note: regarding doing something like a daemon using systemd, I guess here an extra CLI option for |
It seems that perhaps the controller for LED retains a small charge that isn't dissipated unless the laptop is off for longer than 10 seconds. It turns out I require that full set of messages after all. |
Hm. Perhaps the first message is WAKE and the next two pairs control version modes. I am also wondering if your machine doesn't have a third pair of messages. Guess it doesn't really matter, as we wouldn't be able to use them. I suspect they'd be for enabling per-key lighting messages. But you do need all five, not just the first three? |
Just tested properly. I need only the first 3 messages. But also sending all 5 doesn't hurt anything either. Multi-LED effects don't work, so I'll definitely try to capture that initialization stuff now. |
Finally got decent capture of startup from installing the Armoury Crate - turns out whenever I uninstalled it, it wasn't cleaning up after itself and left some services behind. Looks like it sends only:
and those are sent multiple times. Unsure if the sequence shown matters though, or the count.
And yeah, it does continuously send commands to the controller to make effects like rainbow work. But I'm also certain that there are some built-in modes that don't need that, and I'm certain rainbow was one. EDIT: Cleaned up some misunderstandings. Also can confirm that a rainbow mode does work without continuous input, but the mode given by the |
The rainbow mode in #26 may work for you, Luke. I'm seeing more and more reports that this WAKE/INIT message is the fix for people, so we should probably push it out in some form or another. Thinking we should just include all of the above as separate commands, and also change the rainbow commands to rainbow1 and rainbow2, and just let people figure out what works for them. |
I decided to dive in and have a real good tinker with things - ended up writing my own tool in Rust (I don't know C). You might find it interesting [link]. I mapped out all the bytes for the built-in LED modes, and that data is in the comments. I'm now in the process of implementing a daemon mode to catch the hotkeys and use them for aura control + other missing functions. |
@JoshDreamland, @wroberts I think the wake up/init function should be a separate function because looking at the hid-asus.c of the kernel it initialize the keyboard just with (link to kernel source) :
If the keyboard id is in their list of supported devices (link to kernel source), so if the id is being handled already by the hid-asus driver there's no need to call the wake/init because it is "supposedly" initialized, and if not it should be explicitly called in rogauracore. I made a test in this branch and it works with a GA502DU laptop. |
I think the messages required to initialize the keyboard for typing are distinct from those to initialize it for pretty colors. I've noticed that lighting functionality has slowly trickled its way into the kernel code, but I don't expect them to want to support all this RGB hoo-hah. It's possible we could get them to add the init and brightness messages, though. I just don't want to go open that can of worms; no time for it, personally. |
@qquique I tried your branch for testing for the GA502DU and it doesn't seem to want to work. What distro are you using it on. I am currently on manjaro and tried it with kernel 5.7 and it didn't work. I have a patch applied to 5.4 and 5.6 that enables the function keys to adjust brightness like in windows. I am looking for an easier approach rather than patching and compiling a kernel every 1-2 weeks. I am going to install kernel 5.5 and try that seeing as how it isnt a rc kernel. |
Using arch, the branch is confirmed to work by two other people using ubuntu 1, 2, fn keys plus brightness only works with this patch idk if is the same that you have. pd: pr sent |
I guess I missed the part about downloading the other package, will try it now and report back. Can confirm this does in fact work. Currently running pop 20.04 with xanmod 5.6.10. |
Here is the capture data from wireshark for this model laptop. I wish I had extra time to help with this, but I think someone who already knows how most of this works would be in a better position to do the work than me. Most of it seems to be I/O from 2.4.*, eg
usb.dst matches "2.4."
gx502-other-kb-functions.zip
gx502-rgb-wireshark.zip
The text was updated successfully, but these errors were encountered: