Skip to content
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

Change joypad_autoconfig_dir to "~/.var/.../autoconfig" to make it compatible with Update Controller Profiles, and Save Controller Profile #295

Closed
davidhedlund opened this issue Jul 9, 2024 · 4 comments

Comments

@davidhedlund
Copy link

davidhedlund commented Jul 9, 2024

The accessibility and updateability of controller profiles without the need for elevated permissions significantly enhances both the functionality and user experience of the RetroArch Flatpak package. By removing this step, the system becomes more convenient and user-friendly, allowing for smoother controller configuration and a more seamless gaming experience overall.

Describe the problem

In the default RetroArch configuration file (retroarch.cfg), the joypad autoconfig directory is set to "/app/share/libretro/autoconfig". This path is actually located in the root directory at "/var/lib/flatpak/app/org.libretro.RetroArch/current/active/files/share/libretro/autoconfig". Due to this setting, RetroArch is unable to extract files to this directory.

Update Controller Profiles

When attempting to update controller profiles through the menu path: Main Menu -> Online Updater -> Update Controller Profiles, the operation fails, as shown in the provided image:

image

Save Controller Profile

  • Change "Settings -> Drivers -> Controller" to "linuxraw".

"Settings -> Inpute -> RetroPad Binds -> Port 1 Controls":

  • Change a button with the controller (required for "Save Controller Profile" to work).
  • Click on "Save Controller Profile".
  • "Error saving controller profile."

image

Manual solution

I just added this section in our Joypad Auto Configuration guide: https://docs.libretro.com/guides/controller-autoconfiguration/#flatpak-configuration

After making this change, the update process should complete successfully, as demonstrated in the sections below:

Update Controller Profiles

image

Screenshot at 2024-07-09 02-48-13

Save Controller Profile

image

Development solution

This improvement streamlines the process for users, eliminating the need to follow this step (https://docs.libretro.com/guides/controller-autoconfiguration/#flatpak-configuration) in order to generate autoconfig files for Flatpak users.

Update configuration file

Modify the retroarch.cfg file to replace the default joypad autoconfig directory path with a user-accessible location:

joypad_autoconfig_dir = "/app/share/libretro/autoconfig"

Proposed setting:

joypad_autoconfig_dir = "~/.var/app/org.libretro.RetroArch/config/retroarch/autoconfig"

Autoconfig file migration

To ensure independence of the Update Controller Profiles option for the controllers to work by default, I suggest one of the following solutions:

  • System File Utilization: Automatically copying the system autoconfig files from /app/share/libretro/autoconfig/ to the newly designated user directory ~/.var/app/org.libretro.RetroArch/config/retroarch/autoconfig directory
  • Pre-packaged Autoconfig Files: Ship the Flatpak package with a curated set of autoconfig files. During installation or first run, these pre-packaged files would be copied to: ~/.var/app/org.libretro.RetroArch/config/retroarch/autoconfig

The first option leverages existing system files, while the second allows for a more controlled initial set of profiles. Both methods ensure users have access to basic controller profiles without requiring manual updates.

@davidhedlund davidhedlund changed the title Update Controller Profiles fail due to default root directory permissions Change joypad_autoconfig_dir to "~/.var/.../autoconfig" to make it compatible with Update Controller Profiles Jul 9, 2024
@xordspar0
Copy link

Good summary of the problem.

Automatically copying the system autoconfig files from /app/share/libretro/autoconfig/ to the newly designated user directory ~/.var/app/org.libretro.RetroArch/config/retroarch/autoconfig directory

As discussed in #256, the problem with copying to a user-writable directory is that we lose the ability to keep the bindings that Retroarch ships with up to date. The problem would shift from "I need to change the path to be able to edit" to "I need to delete bindings if I want to update them".

Retroarch likes to solve this problem by dumping all files into the user's config directory, and updating anything is a manual process. Personally I would like it better to keep things separate and have a way of overriding defaults with user config (sort of in the style of physfs), but I don't know if that will catch on.

@davidhedlund davidhedlund changed the title Change joypad_autoconfig_dir to "~/.var/.../autoconfig" to make it compatible with Update Controller Profiles Change joypad_autoconfig_dir to "~/.var/.../autoconfig" to make it compatible with Update Controller Profiles and Save Controller Profile Aug 1, 2024
@davidhedlund davidhedlund changed the title Change joypad_autoconfig_dir to "~/.var/.../autoconfig" to make it compatible with Update Controller Profiles and Save Controller Profile Change joypad_autoconfig_dir to "~/.var/.../autoconfig" to make it compatible with Update Controller Profiles, and Save Controller Profile Aug 1, 2024
@RobLoach
Copy link
Collaborator

The autoconfigs are shipped with the Flatpak, so I would prefer to disable those online updater options if possible.

As xordspar0 mentioned, it would be awesome to be able to have a merged file system to allow custom additions, similar to how Lakka accomplishes it, but I'm not 100% sure that's an option for Flatpak. Easiest way for you to maintain them yourself is to change the directory to your own home folder directory.

@RobLoach
Copy link
Collaborator

RobLoach commented Nov 5, 2024

Going to close this. RetorArch ships with the autoconfig files. If you want to change the autoconfig directory on your system to manage it yourself, then feel free to do that in your configs.

@RobLoach RobLoach closed this as completed Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants