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

[Important] The SDL2 controller driver utilizes UDEV rather than SDL2 #12

Open
davidhedlund opened this issue Aug 18, 2024 · 1 comment

Comments

@davidhedlund
Copy link

davidhedlund commented Aug 18, 2024

Describe the issue

When individuals use the "Set All Controls" feature from the AppImage to create autoconfig files with sdl2, they unknowingly generate udev autoconfig files. This can be risky as they might accidentally upload these files to the GitHub repository at https://github.com/libretro/retroarch-joypad-autoconfig/tree/master/sdl2.

Steps to Reproduce the Bug

  1. Delete all files in autoconfig/sdl2/.
  2. Start RetroArch.
  3. Navigate with the mouse since the fallback controller or keyboard will not work (see related bug: SDL2: Fallback controller not working with SDL2, and interupts the keyboard #13).
  4. Go to Settings -> Input -> RetroPad Binds -> Port 1 Controls -> Set All Controls.
  5. Bind the buttons as needed.
  6. Click on "Save Controller Profile".
  7. The generated file contains UDEV data, not SDL2 data.
  8. Navigate to Main Menu -> Load Core -> Start Remote RetroPad. When you press the button, it will be shown as normal, even though UDEV is being used instead of SDL2. This can be demonstrated by the following steps:
  9. Create an SDL2 autoconfig for the same controller using the Flatpak version of RetroArch.
  10. Transfer the Flatpak-generated autoconfig file into the autoconfig/sdl2/ directory for the AppImage.
  11. Remove the AppImage-generated file located in autoconfig/sdl2/ from step 6.
  12. Relaunch the RetroArch AppImage.
  13. The controller will be non-functional.

The issue affects all types of controllers, not just the DualSense, which is used as an example. When evaluating this issue, it is important to avoid relying on controller names. Some controllers, such as the Nintendo Switch Pro Controller in Ubuntu MATE 23.4, have identical names in both udev and SDL2 for Bluetooth and USB connections. However, for DualSense controllers, the name varies between linuxraw and SDL2 when connected via Bluetooth or USB. SDL2 does not change the name based on the connection type. Therefore, it is crucial to assess the differences in input variables instead.

Example for Sony DualSense controller

SDL2

The RetroArch packages for Appimage and Flatpak don't generates identical content.

Appimage with SDL2 (issue)

The Appimage appears to generate udev content with the exception that it add input_driver = "sdl2" instead of input_driver = "udev" to the file:

autoconfig/sdl2/Sony Interactive Entertainment DualSense Wireless Controller.cfg

input_driver = "sdl2"
input_device = "Sony Interactive Entertainment DualSense Wireless Controller"
input_vendor_id = "1356"
input_product_id = "3302"
input_b_btn = "0"
input_y_btn = "3"
input_select_btn = "8"
input_start_btn = "9"
input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"
input_a_btn = "1"
input_x_btn = "2"
input_l_btn = "4"
input_r_btn = "5"
input_l2_btn = "6"
input_r2_btn = "7"
input_l3_btn = "11"
input_r3_btn = "12"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+4"
input_r_y_minus_axis = "-4"

Flatpak with SDL2 (correct)

autoconfig/sdl2/PS5 Controller.cfg

input_driver = "sdl2"
input_device = "PS5 Controller"
input_vendor_id = "1356"
input_product_id = "3302"
input_b_btn = "0"
input_y_btn = "2"
input_select_btn = "4"
input_start_btn = "6"
input_up_btn = "11"
input_down_btn = "12"
input_left_btn = "13"
input_right_btn = "14"
input_a_btn = "1"
input_x_btn = "3"
input_l_btn = "9"
input_r_btn = "10"
input_l2_axis = "+4"
input_r2_axis = "+5"
input_l3_btn = "7"
input_r3_btn = "8"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+2"
input_r_x_minus_axis = "-2"
input_r_y_plus_axis = "+3"
input_r_y_minus_axis = "-3"

UDEV

The RetroArch packages for Appimage and Flatpak both generates identical content.

Appimage with UDEV (correct)

autoconfig/udev/Sony Interactive Entertainment DualSense Wireless Controller.cfg

input_driver = "udev"
input_device = "Sony Interactive Entertainment DualSense Wireless Controller"
input_vendor_id = "1356"
input_product_id = "3302"
input_b_btn = "0"
input_y_btn = "3"
input_select_btn = "8"
input_start_btn = "9"
input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"
input_a_btn = "1"
input_x_btn = "2"
input_l_btn = "4"
input_r_btn = "5"
input_l2_btn = "6"
input_r2_btn = "7"
input_l3_btn = "11"
input_r3_btn = "12"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+4"
input_r_y_minus_axis = "-4"

Flatpak with UDEV (correct)

#
autoconfig/udev/Sony Interactive Entertainment DualSense Wireless Controller.cfg

input_driver = "udev"
input_device = "Sony Interactive Entertainment DualSense Wireless Controller"
input_vendor_id = "1356"
input_product_id = "3302"
input_b_btn = "0"
input_y_btn = "3"
input_select_btn = "8"
input_start_btn = "9"
input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"
input_a_btn = "1"
input_x_btn = "2"
input_l_btn = "4"
input_r_btn = "5"
input_l2_btn = "6"
input_r2_btn = "7"
input_l3_btn = "11"
input_r3_btn = "12"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+4"
input_r_y_minus_axis = "-4"
@davidhedlund davidhedlund changed the title SDL2: SDL2 Game controller community database not used for controller names SDL2 uses UDEV for everything Aug 19, 2024
@davidhedlund davidhedlund changed the title SDL2 uses UDEV for everything [Important] SDL2 uses UDEV for everything Aug 19, 2024
@davidhedlund davidhedlund changed the title [Important] SDL2 uses UDEV for everything [Important] Appimage generates udev autoconfig file with sdl2 driver Aug 20, 2024
@davidhedlund davidhedlund changed the title [Important] Appimage generates udev autoconfig file with sdl2 driver [Important] RetroArch Appimage package generates udev autoconfig file with sdl2 driver Aug 20, 2024
@davidhedlund davidhedlund changed the title [Important] RetroArch Appimage package generates udev autoconfig file with sdl2 driver [Important] RetroArch's Appimage package generates udev autoconfig file with sdl2 driver Aug 20, 2024
@davidhedlund davidhedlund changed the title [Important] RetroArch's Appimage package generates udev autoconfig file with sdl2 driver [Important] SDL2 generates udev autoconfig files Aug 20, 2024
@davidhedlund davidhedlund changed the title [Important] SDL2 generates udev autoconfig files [Important] SDL2 incorrectly creates udev autoconfig files Aug 20, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 20, 2024
…cfg to PS4 Controller (v2).cfg

# This autoconfig file was generated using RetroArch 1.19.1 via the Flathub package.
# Please refrain from updating it with an autoconfig created by the AppImage: SDL2 incorrectly creates udev autoconfig files - hizzlekizzle/RetroArch-AppImage#12
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 20, 2024
input_menu_toggle_btn = "5"

this is the Flatpak package value, the old value was incorrectly generated by the Appimage, see: hizzlekizzle/RetroArch-AppImage#12
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 20, 2024
# This autoconfig file was generated using RetroArch 1.19.1 via the Flathub package.
# Please refrain from updating it with an autoconfig created by the AppImage: SDL2 incorrectly creates udev autoconfig files - hizzlekizzle/RetroArch-AppImage#12
@davidhedlund davidhedlund changed the title [Important] SDL2 incorrectly creates udev autoconfig files [Important] SDL2 controller driver uses UDEV instead of SDL2 Aug 20, 2024
@davidhedlund davidhedlund changed the title [Important] SDL2 controller driver uses UDEV instead of SDL2 [Important] The SDL2 controller driver utilizes UDEV rather than SDL2 Aug 20, 2024
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 20, 2024
# This autoconfig file was generated using RetroArch via the Flathub package.
# Please refrain from updating it with an autoconfig created by the AppImage: The SDL2 controller driver utilizes UDEV rather than SDL2 - hizzlekizzle/RetroArch-AppImage#12
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 20, 2024
# This autoconfig file was generated using RetroArch via the Flathub package.
# Please refrain from updating it with an autoconfig created by the AppImage: The SDL2 controller driver utilizes UDEV rather than SDL2 - hizzlekizzle/RetroArch-AppImage#12
davidhedlund added a commit to davidhedlund/retroarch-joypad-autoconfig that referenced this issue Aug 20, 2024
… Pro Controller (default-off).cfg

The SDL2 database uses the "Nintendo Switch Pro Controller." Previously, there was an incorrect name due to an issue: the SDL2 controller driver employs UDEV instead of SDL2 - hizzlekizzle/RetroArch-AppImage#12
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

1 participant