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

Xbox 360 wireless receiver issue in udev #38

Closed
sergiobenrocha2 opened this issue Mar 17, 2015 · 9 comments
Closed

Xbox 360 wireless receiver issue in udev #38

sergiobenrocha2 opened this issue Mar 17, 2015 · 9 comments

Comments

@sergiobenrocha2
Copy link
Contributor

There is some issues with this wireless receiver config (Xbox_360_Wireless_Receiver.cfg):

1 - Product ID seems to be wrong, 654 is probably the ID from the joystick itself, when you plug the recharger

2 - L and R buttons (LB and RB respect.) are digital buttons, so why you have input_l_axis and input_r_axis in the config file?

I have one wireless receiver here:

Bus 003 Device 039: ID 045e:0719 Microsoft Corp. Xbox 360 Wireless Adapter

But I can't keep other configuration file together with the file above. I tried to rename my file to Xbox_360_Wireless_Receiver_1817.cfg, but RA understand that the right file is the Xbox_360_Wireless_Receiver.cfg, which has a different ID product from mine.

My config file:

input_device = "Xbox 360 Wireless Receiver"
input_driver = "udev"
input_vendor_id = 1118
input_product_id = 1817
input_b_btn = "0"
input_y_btn = "2"
input_select_btn = "8"
input_start_btn = "9"
input_up_btn = "15"
input_down_btn = "16"
input_left_btn = "13"
input_right_btn = "14"
input_a_btn = "1"
input_x_btn = "3"
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 = "+2"
input_r_x_minus_axis = "-2"
input_r_y_plus_axis = "+3"
input_r_y_minus_axis = "-3"
input_menu_toggle_btn = "10"

input_b_btn_label = "A"
input_y_btn_label = "X"
input_select_btn_label = "Back"
input_start_btn_label = "Start"
input_up_btn_label = "D-Pad Up"
input_down_btn_label = "D-Pad Down"
input_left_btn_label = "D-Pad Left"
input_right_btn_label = "D-Pad Right"
input_a_btn_label = "B"
input_x_btn_label = "Y"
input_l_btn_label = "LB"
input_r_btn_label = "RB"
input_l2_btn_label = "LT"
input_r2_btn_label = "RT"
input_l3_btn_label = "Left Thumb"
input_r3_btn_label = "Right Thumb"
input_l_x_plus_axis_label = "Left Analog X+"
input_l_x_minus_axis_label = "Left Analog X-"
input_l_y_plus_axis_label = "Left Analog Y+"
input_l_y_minus_axis_label = "Left Analog Y-"
input_r_x_plus_axis_label = "Right Analog X+"
input_r_x_minus_axis_label = "Right Analog X-"
input_r_y_plus_axis_label = "Right Analog Y+"
input_r_y_minus_axis_label = "Right Analog Y-"
input_menu_toggle_btn_label = "Guide"

And I got btn instead axis from LT and RT, it's like digital buttons.

When I plug the recharger in my laptop, I get this:

Bus 003 Device 041: ID 045e:028f Microsoft Corp. Xbox360 Wireless Controller

i.e., product ID 655, which is close to the ID from Xbox_360_Wireless_Receiver.cfg (654), which I think is wrong.

@sergiobenrocha2
Copy link
Contributor Author

I forget an important thing:

By default, triggers are not enabled as z-axis, but as buttons. To change, edit /etc/defaults/xboxdrv and change TRIGGERS_AS_BUTTONS to false.

So now, it's almost the same thing from the config that already exist. I think the L and L2 (as well R and R2) are swapped, need push a commit later.

input_b_btn = "0"
input_y_btn = "2"
input_select_btn = "6"
input_start_btn = "7"
input_up_btn = "13"
input_down_btn = "14"
input_left_btn = "11"
input_right_btn = "12"
input_a_btn = "1"
input_x_btn = "3"
input_l_btn = "4"
input_r_btn = "5"
input_l2_axis = "+2"
input_r2_axis = "+5"
input_l3_btn = "9"
input_r3_btn = "10"
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"

@sergiobenrocha2
Copy link
Contributor Author

@kivutar , the receiver was made on china, but I think it's the original

20150710_123358

20150710_145511

@andres-asm
Copy link
Contributor

Is this still an issue?

@alkazar
Copy link
Contributor

alkazar commented Oct 28, 2019

I think I know what is happening. The mapping is actually correct, the issue of L and R buttons being mapped to triggers is fixed if you remove the Xbox_360_Wireless_Receiver_Chinese01.cfg file.

As far as I can tell, vendor id and product id are ignored and the devices are matched only by input_device. Because both files have input_device = "Xbox 360 Wireless Receiver", this causes my official Microsoft dongle to be detected as a Chinese knockoff receiver and be assigned incorrect mappings. Changing input_device in Xbox_360_Wireless_Receiver_Chinese01.cfg is enough to make the device be detected and mapped correctly.

Not sure what the solution is here. Shouldn't retroarch be matching on product and vendor id as well?

@hizzlekizzle
Copy link
Contributor

Have you checked the VID/PID on your official receiver? If it doesn't match the one in the official autoconfig, that would explain why it's not being picked (i.e., because both profiles would have the same number of matches).

@alkazar
Copy link
Contributor

alkazar commented Oct 28, 2019

@hizzlekizzle thanks for your reply. Yes, I forgot to mention that. The product and vendor id of my device do match the one in the official autoconfig.

I tried a bunch of things:

  • Playing around with the values, I found that input_device must match, and it doesn't matter what values you have for product/vendor id.

  • Using hex values for product/vendor id also did not allow a correct match.

  • Messing with the "Chinese" config to change the vendor id so it doesn't match anymore also still resulted in incorrect mappings.

  • Changing the "Chinese" config file name would sometimes result in the correct mapping. I thought perhaps there was a priority order, but I couldn't find a pattern. For example, renaming to "y.cfg" still matched the Chinese config file, but naming the file to "z.cfg" allowed the correct mapping to be detected.

@hizzlekizzle
Copy link
Contributor

That's very odd. It's supposed to go through and compare VID, PID and device name with a score applied to each one and the device with the highest score is the "match".

@alkazar
Copy link
Contributor

alkazar commented Oct 29, 2019

Yes, I see the code here: https://github.com/libretro/RetroArch/blob/master/tasks/task_autodetect.c#L190

I ran retroarch --verbose (should have done that earlier!), thinking that perhaps RetroArch is somehow obtaining the wrong product id, and found that it is indeed reporting my device with the Chinese product id (673) even when force matching with the official config, but lsusb reports the product id of the dongle as the official Microsoft product id (1817). How is that possible?

RetroArch log:
[INFO] [udev]: Plugged pad: Xbox 360 Wireless Receiver (1118:673) on port #0.

lsusb output:
Bus 001 Device 007: ID 045e:0719 Microsoft Corp. Xbox 360 Wireless Adapter

@RobLoach
Copy link
Member

Been some updates in here. Mind a re-test?

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

5 participants