Two joysticks of the same model can't be used together
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- cpp, json, linux
- Área
- desktop-dev, game-dev
Línea de trabajo
Start by tracing joystickMatchesGuid through joystick-slot assignment and the saved joystick settings, including the legacy Joy0GUID values and the JSON id field. Reproduce with two SDL joysticks sharing a GUID, then inspect device enumeration and available identity data such as SDL_GetJoystickPath or serial numbers. Done means each slot selects a distinct matching device in SDL order, with compatible fallback to the saved GUID; confirm the options UI no longer reports None and both sticks control their assigned roles.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
If you have two joysticks of the same model plugged in, like a pair of identical sticks for a dual-stick setup, the game won't use either of them. At startup neither stick gets a control slot, the Joystick setting in the options shows "None", and the ship doesn't respond to either stick.
SDL gives both sticks the same GUID, since it's built from the bus, vendor, product, version and name, with no serial number. When the saved setting matches more than one connected stick, joystickMatchesGuid refuses to pick one, so nothing gets bound. The old launcher settings (Joy0GUID and friends) hit the same check.
Steps to reproduce
- Plug in two joysticks of the same model.
- Start FSO (master, in-game options on) and pick one of them as the Joystick in the in-game options.
- Quit and start the game again with both sticks still plugged in.
- Start a mission and move either stick.
I reproduced this on Linux with two virtual sticks that share a name, vendor and product, and the setting already saved for one of them (master at 12a36dc1a, retail data, SM1-01). The log shows "No joystick is being used." With only one of them plugged in, the same saved setting works.
Expected vs. actual behavior
Expected: the stick you picked steers the ship, and with a dual-stick setup each slot gets one of the two sticks.
Actual: neither stick is bound, the setting shows "None", and the ship ignores both sticks.
Proposed fixes
Ranked by simplicity, then maintainability, then thoroughness.
- When several connected sticks share the saved GUID, give each slot the first matching stick that isn't already in another slot, in SDL's device order. Small change, no settings format change, and a dual-stick setup works. The catch: the two sticks can swap sides if the OS enumerates them in a different order.
- Save something that tells identical sticks apart alongside the GUID, such as the device path from
SDL_GetJoystickPathor the serial number where the device reports one. The saved JSON already has anidfield that's currently always -1. Use it only to break ties, falling back to the GUID alone, so existing settings keep working. - Move to full per-device identity (name plus GUID plus path or serial) for all saved joystick settings, as discussed in #7481. Most thorough, but it means a settings format change and agreeing on how to migrate old configs.
Related: #813 (SDL GUIDs aren't unique, closed), #7481.
- Lenguaje dominante
- C++
- Estrellas
- 488
- Forks
- 184
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 40
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de scp-fs2open/fs2open.github.com
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
scp-fs2open/fs2open.github.com#7918 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
scp-fs2open/fs2open.github.com#7917 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
scp-fs2open/fs2open.github.com#7916 ·
Los mantenedores suelen responder en 1 día
-
P2: A timed rotation maneuver does nothing on a ship that had an earlier timed lateral maneuverPosiblemente ocupada @vovosta la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
scp-fs2open/fs2open.github.com#7914 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
scp-fs2open/fs2open.github.com#7901 ·
Los mantenedores suelen responder en 1 día
Todos los issues de scp-fs2open/fs2open.github.com
Issues similares
-
v9.6.0: CMake incorrectly enforces presence of libevdevPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
mltframework/shotcut#1943 ·
Los mantenedores suelen responder en 1 día
-
Rowan (2017) electron heating gives NaN for beta > beta_max; clip() then sets electrons to kel_minAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
parthenon-hpc-lab/kharma#213 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
metasequoiaime/msime#9113 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
tone-3000/tone3000-plugin#257 · 1 comentario ·
Los mantenedores suelen responder en 1 día