-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Refuses to load the last used profiles (Windows 11 only) #632
Comments
Could you again collect some logs? https://github.com/AntiMicroX/antimicrox/wiki/Collecting-Logs Can you load config manually? It seems to be a duplicate or at least something similar to: #618 |
Log attached, yes i can manually load profiles fine. |
Yes that setting is certainly ticked |
Could you upload your AntiMicroX settings file?
|
Of course, here we go... |
Asking about updated doesn't generate any updates. @davek00997744 |
Of course, will try it tomorrow. |
Settings file deleted, makes no difference - the new file is created but refuses to re-load when started up again. |
I could not reproduce this problem on Windows 10. Maybe this is specific windows 11 thing... 🤔 |
I will try my xbox game controller tomorrow |
I observe the same issue. Current Behavior Expected Behavior Steps To Reproduce Environment OS:Windows 11 22H2 |
Same issue for me as well, also on Windows 11, will give it a shot on Windows 10 tomorrow to see if I can reproduce there. or not. |
Ah yes, the famous "8 days later" tomorrow. I swear as soon as I can get my brain upgraded to not this fallible squishy one. Sorry @pktiuk! Anyways! My test device is a third party controller that presents as an Xbox One S controller. I am glad to report that I'm unable to reproduce the issue on my Windows 10 machine (22H2; 19045.2251). I've tested using both the installer and portable versions of 3.3.2, and both properly load the previous profile as expected. I'm using a similar setup for where I've stored my profiles (in a OneDrive folder with the contents locally hydrated,) and have check to ensure that the settings I have are uniform across where I've tested. The differences between my Windows 11 machine and this one, is that there's only a single controller being enumerated. My windows 11 machine typically has a few more: Two presented by Razer keyboards as part of their IO suite: "(Razer Xbox 360 Controller)", "Joystick (Razer Huntsman V2 Analog)", two presented by 3Dconnexion's IO suite: "Spacemouse Compact", "3Dconnexion KMJ Emulator", and one presented by this adapter, "GC KB+JS to USB v3.6". Let me know how else I can help! |
Thanks for your feedback. |
Is there anything more I can do?? |
For now not. (Unless you are a C++ developer ;) ) |
same here (same Bug on Windows 11, not a C++ dev) |
The latest Antimicro release does not have this problem (Win 11).
|
I'm a C++ dev, I'll see if I can find some time this weekend to step through and see if I can find where it falls apart under w11. @pktiuk — Any chance you could point me to around where the last used profile tries to load? (If not no big deal I'm sure I'll find it!) |
@nitz There are some entries in This region seems promising void JoyTabWidget::loadSettings(bool forceRefresh)
{
////
QString controlEntryLastSelected = QString("Controller%1LastSelected").arg(m_joystick->getStringIdentifier());
QString controlEntryProfileName = QString("Controller%1ProfileName%2").arg(m_joystick->getStringIdentifier());
///
if (!m_joystick->getStringIdentifier().isEmpty() && autoOpenLastProfile)
{
lastfile = m_settings->value(controlEntryLastSelected, "").toString();
} |
Alright, I've got it building and am reproducing the issue, which has allowed me to narrow it down a bit further:
I'm going to step through An aside, when building with mingw64, gcc liked to spew over and over again that The investigation continues! |
This is enough of a fix to resolve the issue in AntiMicroX#632, but there are a few other edge cases that investigation brought up that may cause a similar issue in the future.
Alright, so here's what I've found. I've managed to reproduce the issue with one controller, and have it not reproduce with another. The symptom of the issue seems to be coming from It reads: void JoyTabWidget::convToUniqueIDControllerGroupSett(QSettings *sett, QString guidControllerSett,
QString uniqueControllerSett)
{
if (sett->contains(guidControllerSett))
{
sett->setValue(uniqueControllerSett, sett->value(guidControllerSett));
sett->remove(guidControllerSett);
}
} When this gets called with the controller that doesn't produce the behavior, the values of the strings are:
Notice the extra Now, when I proceed to my next controller, the one that does produce the issue, the values of the strings are:
The hoisted When Now, to look at the cause rather than just the symptom. The generation of the unique ID vs the guid seem to be different enough: The unique ID includes the guid, so one would assume that the unique ID is more specific than just SDL's guid on it's own. //// snip
QString GameController::getRawGUIDString() const
{
QString temp = QString();
if (controller != nullptr)
{
SDL_Joystick *joyhandle = SDL_GameControllerGetJoystick(controller);
if (joyhandle != nullptr)
{
SDL_JoystickGUID tempGUID = SDL_JoystickGetGUID(joyhandle);
char guidString[65] = {'0'};
SDL_JoystickGetGUIDString(tempGUID, guidString, sizeof(guidString));
temp = QString(guidString);
}
}
return temp;
}
//// snip
QString GameController::getRawUniqueIDString() const
{
return (getRawGUIDString() + getRawVendorString() + getRawProductIDString() + getSerialString());
}
//// snip But this is where the real rub seems to come from. I broke out the calls in So here's my first controller (Happens to be an emulated Xbox 360 controller presented by a razer keyboard driver): And sure enough, between the VID and PID showing up as zeroes, we've discovered where the delta between our unique ID and guid has come from. Now, on to my second controller. Uh oh, it doesn't hit Giving it the same treatment as the GameController flavor: And we have a bingo. No strings of On my machine at least, Either way, we've got a I've submitted a small PR (#665) that does that, which does resolve the issue on my end, but I'm unsure of the implications surrounding the required SDL version. Though it does seem I also don't know if you wanted to make changes to the profile loading logic, with the bit I caught about how it can potentially delete a setting if the unique ID and guid happen to match. I figured I'd leave that one out of the PR in case you had more thoughts on how you might like to approach it. I hope you enjoyed my sleuthing and rambling, was a fun thing to track down! P.S.: If you'd like, I can also send a PR for the small cmake (and some msvs specific warnings-as-errors) changes I had to make to build and debug through visual studio, just let me know! Cheers |
@nitz
Don't worry, we require at least 2.0.6 to compile (according to cmake).
Feel free to contribute in any way you wish :) |
This is enough of a fix to resolve the issue in AntiMicroX#632, but there are a few other edge cases that investigation brought up that may cause a similar issue in the future.
This is enough of a fix to resolve the issue in #632, but there are a few other edge cases that investigation brought up that may cause a similar issue in the future.
Does this mean it is fixed? Its all a bit confusing to me :) |
Yes, it will be included in the next release |
Is there an existing issue for this?
Current Behavior
Upon restarting the app, it loads with profile shown and not the previous used ones for each joystick device
Expected Behavior
I would expect "Load last used profile" to actually load the last used profiles upon restart
Steps To Reproduce
Load app, set profiles up & save, close app, re-load app - profiles are not loaded
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: