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

XBox360 Controller Not Accessible #447

Closed
Diztruxion opened this issue Sep 9, 2022 · 8 comments
Closed

XBox360 Controller Not Accessible #447

Diztruxion opened this issue Sep 9, 2022 · 8 comments
Labels
WSL Applies to WSL only

Comments

@Diztruxion
Copy link

Hi,

I'm attempting to get a XBox360 USB controller to pass from Windows 10 into WSL2 using Ubuntu 18.04 LTS to create inputs to a Robot Operating System (ROS) simulation environment.

So far I've been successful in installing all required packages, finding the device in PS with usbipd wsl list. I've successfully attached the device using the busid, and I can see in the Ubuntu terminal that it has registered the device as a controller:

image

However, I'm not sure how the device should be accessible now. I can see that the device is created when I call lsusb:
image

From my reading, the developer of the simulation environment indicates that these controllers should be accessible using the jstest-gtk tool, and registers in /dev/input/js###

I know this might be a bit outside the scope of the windows side, just wondering if anyone has seen this before.

Thanks.

@dorssel
Copy link
Owner

dorssel commented Sep 9, 2022

From https://www.kernelconfig.io/config_joystick_xpad it looks like you need a special driver (xpad), which needs to be enabled in the kernel (which it isn't in the default WSL kernel).

Follow https://github.com/dorssel/usbipd-win/wiki/WSL-support#building-your-own-usbip-enabled-wsl-2-kernel and build your own kernel with this driver enabled.

@dorssel
Copy link
Owner

dorssel commented Sep 9, 2022

And you may also like https://www.kernelconfig.io/CONFIG_JOYSTICK_XPAD_FF

@dorssel dorssel added the WSL Applies to WSL only label Sep 28, 2022
@agaertner
Copy link

agaertner commented Oct 19, 2022

I actually did that. Compiled my own linux kernel with xbox drivers enabled and I still get

usbip: error: Attach Request for 1-2 failed - Device busy (exported)

when trying to attach device Xbox 360 Controller for Windows.

Tested controller model: EasySMX ESM-9100 Wired Controller

My guess is that the device is some weird msft interface driver that all X-Input devices are automatically assigned to when connected which requires special handling.

EDIT: Gamepads listed as a normal USB Input Device are working just fine. Tested with Logitech Gamepad F310.

@dorssel
Copy link
Owner

dorssel commented Oct 19, 2022

"Device busy" means exactly what it says. Looks like something on the host (service/software/driver) is holding an exclusive lock. Either stop that service/software, or use usbipd bind --force.

@agaertner
Copy link

agaertner commented Oct 19, 2022

Obviously yes. The service that has exclusive lock is probably one of those xbox services. I didn't bother checking because after badly wanting the --force argument which I thought didn't exist (I overlooked it) I had decided on just using the other controller.😅 Thanks for the hint.

Anyway, this should help random internet travelers and this issue can be closed if the OP doesn't have anything to add anymore.

@dorssel
Copy link
Owner

dorssel commented Nov 2, 2022

@Diztruxion
Has your problem been resolved?

@Diztruxion
Copy link
Author

@dorssel
Thank you for the follow-up; I've been a bad user, and should have closed this. We decided to go with another solution that avoided this challenge entirely so I have not followed up on it.

@dorssel dorssel closed this as completed Nov 2, 2022
@Doom4535
Copy link

Doom4535 commented Dec 5, 2022

I'm having this issue as well; I'm using a Logitech F310 USB gamepad (currently showing up as 3-13 046d:c21d Xbox 360 Controller for Windows ) and running usbipd wsl attach --busid <BUSID> returns:

usbip: error: Attach Request for 3-13 failed - Device busy (exported)

usbipd: error: Failed to attach device with busid '3-13'.

However, I am able to run usbipd bind --busid <BUSID> (after unbinding the controller) without errors; but I am unsure how to then attach it to WSL.

I have built a kernel following #building-your-own-usbip-enabled-wsl-2-kernel and zcat /proc/config.gz | grep -i xpad returns:

CONFIG_JOYSTICK_XPAD=y
CONFIG_JOYSTICK_XPAD_FF=y
  • edit: nvm, I just switched the controller from XInput Mode to DirectInput Mode using the bottom toggle and I am now able to access the joysticks under /dev/input/js0. I'm not sure how to use the newer XInput mode, but DirectInput currently works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WSL Applies to WSL only
Projects
None yet
Development

No branches or pull requests

4 participants