ChimeraOS / chimeraos

A Steam Big Picture based couch gaming OS
MIT License
1.64k stars 116 forks source link

8bitdo ultimate bluetooth support #442

Closed Fabianoshz closed 8 months ago

Fabianoshz commented 1 year ago

Connecting my 8bitdo ultimate bluetooth using 2.4ghz does nothing, the controller turns on but no input works. I've had the same issue on my Arch machine, installing paroj/xpad fixed since they added support for this specific controller here.

I tried to unlock and install on chimera but looks like dkms is not available. I installed dkms package from pacman but got this error trying to add this xpad module:

[gamer@chimeraos ~]$ sudo dkms install -m xpad -v 0.4
[sudo] password for gamer: 
Sign command: /usr/lib/modules/6.0.8-arch1-1/build/scripts/sign-file
Binary /usr/lib/modules/6.0.8-arch1-1/build/scripts/sign-file not found, modules won't be signed
Error! Your kernel headers for kernel 6.0.8-arch1-1 cannot be found at /usr/lib/modules/6.0.8-arch1-1/build or /usr/lib/modules/6.0.8-arch1-1/source.
Please install the linux-headers-6.0.8-arch1-1 package or use the --kernelsourcedir option to tell DKMS where it's located.

Pretty sure chimera wasn't intended for this, just wanted to test out.

Is there a way of adding this correctly? Or maybe even adding support on chimera itself?

pastaq commented 1 year ago

This would be best to try using the latest unstable build as that has the most current kernel. You can install the kernel headers using the ALA https://wiki.archlinux.org/title/Arch_Linux_Archive

You'll also need base-devel installed most likely. Be aware this may install things that may break your install depending on changes made to the package repos between image build time and when you install.

You could also fork the repository and build your own image to test it, instructions can be found in the wiki.

After your personal testing is done any you feel like the changes won't have regressions for other hardware you can submit a PR to add the package to the manifest.

alkazar commented 1 year ago

Does running this command get the controller working?

sudo /bin/sh -c 'echo 2dc8 3106 > /sys/bus/usb/drivers/xpad/new_id'

aaronson2012 commented 1 year ago

Have you tried flipping the switch on the back from X to D? I have this controller and flipping the switch makes it work fine. (Changes from Xinput to Dinput)

Fabianoshz commented 1 year ago

@alkazar This works, so an udev rule can be added for this controller?

@aaronson2012 I believe you have the Ultimate controller, not the Ultimate Bluetooth controller, they're not the same, the Ultimate Bluetooth only has xinput and bluetooth (which I've only tested on the Nintendo Switch).

Fabianoshz commented 1 year ago

Tested this rule:

SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3106", ATTR{manufacturer}=="8BitDo", RUN+="/bin/sh -c 'echo 2dc8 3106 > /sys/bus/usb/drivers/xpad/new_id'"

Seems to be working as expected.

pastaq commented 1 year ago

Tested this rule:

SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3106", ATTR{manufacturer}=="8BitDo", RUN+="/bin/sh -c 'echo 2dc8 3106 > /sys/bus/usb/drivers/xpad/new_id'"

Looks like a good candidate for the device_quirks package we're building.

Fabianoshz commented 1 year ago

But I believe this would affect every device as long as you connect this 8bitdo controller, I thought the device_quirks package was for device specific stuff.

pastaq commented 1 year ago

But I believe this would affect every device as long as you connect this 8bitdo controller, I thought the device_quirks package was for device specific stuff.

The filters for device ID and name will mitigate any conflict. The udev rule will just add the device ID to the existing driver if it is detected by the kernel. This solution is fairly device specific.

Fabianoshz commented 1 year ago

Maybe I got it wrong, but I believe that since this is device is connected through a dongle this is not device specific, everyone can just buy this controller and plug it on their device, so potentially everyone can suffer with this, an udev rule would ensure that everyone that buys this controller and tries to use it will have it working.

Fabianoshz commented 1 year ago

Ok, just saw this: https://github.com/ChimeraOS/device-quirks/blob/main/usr/lib/udev/rules.d/60-xbox-pads.rules

You're saying that the udev rule should be in the device_quirks package, I thought you were saying that this should be a script in this package. Anyway, this will fix this issue when the package is released.

sonicbhoc commented 1 year ago

What is the status on this? I just tried it and it still doesn't work out of the box on Chimera 41.

al12gamer commented 1 year ago

Checking in as well. Looks like my 8bitdo ultimate 2.4ghz controller is often seen as two controllers when playing games on my Steam Machine in my living room running ChimeraOS. Here are the specs for reference. Games in which the controller was apparently seen as two (while in x-input mode) include but haven't been limited to: Dinkum Helldivers Rocket League (steam) Nom Nom Galaxy Ultimate Chicken Horse (occasionally, not always) The Ascent

al12gamer commented 8 months ago

Was this fixed?

pastaq commented 8 months ago

Was this fixed?

The original issue is fixed. If you're still experiencing a separate issue feel free to open a new request.