Giter VIP home page Giter VIP logo

steamcontroller's People

Contributors

akien-mga avatar bchretien avatar greenbeard avatar jp-bennett avatar kiendang avatar kozec avatar mcronce avatar robsdedude avatar syr1us avatar ynsta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

steamcontroller's Issues

Trying to publish buttons as joystick and gyro data at the same time

Hello, I'm trying to use your library as sc-xbox.py does but at the same time I would like to publish the gyro data (this is for making a ROS node to publish all this).

I also would like to set the left pad to publish as all the range of values between 1.0 and -1.0 not only 1.0, 0.0, -1.0.

And finally give some haptic feedback on both pads.

For now I've been able to do a dump.py version that dumps also the gyro data. But I think writting a node that writes all the joystick buttons and the gyro data from scratch sounds like an overkill considering how close to be what I need is the code I found.

If I could setup two callbacks for the input data to process the gyro data separately I would have everything but configuring the left pad to be like the right pad in xbox mode.

I've tried to make a Gamepad Uinput class which has different Axis ranges (I think those are the ranges, the numbers defined in the axes= field) but I couldn't make it work.

Copy pasting the full process method and give some modifications just to handle the gyro also sounds like an overkill.

I would be very grateful for some feedback. Sorry if the issue is a bit chaotic, I've been writting it as I tried stuff.

input on right touchpad is recognized incorrectly

I installed the latest commit (074ccf2) on my Arch desktop using the PKGBUILD from AUR, and took the XBox controller emulation for a spin in PCSX2. Most of the buttons and axes are working great, except for the right touchpad. Both of its axes are recognized as "AXIS1", which apparently is the vertical axis on the left analog stick, when it should probably be mapped to both axes of the right analog stick. To witness, here's a screenshot of the input configuration dialog for PCSX2 (note the various "jAxis 0" entries in the list view):

screen20

Reading outputs directly

Hello, i am trying to make the steam controller work on my raspberry pi 2, in order to use it for an external game. Therefore, i need to be able to read the different buttons in a program, that only needs to control the gpio's on the board. So, i just need to know how to grab the data sent from the controller, just like the sc-dump does, however, i need it stored in some variables that i can interact with. I have a hard time finding the functions to call, in order to do this, as my main language is not python. Any help appreciated, as this could be used for many things, including controlling RC-cars, drones and other things from the gpio.

Anyway to modify mouse/trackpad sensitivity in Desktop Mode

Hi, I was just wondering if there's a way of modifying the trackpad sensitivity for sc-desktop.py. I tried editing it but I don't see any variable that deal with sensitivity. On a separate but related topic, can the trackpad be used as a trackball like in the official drivers or is this something not really within the scope of the script?

Right trigger button forces mouse movement

Hey there,

I'd like to ask for help for the following problem:

When I enable the Xbox controller emulation, everythin seems to work fine. However, as soon as I press the right trigger, my mouse pointer moves up and continues doing that. (edit: This behavior does not depend on the emulation, it always happens when I press the trigger)
Looking at XInputTest it appears that these buttons are always pressed.
image

Is there anything I can do to solve this problem?

Feature Request: Porting to Windows

I have no experience with python, and I am wondering what I would need to do to port this to windows? Or if anyone has started this and needs a beta tester, I can do that.

Changing controls in sc-desktop.py

I made a copy of sc-desktop.py and called it sc-minecraft.py, as I'm attempting to change the controls to be able to play Minecraft with it.

I see where the controls are defined in the file, but changing any of them causes it not to work.

Is there anything else I need to change in the file? I don't know much Python, but I'm generally fairly decent at editing any language.

No module named usb1

pi@raspberry:~/Documents/steamcontroller/scripts $ sudo ./sc-dump.py 
Traceback (most recent call last):
  File "./sc-dump.py", line 28, in <module>
    from steamcontroller import SteamController
  File "/usr/local/lib/python2.7/dist-packages/steamcontroller/__init__.py", line 21, in <module>
    import usb1
ImportError: No module named usb1

None of the scripts run for me.

pi@raspberry:~/Documents/steamcontroller/scripts $ lsusb -d 28de:1142Bus 001 Device 006: ID 28de:1142 

Is the final goal of the project to reflash the controller's firmware or just redirect input?

Sorry for cluttering up the issue tracker with this, I didn't know of any other place to ask this question.

A couple months ago there was talk from some Steam Controller devs that had mentioned that Steam reflashes the firmware every time the bindings are changed to not have any of the inherent latency that comes with software based input redirection.

Is the plan to eventually be able to do the same?

No error message when /dev/uinput is not writeable

On my Debian testing machine, the default permissions of /dev/uinput are:

$ ls -hl /dev/uinput 
crw------- 1 root root 10, 223 2015-12-27 12:31 /dev/uinput

When starting sc-xbox.py, I don’t see an error message, but no new SDL joysticks appear either.

Changing the permissions of /dev/uinput made this work.

Could you add proper error handling so that other users have an easier time getting this working please? Also, I think the instructions in README.md should be updated to include the steps to properly change the permissions of /dev/uinput.

Don't fail when no controller is detected

I would like to use this driver with OpenELEC, however it fails to run when no controller is plugged in

ValueError: SteamControler Device not found

This is problematic because I package this driver as an addon and use systemd to enable and disable it.
So it would be nice if it would just run as a daemon and wait for a device to be turned on/plugged in.

see, https://github.com/lrusak/lrusak-openelec-addons/blob/master/addons/service/driver/steamcontroller/source/systemd/service.driver.steamcontroller.service

As right now I have to restart the service every 10 seconds which isn't ideal.

I would use udev rules but the way addons work in kodi/OpenELEC don't really allow for this.

Thanks for the consideration or any direction you can point me in.

EDIT:
maybe something like this would work?

        while self._handle is None:
          for i in range(len(PRODUCT_ID)):
              pid = PRODUCT_ID[i]
              endpoint = ENDPOINT[i]
              ccidx = CONTROLIDX[i]

              self._handle = self._ctx.openByVendorIDAndProductID(
                  VENDOR_ID, pid,
                  skip_on_error=True,
              )

sc-xbox and sc-desktop don't seem to do anything

Arch x86_64
steam 1.0.0.50-2
steamcontroller-udev 1.0-2
python-steamcontroller-git 074ccf2-1

User is in the steam group. sc-dump lists info coming from the controller.

Starting Steam the mouse/scrolling works. I've noticed that when I launch a game through Big Picture (tried Race the Sun) it doesn't show up as a controller at all. I then exited steam and tried sc-xbox/desktop. They don't error out but the controller doesn't seem to do anything in either mode. This controller did have a firmware update in Windows if that makes a difference.

EDIT: The rumble sounds do change when I run sc-xbox start.

Tag stable releases

I see you changed the version to 1.1 in 4702734. Would it possible to tag the stable 1.0 and 1.1 releases in git, too?

Detecting tap/double-tap on the trackpads

I use the steam controller as more than just a gaming controller, particularly for browsing the web on an HTPC. So I was wondering if taps and double taps (the same way as on a touchpad on a laptop) are implemented? Or, is it something that should be handled at a higher level like https://github.com/kozec/sc-controller?

Another things I was wondering: are the trackpads are multitouch? (Would make two-finger-scrolling possible.)

Whole lotta thanks for your work, btw, I really appreciate it :)

Test to see if controller is connected

Is there a way I can test to see if the controller is powered on and connected (not just the dongle)? I'd like to write a daemon that automatically starts emulation station when the controller is powered on and terminates it when the controller is powered off.

init scripts

Can you please add init.d or systemd scripts so the daemon will start on boot?

LIBUSB_ERROR_ACCESS [-3] when launching sc-desktop.py

I guess something is wrong aouround udev.
Can you provide any help ?

my steam-udev conf
cat /etc/udev/rules.d/99-steam-controller.rules SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", GROUP="guillaume", MODE="0660" KERNEL=="uinput", MODE="0660", GROUP="guillaume", OPTIONS+="static_node=uinput"

and in syslog :
Oct 13 20:01:02 htpc-arctic sc-desktop.py: message repeated 10 times: [ sc-desktop.py: LIBUSB_ERROR_ACCESS [-3]] Oct 13 20:01:04 htpc-arctic sc-desktop.py: sc-desktop.py: LIBUSB_ERROR_ACCESS [-3]

and I suspect rights error on uinput
ll /dev/uinput crw------- 1 root root 10, 223 oct. 13 19:32 /dev/uinput

ImportError: No module named usb1

I'm getting the following error message when I try to run either script (except the other one says /usr/bin/sc-desktop.py instead):

Traceback (most recent call last): File "/usr/bin/sc-xbox.py", line 27, in <module> from steamcontroller import \ File "/usr/lib64/python2.7/site-packages/steamcontroller/__init__.py", line 21, in <module> import usb1 ImportError: No module named usb1

After this, it is, of course, not working.

Unable to fall back to steam driver

Hello, I hope this is appropriate place to ask. After testing out this driver (which works great), I am unable to fall back to simply using steam without this driver activated. Is there a process to uninstall it, or revert?

Thanks,

When the controller is stopped the xbox pad is not deconnected

Using this driver for GC emulation with retroarch and emulation station, I saw that if the pad is started I can't disconnect it to replug my usb SNES pad for other games.

So I have to change settings in retroarch to change pads order.

It should be nice that a long press to the steam button put back the driver in the "waiting for controller" mode and then disconnect created devices.

ImportError: No module named enum

eh... help? I'm new-ish to linux, so naturally I have no idea what to do or what this means.
can anyone help me out here?

When I type "sc-xbox.py enable" :

File "/usr/local/bin/sc-xbox.py", line 27, in
from steamcontroller import
File "/usr/local/lib/python2.7/dist-packages/steamcontroller/init.py", line 24, in
from enum import IntEnum
ImportError: No module named enum

sc-dump.py errors out when using controller wired

I've installed the latest git code both through he Arch Linux AUR package and manually using the setup.py install method - at first I thought the software wasn't working at all, however I discovered that it works perfectly when I use my controller wirelessly.

I generally use my controller on the wire, as I sit fairly close to my PC anyway so I don't need wireless, and I'm a bit lazy when it comes to batteries.

When I run sc-dump.py, I get the error:

SteamControler Device not found
Bye

And the rest of the sc- scripts don't work at all.

Again, I'd like to stress that this is only a problem when I'm plugged in using the USB cable (Which works just fine in Steam BPM). Without running any sc-scripts at all, my controller still gets picked up as a mouse on the right touchpad and various buttons on the rest.

Trackpad overlap (and some other weird issues)

I noticed that with the default deadzone (0.6), it didn't seem to be possible to use "diagonals" on the trackpads when they're configured as buttons. "Diagonals", of course, meaning that, using up and left as an example, the keycodes configured for both up and left would be sent.

I lowered the deadzone a lot (0.2), but noticed a bunch of issues far out on the trackpad - basically, it looks like the X and Y axes don't line up perfectly with the exact horizontal and vertical lines on the trackpads. At least, not mine...maybe there's variation from one to the next. Some testing shows that mine is off by about 0.1π radians.

So, I want to propose a change - rather than using a simple integer deadzone check (which effectively makes the deadzone a square), we can figure out the linear distance of the touch coordinates from center and do a little trigonometry to figure out the angle that we're working with and, consequently, which keycodes to send.

Controller D-Pad Freaking out

The D-Pad started freaking out with haptic feedback (lots of clicking sounds) and menu selection was made impossible. After a reboot, it started up again as soon as the daemon kicked in. The only way I got it to fix was to leave the machine off long enough for the Steam logo to go dim on the controller, and then boot the computer up. I'm not sure how to repro, and ideas what would've caused this?

A few more informations on reports and commands.

I have written a Linux kernel driver from the few things I found, it may contains some features you don't know (or that I did not found in your code, I am not really comfortable with python, I may have missed things).

https://github.com/cvuchener/steamcontroller-linux-kernel

It supports wired and wireless devices with connection management (not pairing) and exposes them as generic gamepads (with a sysfs attribute to enable the default mouse). You may want to have a look at valve_sc_raw_event (that parses input interrupts) and any call to valve_sc_send_request.

For input events, I don't think there is anything new for you, but I also parse connection events.

The settings command (0x87) is more detailed than in your readme with separate settings for mouse (0x08) and orientation sensors (0x30). It is not present in this driver, but I also found that 0x18 change the mouse/trackball inertia.

I also use the commands for retrieving the serial (0xae), or getting the connection state (0xb4), or disabling key events (0x81).

I hope this will help. Don't hesitate to ask questions or correct any mistake I may have made.

Low Priority: Typo in readme

Under usage, where is says "Stop: sc-xbox.py stop or sc-xbox.py stop" (it says xbox twice)
It should say Stop: sc-xbox.py stop or sc-desktop.py stop"

Not clear udev behavior

When use steam like driver for controller, then udev events work normal. What I mean: if controller off and I start or close steam then "udevadm monitor" doesn't catch any event, if controller on and I start/close steam "udevadm monitor" catch events. If steam started and I turn on/off controler "udevadm monitor" catch events.
But with this driver "udevadm monitor" catch events on "start/stop" driver daemon, not on power on/off controller.

Why it's important?
I see in issues, that a man wrote a special daemon for checking the connection controller, to my opinion with the right behavior enough simple udev rules.

Sorry for bad english, I hope I was able to present the idea.

MacOS / OSX Support

Is there any workaround/alternative to get this same functionality to work on OSX / MacOS? i.e Some emulator for an Xbox 360 controller with a Steam Controller - use case is to use this with Crazyflie client natively on MacOS instead of running in a linux distro through virtualbox.

I can see you mentioned contribution welcome some time back, not sure if this has been answered / is not being considered?

Issues with building from source

UPDATE: I have resolved the issue. Due to the naming conventions on the library files in Fedora, the build script will end up failing when trying to compile uinput.c

The solution I found was to just manually compile it myself using this line:
sudo gcc -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/src/uinput.o -L/usr/lib64/libpython2.7.so.1.0 -o build/lib.linux-x86_64-2.7/libuinput.so

This builds it for Python 2.7 on my system. For building it using Python 3, the line should be:
sudo gcc -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/src/uinput.o -L/usr/lib64/libpython3.so -o build/lib.linux-x86_64-2.7/libuinput.so

Is there a way to have this addressed to make compilation on Fedora work out of the box?


Old Post
Hey, I'm currently running Fedora 24-beta, however this issue is present in Fedora 23 as well.

It seems the build scripts aren't set up correctly,(See Edit2) so it won't build properly. Using "sudo python setup.py install" gives the output:

running install
running build
running build_py
running build_ext
building 'libuinput' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c scc/uinput.c -o build/temp.linux-x86_64-2.7/scc/uinput.o
gcc -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/scc/uinput.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/libuinput.so
/bin/ld: cannot find -lpython2.7
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

The issue is also seen here.

Would we be able to get this addressed soon?

Thank you for your time and all the work you've put into this project, btw. :)

EDIT:
I also tried cloning from the repo itself versus using the supplied tars in the documentation, and it has the same typo and issue, as is seen here:

running install
running bdist_egg
running egg_info
creating python_steamcontroller.egg-info
writing requirements to python_steamcontroller.egg-info/requires.txt
writing python_steamcontroller.egg-info/PKG-INFO
writing top-level names to python_steamcontroller.egg-info/top_level.txt
writing dependency_links to python_steamcontroller.egg-info/dependency_links.txt
writing manifest file 'python_steamcontroller.egg-info/SOURCES.txt'
reading manifest file 'python_steamcontroller.egg-info/SOURCES.txt'
writing manifest file 'python_steamcontroller.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/steamcontroller
copying src/events.py -> build/lib.linux-x86_64-2.7/steamcontroller
copying src/cheader.py -> build/lib.linux-x86_64-2.7/steamcontroller
copying src/uinput.py -> build/lib.linux-x86_64-2.7/steamcontroller
copying src/__init__.py -> build/lib.linux-x86_64-2.7/steamcontroller
copying src/tools.py -> build/lib.linux-x86_64-2.7/steamcontroller
copying src/daemon.py -> build/lib.linux-x86_64-2.7/steamcontroller
running build_ext
building 'libuinput' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c src/uinput.c -o build/temp.linux-x86_64-2.7/src/uinput.o
src/uinput.c: In function ‘uinput_key’:
src/uinput.c:148:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c: In function ‘uinput_abs’:
src/uinput.c:159:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c: In function ‘uinput_rel’:
src/uinput.c:170:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c: In function ‘uinput_scan’:
src/uinput.c:181:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c: In function ‘uinput_set_delay_period’:
src/uinput.c:192:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c:195:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c: In function ‘uinput_syn’:
src/uinput.c:206:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/src/uinput.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/libuinput.so
/bin/ld: cannot find -lpython2.7
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

The issue is this line: gcc -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/src/uinput.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/libuinput.so

There needs to be a space between the L in "-L/usr/lib64 -lpython2.7", and should be "-L /usr/lib64 -lpython2.7", I think.

Edit2: The build scripts seem fine, on second thought. The issue seems to be missing a python library for it to call and load. Unfortunately, I haven't been able to figure out what package I am missing, or if the library is located somewhere else under a different name, or anything of the sort. I will update if I find a solution to the missing library.

Steam Controller not detected in xbox360 mode thus causing stutter every 2 seconds

Duplicating this Issue ticket from the retropie's github : RetroPie/RetroPie-Setup#1870 . Because it seems to be entirely related to steamcontroller package and not the way it is implmented by retropie.

sc-xbox.py script is looping every 2 seconds when not detecting a steam controller. Causing the whole system to stutter every 2 seconds. The problem persists upon reboot and update of the system. Only way to fix it is to reinstall the "steam controller driver" package from retropie-setup.

Syslog : https://hijackedbrain.com/data/syslog
snipet from Syslog
Feb 1 20:21:47 retropie kernel: [ 139.181329] input: Steam Controller Keyboard as /devices/virtual/input/input56 Feb 1 20:21:47 retropie /sc-xbox.py: sc-xbox.py: No SteamControler Device found Feb 1 20:21:47 retropie /sc-xbox.py: Traceback (most recent call last):#012 File "/opt/retropie/supplementary/steamcontroller/lib/python3.4/site-packages/python_steamcontroller-1.2-py3.4-linux-armv7l.egg/steamcontroller/daemon.py", line 98, in start#012 self.run()#012 File "/opt/retropie/supplementary/steamcontroller/lib/python3.4/site-packages/python_steamcontroller-1.2-py3.4-linux-armv7l.egg/EGG-INFO/scripts/sc-xbox.py", line 70, in run#012 sc = SteamController(callback=evm.process)#012 File "/opt/retropie/supplementary/steamcontroller/lib/python3.4/site-packages/python_steamcontroller-1.2-py3.4-linux-armv7l.egg/steamcontroller/__init__.py", line 144, in __init__#012 raise ValueError('No SteamControler Device found')#012ValueError: No SteamControler Device found

Steps to reproduce :
1/ Install "Steam Controller Driver" package from retropie-setup
2/ Using retropie-setup, configure "Steam Controller Driver" to work in "xbox360 controller" mode.
3/ Reboot

Link to the related retropie forum's thread : https://retropie.org.uk/forum/topic/7828/stuttering-issue-across-all-the-distrib

Do I have to replace /lib/udev/rules.d/99-steam-perms.rules from Ubuntu's steam pkg?

Installing Steam from the Ubuntu 16.04 repositories places a file in /lib/udev/rules.d/ named 99-steam-perms.rules which has their default Steam Controller setup and contains this text:

# Steam Controller device node write access, per lp:1498655
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1102", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1002", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1142", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1042", MODE="0666"
# Steam Controller udev write access, per lp:1498658
KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess"

Seeing that the udev rules provided in the README are different (but have some similarities like the idVendor value), do I have to replace the text in the 99-steam-perms.rules file or remove it entirely to work with this driver? Or do I just leave it as is and this driver will work without further editing?

Repo key expired.

Updating from your repo,

sudo apt-get update

causes this message.

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.opensuse.org/repositories/home:/kozec/xUbuntu_16.04 Release: The following signatures were invalid: KEYEXPIRED 1480161281 W: Failed to fetch http://download.opensuse.org/repositories/home:/kozec/xUbuntu_16.04/Release.gpg The following signatures were invalid: KEYEXPIRED 1480161281

sc-xbox.py crashes on Fedora 22

sc-xbox.py crashes on Fedora 22. I discovered that the key_ definitions have been moved from uintput.h to input-event-codes.h on newer kernels.

Two steam controllers

I have issues with two steam controllers. I can't seem to make them work together (only one at the time). Am I missing something?

Can't turn Gyro off while "sc-xbox.py" is running | Raspberry Pi 2

Thank you very much for the "driver" but I believe that I have found an issue.

Whenever sc-xbox.py is running and I try to send the Gyro disable command ( echo 87153284 03180000 31020008 07000707 00300000 2f010000 00000000 00000000 | sc-test-cmsg.py ) but I end up with
LIBUSB_ERROR_BUSY [-6] Bye
instead.
If I were to run sc-xbox.py stop and then try the Gyro-Disabling command again, I get a live log of my controller's movements/inputs sent to my Terminal.

This was done on a Raspberry Pi 2 Model B using RetroPie, my Steam Controller, and a non-Steam provided USB Micro to USB adapter.

If you need more information, I'll definitely see what I can do. Thanks for your time!

Missing dependency when running sc-xbox.py start and sc-desktop.py start: psutil

When running the commands stated in the readme file, I got the error below:

pi@raspberrypi:~/Documents/GitHub/steamcontroller $ sudo sc-desktop.py start
Traceback (most recent call last):
  File "/usr/local/bin/sc-desktop.py", line 4, in <module>
    __import__('pkg_resources').run_script('python-steamcontroller==1.2', 'sc-desktop.py')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2876, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 449, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 745, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 639, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: psutil

Is there any reason that this is happening? I followed all of the instructions to the letter in the readme and am running Noobs 2.1.0 on a Raspberry Pi 3 Model B with Python 2.7.9.

Suggestion: Add feature to read dates

I have did a small program to create some rumble and to read the dates of the controller some time ago, I'll just share what I didn't find here.
To setup the controller, send the control transfer
83 followed by 00s to reset (?) the controller. (I'll just paste in my C++ Code)

  uint8_t data[64] = {0};
  data[0] = 0x83;//Service Mode (?), maybe also reset, however trackball feeling doesn't get reset

  return libusb_control_transfer(handle, 0x21, 0x09, 0x0300, 0x0002, data, 64, 0);

Then you can get the Date from the package the controller will send.

  int i;
  int time = 0;
  uint8_t data[64] = {0};
  uint8_t offset = 23;
  libusb_control_transfer(handle, 0xa1, 0x01, 0x0300, 0x0002, data, 64, 0);

  for (i=0; i<4; i++)
  {
    time += data[i+offset] << (8*(i));
  }
  return time;

Then you receive the time as unix timestamp, and you will only have to convert it.
The offset is there to also receive other dates which are stored inside the controller.
The other dates are 4 bytes long and between them there is a padding of 1 byte (resulting in 5 bytes).
The other (unknown) dates are at the offset 18 and 28.
EDIT: I know this is unlikely to fit into a driver, but I wanted to share that, as it is an interesting thing to know. Oh and I suggest wireshark to get the packages, because it has a great UI, which also explains which flags do more or less what.

Configuring D-Pad

I've got the xbox emulation working with RetroArch, but the D-Pad is nearly unusable. The dead zone in the center is too large and there seems to be no overlap with the X and Y Axis. For example, I can go left, and I can go up, but I cannot go both left and up at the same time. I never see the X and Y axes triggered at the same time when using jstest.

How can I tweak the dead zone and overlap settings?

Typos, maybe not

I was going through documenting stuff to make it easier on me to use this as an API and I ran across something that looks like a typo to me, based on context. On line 218 in events.py, is has this:
click = SCButtons.LPAD
but I think it would be this, being as it was in a right pad context:
click = SCButtons.RPAD

Joystick Axis seems to be always active?| RPI2B+

Preemptive thanks for effort put into this project. It's awesome!

Currently setting up my Steam Controller to work with my ps3 using this and GIMX.
I prefer to use both haptic pads as joystick replacements and the actual joystick as a DPAD.

To do so I set up the config like so:

evm.setPadAxes(Pos.RIGHT, Axes.ABS_RX, Axes.ABS_RY)
evm.setPadAxes(Pos.LEFT,Axes.ABS_X,Axes.ABS_Y)
evm.setStickButtons([Keys.KEY_UP,
                    Keys.KEY_LEFT,
                    Keys.KEY_DOWN,
                    Keys.KEY_RIGHT])

Unfortunately, GIMX (I don't have any other game with 360 support to confirm this with) still sees the the stick as a set of axes as well as being a set of buttons. On top of that, it sees it as the axes used for ABS_X and ABS_Y. I do realize could set the Pos.LEFT as buttons to limp but I would really like that full joystick range. With sc-xbox.py off, nothing is picked up, so I'm thinking it might be something on this end.

I don't mind trying to find the source of the issue myself but am not even sure where to start.

Thanks.

sc-xbox.txt

Update 1:
To expand, a little. When using the configuration above, the joystick is recognized as both the ABS_X, ABS_Y & KEY.UP, KEY.DOWN, KEY.LEFT, and KEY.RIGHT. POS.LEFT works as expected (without the extra Keys). GIMX does not display the same results with an actual 360 controller (although I figure this useless info)

I also tried commenting out setStickButtons altogether and GIMX picks it up as ABS_X & ABS_Y.
Thinking the stick might default to that, I tried using null and 0 setStickAxes as values but found no change.
To expand, a little. When using the configuration above, the joystick is recognized as both the ABS_X, ABS_Y & KEY.UP, KEY.DOWN, KEY.LEFT, and KEY.RIGHT. POS.LEFT works as expected (without the extra Keys). GIMX does not display the same results with an actual 360 controller (although I figure this useless info)

I also tried commenting out setStickButtons altogether and GIMX picks it up as ABS_X & ABS_Y.
Thinking the stick might default to that, I tried using null and 0 setStickAxes as values but found no change.

I guess it could be error checking for incorrect values but my money is on rogue line in there somewhere.

P.S. To make sure I'm not being a complete idiot, attached is my full sc-xbox.py

Update 2:
Not solved yet but I did notice that in events.py, under setTrigAxesCallback(), it has:
self._trig_modes[pos] = StickModes.AXISNot solved yet but I did notice that in events.py, under setTrigAxesCallback(), it has:
self._trig_modes[pos] = StickModes.AXIS
I'm thinking it should be:
self._trig_modes[pos] = TrigModes.AXIS

Changing that in /src and reinstalling did not fix the problem however. :(

Update 3:
Ok, I'm going to preface by saying I'm probably wrong and stupid.

So I found out that the stick and LPAD are the same except for LPADTOUCH being true in the case of LPAD.
Under #Axis Mode of_KeyReleased() of events.py,
sci.buttons & touch == touch

I'm on the fence about this one, but if touch is False (as it is in the when stick is in use), wouldn't the statement still be True and cause it act as if it were the touchpad? I tried editing it myself but it didn't change. May be it's in other places...

Update 5 million: I am dumb. The logic works fine in most places as the counter possibility has already been accounted for and using True instead of a local variable probably causes too much lag.

Would I be better off swapping the joystick ifs with the haptic in this case?
And if so, would it be viable to put a check in setup.py to switch between two different events.py?

Update 5: I am deeply sorry for the nightmare of messages you may or may not have recieved due multiple comments. I was limited to a bad browser for a hot minute to comment.
I am a n00b. Consolidating now.

Questions about porting to other OSes

Just so I understand, you're taking advantage of the fact that under Linux, a simple char device (uinput) can be used for any type of device -- mouse, keyboard or gamepad. Is this correct? This won't scale to other OSes, where you need to actually use their API to create the appropriate events. Do I understand this correctly?

Android version

Hello, is there any Android version of this project?
I'd like to try it on Remix OS in particular (which is a desktop x86_64 port of Android)

ImportError: No module named steamcontroller

Running xbian(debian with kodi on raspberry pi, and trying to start the script, but get this:

xbian@kodi ~/steamcontroller-master/scripts $ ./sc-desktop.py start Traceback (most recent call last): File "./sc-desktop.py", line 27, in <module> from steamcontroller import SteamController, SCButtons ImportError: No module named steamcontroller

going up one level to try setup.py install gave this output:

sudo ./setup.py install running install running bdist_egg running egg_info writing requirements to python_steamcontroller.egg-info/requires.txt writing python_steamcontroller.egg-info/PKG-INFO writing top-level names to python_steamcontroller.egg-info/top_level.txt writing dependency_links to python_steamcontroller.egg-info/dependency_links.txt reading manifest file 'python_steamcontroller.egg-info/SOURCES.txt' writing manifest file 'python_steamcontroller.egg-info/SOURCES.txt' installing library code to build/bdist.linux-armv7l/egg running install_lib running build_py running build_ext building 'libuinput' extension arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/uinput.c -o build/temp.linux-armv7l-2.7/src/uinput.o unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

Multiple controllers popping up

I'm not sure where to track this problem example because there are multiple components involved:

  1. I'm on a raspberry pi
  2. I added $HOME/Documents/steamcontroller/scripts/sc-xbox.py start to my .bashrc so the controller loads on startup.
  3. I'm running emulationstation (via retropie)
  4. emulationstation is running an SNES emulator
  5. The SNES emulator says the xbox controller is connected to port #0

Then after a while of playing, it says something connected to port #1 and then disconnects. The same starts happening with port #2. In order to fix the problem, I've gotta run sc-xbox.py stop and then sc-xbox.py start. I checked lsusb and nothing new shows up, so I don't know why it starts recognizing multiple controllers plugged in. Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.