Skip to content

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

@davidhedlund

Description

@davidhedlund

Describe the issue

The "Set All Controls" feature in the RetroArch AppImage inadvertently creates udev autoconfig files instead of SDL2 files, despite being labeled as SDL2. This discrepancy means that SDL2 autoconfig files uploaded to the official repository may be ineffective if they lack corresponding udev configurations for all game controllers. The inability to cross-reference files between the SDL2 and udev directories makes it challenging to determine whether the SDL2 directory contains genuine SDL2 configs or mislabeled udev configs generated by the AppImage. Consequently, users will find it virtually impossible to trust "SDL2" autoconfigs in general, as the process of ruling out and comparing these configurations is too complex for most to remember and implement effectively.

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions