Fix: Input page is saved only when input is changed #686
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "Master_PR"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is an attempt to decouple "saving gamepad settings" from the rest of the emulator settings. Should fix the issue where the gamepad was not detected when starting the emulator and the game (usually after saving settings with the gamepad turned off)
In fact, the gamepad is only saved when any setting is changed in the input page section.
Download the artifacts for this pull request:
Only for Developers
Hello, congratulations on the initiative and attempt, I just performed the test with the artifact from your contribution, but unfortunately it did not solve my case #577 the controls remain disabled after restarting the emulator.
I have two wireless gamepads, one has its own dongle, the second works via a proprietary Bluetooth dongle from 8 bit to
In the video it works like this
https://github.com/user-attachments/assets/7b3eb835-74ed-4d88-b719-011faa7218ef
In the original emulator, if you save the settings without a connected gamepad, the gamepad will be lost
@williansti Perhaps the problem is in the device itself, since I noticed that the emulator does not see all gamepads. The emulator also does not see some USB gamepads. I do not exclude that the problem is in the emulator driver, which for some reason incorrectly processes some devices
If possible, send a video of how you work with this pull request. I have one idea how to fix this, but it is not a fact
True, it will be more of a search and reconnection (hack) than a full driver fix, since I do not have devices with similar behavior as yours
@Goodfeat In summary from my topic #577 regarding this problem, Initially some thought it was a specific problem with xbox controllers, then people appeared with xbox controls who had no problems, two differences soon appeared, my controls were series x/s and were connected via bluetooth.
So when testing with a cable connected, we discovered that the settings are saved using the cable, but not when using bluetooth.
Another difference also appeared in the way controls are detected by Windows.
By Cable: Controller (Xbox One for Windows)
By Bluetooth: Xinput Bluetooth LE compatible input device
We could think that it was in fact a problem exclusive to the x/s series controllers and specifically connected via bluetooth, until several reports began to emerge from other people with the same problem, even with 8bit controls.
And this is a problem that occurs even in the latest version of the now defunct ryujinx, so it's a very old problem with SDL specifically in this emulator, this does not happen in any other.
Well, I'm going to redo the test following your advice and video, I'll be back soon to report the results, thank you for your attention and commitment.
@Goodfeat I performed the procedure as in the video, unfortunately it didn't work either.
@williansti I would like to see what actions you take to get the gamepad back (I mean the video), I need this at least to understand how to solve the problem. I don't have any devices that behave similarly to your problem. So I'll have to work blindly
you can post the video on discord
@Goodfeat Sorry, I haven't used discord for a while, until I found my login and password lol...
I used a website that does screen recording, see if this helps you in any way, note that after enabling the control, applying and clicking ok, everything will work perfectly, but after closing and opening the emulator again, everything is lost
If you need more details I can record again, if you need to access any configuration we can use anydesk.
https://github.com/user-attachments/assets/96db5f17-468c-4f4d-a6f9-4fe087035925
@williansti one moment, at the end of the video, you didn't open the list, is your device there?
if so, then I'll try to find a way to solve the problem
@Goodfeat Yes, it continues to work normally. I just left it displayed at the beginning of the video so you can see how the controller is identified via Bluetooth. As I reported in the discussion thread about the problem, this only occurs exclusively with Ryujinx, whether it is this new fork or the old one that has already been discontinued. This problem does not occur with Yabasunshiro, Flycast, Dolphin, Duckstation, PCSX2, RPCS3, XEMU, XENIA, Lime3DS, Citron, Sudachi, or any other, whether using SDL or Xinput.
Regardless of whether Ryujinx does not save my controllers, nothing is affected. I can open another emulator or game and use it normally.
See if this can clarify further
https://github.com/user-attachments/assets/3883a454-6549-433c-ae41-e8f4906398c0
I'll try to find a way to simulate this problem before I solve it.
@williansti I have a suspicion that your config file breaks after saving your gamepad block, please send Config.json
precisely after saving the gamepad
and after rebooting the emulator, although they may be identical
I am very confused by the fact that the controller is not initialized correctly when the system starts, judging by your video, something went wrong
In general, I was able to simulate your problem, but I have not found a solution yet, I only understood one thing, that the section with the controller settings is not saved in your configuration file. But why, that is another question
I tried to delete the controller section from my configuration file and got the same result
therefore, when saving, some undocumented error occurs
@Goodfeat Okay, I did some tests as you asked and here are the requested files that can help you with the investigation.
I configured it using Bluetooth with the 4 controls I have, they are all the same as Xbox Series X/S, and the problem occurs, even trying with only 1, 2 or 3 controls the problem also occurs.
Now, by configuring using a USB cable, the configuration is maintained and no problems occur.
Just reinforcing that on the USB cable the controller is detected as "Controller (Xbox One for Windows)" even though it is a Series X/S controller, and on the emulator's input screen, it also appears as "Controller Xbox One" somehow the emulator's SDL knows how to deal with this gui, id or driver in this way.
But when we go to bluetooth the control is detected as "Xinput Bluetooth LE compatible input device" as far as I could investigate this is a Microsoft thing, it was from some firmware of the controls that it started to be detected like this, I just suspect that the ryujinx SDL is not updated to deal with this, it is as if it were a generic xinput control, but the funny thing is that on the emulator input screen, it displays the correct name, Xbox Series X Controller.
I found these answers on google...
What can happen when connecting an Xbox controller via Bluetooth?
1 - The Xbox Series S controller may be recognized as “XINPUT LE-compatible input device” when connected via Bluetooth to a laptop.
2 - The Xbox Series controller may be registered as an HID-compatible XINPUT device in Windows 11.
3 - The Xbox Series controller connected via Bluetooth may not be detected as an Xbox controller, but only as a generic XInput controller.
And as other reports of the same problem with 8bit controls and others began to appear, then the problem is not just with Xbox controls, but with controls that use xinput in a generic way, as happens even with Microsoft originals.
standard not configured.json
Configured correctly with my 4 controllers, without closing the emulator.json
Configured with my 4 controls, after closing and opening the emulator.json
Configured 1 controller using cable, without closing the emulator.json
That 1 control configured using a cable, after closing and reopening the emulator, continues to work normally.json
@williansti I don't see anything suspicious in your files that would block the configuration loading.
Your problem needs a thorough analysis, and to fix it I need a device that will help to actually reproduce this problem. If I or one of the developers solves the problem, then a corresponding pull request will appear
This pull request is not related to your problem. This pull request only solves the problem of saving the gamepad settings when changing the configuration on the gamepad page. Please move further discussion to https://github.com/Ryubing/Ryujinx/issues/687
@Goodfeat Okay, at least we tried, thank you for your dedication, let's wait, one day this will be fixed, thank you for all the support.
@Goodfeat According to the author, @Averdrity this forces the emulator to load the controller profile and thus load the settings, but it is a feature for batocera, would this be a way to fix the problem in builds for windows?
I've solved the issue. In the emulator do create a new profile of your controller inputs. Save and apply.
Now.. in "ryujinxMainlineGenerator.py" at lines 433-652 I have replaced that code with this:
Cause everytime you start Ryujinx it will regenerate a config.json file with it's default settings. Meaning you'r input settings wont be saved next time you open it.
You cant edit the config file cause it will just rewrite it each time it opens.
So it will then take your profile you've created and use it each time now.
This works for me everytime. I use 2 controllers that is connected at all times.
You'r own created profile's name needs to be edited in this code. So where it says "PROFILENAME", write your profile name.
I dont know if this is the best solution for the issue but after Ryujinx users having had this issue for 2 years I think this is good for now.
This python code is written specifically for generating configuration files in batocer. your configuration file is fine, it's just that an unknown error occurs when loading the emulator. Roughly speaking, your gamepad is ignored during initialization. but when loading the settings, your devices are loaded
This topic does not concern this PR. Please, write specifically in the Issues section. At the moment, I am not dealing with this problem, since I do not have problematic gamepads
Pull request closed