user defined vs downloaded controller autoprofile
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.1k
- Forks
- 2.2k
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 51
Description
Description
When a controller profile is saved in Setting > Input > Port Control page, the file is named according to the vendor name and device name. For my controller, that is "NVIDIA Corporation NVIDIA Controller v01.04.cfg" which overwrite the original file from the downloaded database, However, I assume that this is not always the case because most the downloaded files do not follow that naming scheme.
To make things worse, the files are loaded is a non-deterministic way. I am not sure for the other systems but on Linux, the directory listings are sorted neither alphabetical nor by date. What you get is the order on filesystem (it can't observed on the command line with ls -U) .
In practice, that means that saving a controller profile can result in one of the following behaviors:
- The controller was not in the downloaded database. The new file is the only one that matches. Everything probably works as expected.
- The controller was in the downloaded database using the same filename. Everything works as expected until the database is updated which overwrites the saved configuration.
- The controller was in the downloaded database using a different filename. There are now 2 matching files. It may work or not depending of the actual order of the files on the filesystem.
Expected behavior
I expect that
- the saved controller profiles should not be overwritten when the database is updated
- the saved controller profiles should have precedence over the database files.
- the configuration files should be loaded in a deterministic order.
Proposed solution
Ideally, the saved profiles should be stored in a different directory than the downloaded profiles.
Another simple solution is to sort the files alphanumerically before loading them. This is a common practice in a lot of Linux distributions where configuration files are often prefixed with 2 digits and a '-' to insure a consistent order (e.g. 42-xxxx.cfg). The profiles saved by retroarch could be given the prefix '50-', the database could use the prefix '70-' and users could use a low prefix such as 10- for their hand written files. The old database files without a proper prefix would not need to be removed since they would have a very low priority.
Version/Commit
- RetroArch: Git e62abac , Build Oct 15 2022
Environment information
- OS: Linux
- Compiler:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue identifies the Setting > Input > Port Control page and the downloaded controller-profile directories, but names no source files or tests. Start by locating the code that saves profiles and enumerates them, then verify overwrite behavior, precedence, and ordering on Linux. Done means user-saved profiles survive database updates, take precedence over downloaded profiles, and load deterministically.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100