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

Use the udev "uniq" attribute when generating the device GUID #407

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

zvova7890
Copy link
Contributor

I have two PS3 joysticks; I can use one without problems. But when I connect the second, I can't set up the second pad because puNES can't understand which one to pick due to identical GUIDs.

Adding a simple index to the GUID generator resolves the problem.

@punesemu
Copy link
Owner

Hi @zvova7890 and thanks for your contribution. I'll take a look at your patch over the weekend.

@zvova7890
Copy link
Contributor Author

Using the udev attribute uniq and XORing it over 4-16 bytes of the GUID might be a better approach. This depends on the joystick binding policy. If we allow binding only to the exact joystick, regardless of the connection order, this approach could be more reliable.

@punesemu
Copy link
Owner

Obviously you are absolutely right, when I wrote the code I also took the uniq attribute into consideration but in the tests I did with the 3 controllers (all 3 of different brands) that I have, the attribute was always not valued and so I decided not to use it.

@zvova7890 zvova7890 force-pushed the joysticks_conflict branch 2 times, most recently from a785ab9 to c5eb00b Compare July 14, 2024 21:31
@zvova7890 zvova7890 changed the title Linux: Use the index when generating GUIDs to avoid conflicts Use the udev "uniq" attribute when generating the device GUID Jul 14, 2024
@zvova7890
Copy link
Contributor Author

I updated to using the uniq attribute

It helps to avoid duplicate GUIDs when connecting two similar joysticks.
@punesemu
Copy link
Owner

Sorry for the delay, but my SSD had abandoned me. I'm reinstalling my Gentoo and recovering my data.

@zvova7890
Copy link
Contributor Author

😮

no worry. I hope you recover all your important data

src/core/jstick.c Outdated Show resolved Hide resolved
src/core/jstick.c Outdated Show resolved Hide resolved
@punesemu punesemu merged commit 7ee4b5a into punesemu:master Aug 2, 2024
8 checks passed
@punesemu
Copy link
Owner

punesemu commented Aug 2, 2024

Many thx @zvova7890.

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

Successfully merging this pull request may close these issues.

None yet

2 participants