Showing posts with label Gaming. Show all posts
Showing posts with label Gaming. Show all posts

Tuesday, January 24, 2017

Install Steam Controller on Ubuntu 16.04

I have a Steam controller that I use every now and then and wanted to try it on Ubuntu 16.04. However, the operating system did not recognize the controller automatically, as of 22.01.2017 on a fresh install of Ubuntu 16.04. Luckily, it can be added quickly without any extensive troubleshooting.


Detecting the steam controller in ubuntu
Ubuntu 16.04 detecting the Steam controller for the first time.

Add a Controller

Referring to an earlier post from November 2016 on AskUbuntu.com the solution is quite straightforward and applies to a fresh 16.04 install.

  1. To install the controller we have to add a new device manually with udev,
    sudo gedit /lib/udev/rules.d/99-steam-controller-perms.rules
  2. There is no such file by default, so the above command will create it. Simply copy the following into it,
    # This rule is needed for basic functionality of the controller in Steam and keyboard/mouse emulation
    SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"

    # This rule is necessary for gamepad emulation; make sure you replace 'GROUP' with a group that the user that runs Steam belongs to
    KERNEL=="uinput", MODE="0660", GROUP="GROUP", OPTIONS+="static_node=uinput"

    # Valve HID devices over USB hidraw
    KERNEL=="hidraw*", ATTRS{idVendor}=="28de", MODE="0666"

    # Valve HID devices over bluetooth hidraw
    KERNEL=="hidraw*", KERNELS=="*28DE:*", MODE="0666"

    # DualShock 4 over USB hidraw
    KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE="0666"

    # DualShock 4 wireless adapter over USB hidraw
    KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ba0", MODE="0666"

    # DualShock 4 Slim over USB hidraw
    KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="09cc", MODE="0666"

    # DualShock 4 over bluetooth hidraw
    KERNEL=="hidraw*", KERNELS=="*054C:05C4*", MODE="0666"

    # DualShock 4 Slim over bluetooth hidraw
    KERNEL=="hidraw*", KERNELS=="*054C:09CC*", MODE="0666"
    Make sure to replace GROUP with the user's group that will run Steam. In most installations your username and group will be username:username, hence your username will suffice. If in doubt, you can check what groups you belong to simply by,
    groups username
  3. Unplug the controller adapter if it was plugged in.
  4. Re-plug the controller adapter. 
That should be it. Enjoy gaming.

Monday, December 29, 2014

Fixing Left 4 Dead 2 Mouse Lag in Ubuntu 14.04

Issue

I have noticed a slight lag-like thing while playing Left 4 Dead 2 recently, mainly when turning with the character. It wasn't too obvious, but I felt something was wrong. I couldn't aim properly with the weapons and therefore I often missed shots. It seemed too much of a coincidence. I have tried tweaking some mouse sensitivity, acceleration etc. however the issue persisted.

Solution

Long story short, others have experienced the same problem while gaming on Linux. Luckily, def075 mentioned [1] that this may be a mouse polling issue. I did a quick search and found the solution [2]. Do the following,

  1.     gksudo gedit /etc/modules
  2.     And add the following 2 lines to the end of the file,
        -r usbhid
      usbhid mousepoll=1
  3.     And finally reboot.

Where the "mousepoll" tells the operating system how often to query (read data from) the mouse. The faster it does it, the less lag there is in the input. For reference [3],

1=1000 Hz (1ms)
2=500Hz (2ms)
4=250Hz (4ms)
8=125Hz (8ms)
10=100Hz (default, 10ms)

I have set mine to "mousepoll=1" and it works just fine. Some other posts say to set it to 2, I personally just went for the maximum to be on the safe side. Feel free to experiment with this, however I personally don't think that this would cause a great decrease in CPU time/performance on overall.

References


[1] - http://forums.steampowered.com/forums/showthread.php?t=3147537
[2] - http://ubuntuforums.org/showthread.php?t=392494
[3] - https://wiki.archlinux.org/index.php/Mouse_Polling_Rate