Skip to content

Commit 35b22b4

Browse files
authored
Merge pull request #1083 from zoltanvb/phys_id
Add input_phys_id (short version)
2 parents b4b0cf2 + aa92be3 commit 35b22b4

File tree

1 file changed

+51
-52
lines changed

1 file changed

+51
-52
lines changed

docs/guides/controller-autoconfiguration.md

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# Joypad Auto Configuration
22

3+
## Why is it needed?
4+
5+
RetroArch runs on many platforms. Each of these platforms has one or more input systems. These input systems in turn differ widely in the way they enumerate the pad buttons. For this reason, your joypad buttons may be mapped differently depending on if you are using Windows, Mac, or Linux.
6+
7+
8+
Traditional emulators allow you map each button of your pad to the original pad of the emulated system. For example, this is how the Snes9x joypad configuration interface looks:
9+
10+
![Snes9x joypad configuration](../image/retroarch/input/snes9x-joyconfig-example.jpg)
11+
12+
RetroArch also allows this kind of manual mapping. However, RetroArch tries to go further by detecting your joypad and automatically configuring it so manual configuration becomes obsolete.
13+
14+
## Benefits
15+
16+
With RetroArch joypad auto-configuration system, your joypad will be recognized and will work out of the box.
17+
18+
This allows:
19+
20+
- Use many different joypads and have them attributed to each players like it would work on a real game console.
21+
- Unplug the second joypad, and replace it by another one, even if it's of a different brand and model.
22+
23+
Having automatically configured joypads makes it a lot easier to navigate the RetroArch Menu with the joypad. This is very convenient when running RetroArch on a game console, where a keyboard and a mouse are not always available. It is also what makes RetroArch suitable to build your own game console using Lakka or a similar OS.
24+
25+
## Installing or updating joypad profiles
26+
27+
![downloading joypad profiles](../image/retroarch/input/update-joypads.jpg)
28+
29+
The set of joypad profiles used by RetroArch can be downloaded and updated from the menu. Go to `Main Menu` -> `Online Updater` -> `Update Controller Profiles` to get the latest version of the profile pack.
30+
31+
A message will appear at the bottom of the screen showing the download progress and the extraction of the archive.
32+
33+
## Generating a joypad profile
34+
35+
If your joypad is not recognized by RetroArch even after updating the profiles, you can generate a profile from the menu.
36+
37+
1. To avoid other controllers from interfering with your mapping when starting RetroArch, follow these steps: Disconnect all joypads by unplugging their cables or disconnecting them from any wireless connections.
38+
2. Connect the controller intended for autoconfiguration. Ensure your system supports the selected connectivity method. If your joypad supports both wired and wireless connections and the initial attempt (e.g., via USB) fails, try the alternative option (e.g., Bluetooth). For example, the Nintendo Switch Pro Controller does not support USB connection on Linux 5.15 and older but does support Bluetooth.
39+
3. For Android, run the [Android](#android) steps first.
40+
4. Use `Settings` -> `Input` -> `RetroPad Binds` -> `Port 1 Controls` -> `Set All Controls`. If automatic mapping fails for any button (e.g., due to lack of driver support), the process will be interrupted. In case of interruption, manually map the remaining buttons, starting from the one that caused the interruption and continuing through the rest of the list.
41+
5. Use `Settings` -> `Input` -> `RetroPad Binds` -> `Port 1 Controls` -> `Save Controller Profile`
42+
6. The new profile file (also known as the autoconfig file) will be saved to your disk: [Controller profile directory]/[Controller driver]/[Device index].cfg.
43+
7. Proceed with the manual configuration step section below.
44+
45+
346
## How does RetroArch match controllers?
447

548
When you connect a new controller to RetroArch, the system attempts to automatically configure it by matching it to known profiles. This matching process is crucial for ensuring that your controller works correctly with various games and emulators.
@@ -10,6 +53,14 @@ The matching algorithm considers several key factors:
1053
- **Device Index (input_device)**: The name of the controller as recognized by the system. The **Device Index** can be identified by navigating to **Settings -> Input -> RetroPad Binds -> Port 1 Controls**.
1154
- **Vendor ID (input_vendor_id)**: A unique identifier assigned to the controller's manufacturer.
1255
- **Product ID (input_product_id)**: A specific identifier for the particular controller model.
56+
- **Physical ID (input_phys_id)**: A manually generated identifier, only valid for one specific controller / USB port. Documentation [in github](https://github.com/libretro/RetroArch/pull/18190) for the time being.
57+
58+
### Matching process
59+
RetroArch compares these factors against the files in the autoconfig directorys. It calculates a matching score for each profile, selecting the one with the highest score to configure the controller.
60+
61+
The combination of Vendor ID and Product ID is often referred to as "vid:pid" in technical contexts.
62+
63+
This automated matching system allows RetroArch to support a vast array of controllers, reducing the need for manual setup in most situations.
1364

1465
## Autoconfig variable policy
1566

@@ -116,36 +167,6 @@ input_r_y_plus_axis = "+3"
116167
input_r_y_minus_axis = "-3"
117168
```
118169

119-
### Matching process
120-
RetroArch compares these factors against the files in the autoconfig directorys. It calculates a matching score for each profile, selecting the one with the highest score to configure the controller.
121-
122-
The combination of Vendor ID and Product ID is often referred to as "vid:pid" in technical contexts.
123-
124-
This automated matching system allows RetroArch to support a vast array of controllers, reducing the need for manual setup in most situations.
125-
126-
127-
## Why is it needed?
128-
129-
RetroArch works many platforms. Each of these platforms has one or more input systems. These input systems in turn differ widely in the way they enumerate the pad buttons. For this reason, your joypad buttons may be mapped differently depending on if you are using Windows, Mac, or Linux.
130-
131-
132-
Traditional emulators allow you map each button of your pad to the original pad of the emulated system. For example, this is how the Snes9x joypad configuration interface looks:
133-
134-
![Snes9x joypad configuration](../image/retroarch/input/snes9x-joyconfig-example.jpg)
135-
136-
RetroArch also allows this kind of manual mapping. However, RetroArch tries to go further by detecting your joypad and automatically configuring it so manual configuration becomes obsolete.
137-
138-
## Benefits
139-
140-
With RetroArch joypad auto-configuration system, your joypad will be recognized and will work out of the box.
141-
142-
This allows:
143-
144-
- Use many different joypads and have them attributed to each players like it would work on a real game console.
145-
- Unplug the second joypad, and replace it by another one, even if it's of a different brand and model.
146-
147-
Having automatically configured joypads makes it a lot easier to navigate the RetroArch Menu with the joypad. This is very convenient when running RetroArch on a game console, where a keyboard and a mouse are not always available. It is also what makes RetroArch suitable to build your own game console using Lakka or a similar OS.
148-
149170
## Before you begin
150171

151172
Make sure that you run the latest version of RetroArch, to generate a file name and file content via `Settings` -> `Input` -> `RetroPad Binds` -> `Port 1 Controls` -> `Save Controller Profile` that is up to date with our current policies.
@@ -257,26 +278,6 @@ Note: The actual path of the default directory is: /var/lib/flatpak/app/org.libr
257278

258279
By implementing these changes, you'll be able to create and save custom controller profiles without requiring root privileges.
259280

260-
## Installing or updating joypad profiles
261-
262-
![downloading joypad profiles](../image/retroarch/input/update-joypads.jpg)
263-
264-
The set of joypad profiles used by RetroArch can be downloaded and updated from the menu. Go to `Main Menu` -> `Online Updater` -> `Update Controller Profiles` to get the latest version of the profile pack.
265-
266-
A message will appear at the bottom of the screen showing the download progress and the extraction of the archive.
267-
268-
## Generating a joypad profile
269-
270-
If your joypad is not recognized by RetroArch even after updating the profiles, you can generate a profile from the menu.
271-
272-
1. To avoid other controllers from interfering with your mapping when starting RetroArch, follow these steps: Disconnect all joypads by unplugging their cables or disconnecting them from any wireless connections.
273-
2. Connect the controller intended for autoconfiguration. Ensure your system supports the selected connectivity method. If your joypad supports both wired and wireless connections and the initial attempt (e.g., via USB) fails, try the alternative option (e.g., Bluetooth). For example, the Nintendo Switch Pro Controller does not support USB connection on Linux 5.15 and older but does support Bluetooth.
274-
3. For Android, run the [Android](#android) steps first.
275-
4. Use `Settings` -> `Input` -> `RetroPad Binds` -> `Port 1 Controls` -> `Set All Controls`. If automatic mapping fails for any button (e.g., due to lack of driver support), the process will be interrupted. In case of interruption, manually map the remaining buttons, starting from the one that caused the interruption and continuing through the rest of the list.
276-
5. Use `Settings` -> `Input` -> `RetroPad Binds` -> `Port 1 Controls` -> `Save Controller Profile`
277-
6. The new profile file (also known as the autoconfig file) will be saved to your disk: [Controller profile directory]/[Controller driver]/[Device index].cfg.
278-
7. Proceed with the manual configuration step section below.
279-
280281
### Additional manual configuration steps
281282

282283
#### Add hotkey(s)
@@ -378,8 +379,6 @@ When modifying your autoconfig file for analog triggers, it's crucial to pay att
378379
Users often unintentionally incorporate analog variable values without properly adjusting the existing variable names to reflect their analog nature. This oversight frequently results in configuration problems within the system.
379380
By carefully updating both the variable names and values, you can ensure that your analog triggers are correctly configured for optimal performance.
380381
381-
###
382-
383382
### Inspect the file
384383
385384
Without modifying anything in the original file, open it in the file in a text editor and

0 commit comments

Comments
 (0)