cvuchener / steamcontroller-linux-kernel

Linux Kernel Driver for Valve Steam Controller
30 stars 3 forks source link

Add README #1

Open johnjelinek opened 8 years ago

johnjelinek commented 8 years ago

Please add a readme with installation and testing instructions.

cvuchener commented 8 years ago

Done: f5e956e

Do you need more details?

johnjelinek commented 8 years ago

This might be good -- I'm going to compile kernel headers and try out the stuff in the README. Thanks

johnjelinek commented 8 years ago

Could you add uninstall directions? Also, do you know if this driver can emulate an xbox controller?

cvuchener commented 8 years ago

For uninstalling delete the module in /lib/modules//extra/hid-valve-sc.ko and run depmod. You need to delete the udev rules too if you installed them.

Also, do you know if this driver can emulate an xbox controller?

The driver does not allow remapping and the Steam controller is not a Xbox controller. Well written applications should allow input configuration instead of using xpad mappings, fix it if it is open source or use xboxdrv if you don't have any other choice.

johnjelinek commented 8 years ago

I think a make uninstall that does the uninstall steps you mentioned above would be good :) I'll take at the RetroPie stuff to see if it can support a generic controller.

cvuchener commented 8 years ago

My makefile only pass commands to the kernel makefile and there is no modules_uninstall target. I can add a dkms.conf file, if you want to use dkms for automatic install/update/remove.

RetroPie is based on RetroArch, right? There should not be any issue with non x360 pads, you can create an autoconfig file for the steam controller or configure it from the GUI.

johnjelinek commented 8 years ago

The dkms.conf might be helpful. I'll try to config it from the GUI again.

cvuchener commented 8 years ago

I have just tested RetroArch and there is some problem with the touch pads because the udev driver in RetroArch does not work with analog hats.

To fix that, you can either patch RetroArch, in input/drivers_joypad/udev_joypad.c: Remove or comment

              case ABS_HAT0X:
              case ABS_HAT0Y:
              case ABS_HAT1X:
              case ABS_HAT1Y:
              case ABS_HAT2X:
              case ABS_HAT2Y:
              case ABS_HAT3X:
              case ABS_HAT3Y:
              {
                 code                           -= ABS_HAT0X;
                 pad->hats[code >> 1][code & 1]  = events[i].value;
                 break;
              }

from udev_add_pad and

  /* Skip hats for now. */
  if (i == ABS_HAT0X)
  {
     i = ABS_HAT3Y;
     continue;
  }

from udev_poll_pad

Or change the axes used by my driver, in hid-valve-sc.c replace any occurrence of:

by:

johnjelinek commented 8 years ago
Copy the files to /usr/src/hid-valve-sc-0.1/ and run dkms install hid-valve-sc/0.1

This means the whole repo and contents of running make? Or just the ko/o files?

johnjelinek commented 8 years ago

I now see what you mean by the touch pad problem. Does the userland driver not rely on udev? The analog hats work there.

johnjelinek commented 8 years ago

I made the suggested changes to your driver. Works great now :)

johnjelinek commented 8 years ago

For systems like genesis/snes, this driver works great with your changes mentioned above, but for n64, the mapping is all off. The analog stick is y-inverted.

johnjelinek commented 8 years ago

as an aside -- I can't install w/ dkms:

$ sudo dkms install hid-valve-sc/0.1
Error! echo
Your kernel headers for kernel 4.1.13-v7+ cannot be found at
/lib/modules/4.1.13-v7+/build or /lib/modules/4.1.13-v7+/source.

To build manually, I have to:

sudo make -C ~/linux M=$PWD modules_install

I tried making the kernel source path ~/linux in the dkms.conf, but no worky.

johnjelinek commented 8 years ago

I got dkms to succeed. Do I still need to copy over the *.rules with a dkms install?

cvuchener commented 8 years ago

Yes, dkms only install the kernel modules.