• Stars
    star
    776
  • Rank 56,530 (Top 2 %)
  • Language
    C
  • Created almost 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Linux Kernel Driver for the Xbox/ Xbox 360/ Xbox One Controllers

Updated Xpad Linux Kernel Driver

Driver for the Xbox/ Xbox 360/ Xbox 360 Wireless/ Xbox One Controllers

This driver includes the latest changes in the upstream linux kernel and additionally carries the following staging changes:

  • support for more compatible devices
  • support for xbox360 class controllers, that need initialisation
  • support for xbox one elite paddles
  • xpad360w: power-off by long-pressing the power button

Xbox One Controllers

This driver is only used if you connect the controller via USB.

Connecting via Bluetooth
If you get past the pairing issues, the controller will operate in the generic-HID bluetooth profile.
The xpad driver will not be used.

Connecting via XBox One Wireless Adapter (WiFi)
The adapter needs daemon in userspace, see: medusalix/xow
Opinion: rather get a controller that supports bluetooth.

Installing

sudo git clone https://github.com/paroj/xpad.git /usr/src/xpad-0.4
sudo dkms install -m xpad -v 0.4

Updating

cd /usr/src/xpad-0.4
sudo git fetch
sudo git checkout origin/master
sudo dkms remove -m xpad -v 0.4 --all
sudo dkms install -m xpad -v 0.4

Removing

sudo dkms remove -m xpad -v 0.4 --all
sudo rm -rf /usr/src/xpad-0.4

Usage

This driver creates three devices for each attached gamepad

  1. /dev/input/jsN
    • example jstest /dev/input/js0
  2. /sys/class/leds/xpadN/brightness
    • example echo COMMAND > /sys/class/leds/xpad0/brightness where COMMAND is one of
      • 0: off
      • 1: all blink, then previous setting
      • 2: 1/top-left blink, then on
      • 3: 2/top-right blink, then on
      • 4: 3/bottom-left blink, then on
      • 5: 4/bottom-right blink, then on
      • 6: 1/top-left on
      • 7: 2/top-right on
      • 8: 3/bottom-left on
      • 9: 4/bottom-right on
      • 10: rotate
      • 11: blink, based on previous setting
      • 12: slow blink, based on previous setting
      • 13: rotate with two lights
      • 14: persistent slow all blink
      • 15: blink once, then previous setting
  3. the generic event device
    • example fftest /dev/input/by-id/usb-*360*event*

Debugging

As a regular unpriveledged user

Setup console to display kernel log.
dmesg --level=debug --follow

Open a new console and access the device with jstest.
jstest /dev/input/jsX

Interact with the device and observe that data packets recieved from device are printed to kernel log.

[ 3968.772128] xpad-dbg: 00000000: 20 00 b5 0e 00 00 00 00 00 00 0c 03 04 fd 6c 01 40 fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3968.772135] xpad-dbg: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3968.804137] xpad-dbg: 00000000: 20 00 b6 0e 00 00 00 00 00 00 0c 03 04 fd 6c 01 fc fd 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3968.804145] xpad-dbg: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3969.152120] xpad-dbg: 00000000: 20 00 b7 0e 00 00 00 00 00 00 0c 03 04 fd 6c 01 b8 fd 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3969.152129] xpad-dbg: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Save dmesg buffer and attach to bug report, don't forget to describe button sequences in bug report.
dmesg --level=debug > dmesg.txt

Ctrl+C to close interactive console sessions when finished.

Sending Upstream

  1. git format-patch --cover-letter upstream..master
  2. git send-email --to xxx *.patch

More Repositories

1

gltut

Learning Modern 3D Graphics Programming
C++
1,442
star
2

artoolkitplus

ARToolKitPlus is a computer tracking library for creation of augmented reality applications
C++
79
star
3

ObjRecPoseEst

Object Detection and 3D Pose Estimation
Python
71
star
4

pose_calib

Efficient Pose Selection for Interactive Camera Calibration
Python
67
star
5

nv_dds

DDS image loader for OpenGL/ OpenGL ES2
C++
58
star
6

linemod_dataset

Hinterstoisser et al. ACCV12 dataset
Python
45
star
7

libraw.py

Python Bindings for libraw
Python
20
star
8

sensors.py

Python Bindings for libsensors
Python
18
star
9

arewedeadyet

chart for comparing the corona epidemic between different countries
HTML
15
star
10

glXXw

OpenGL loader for GL3 Core and GLES2/3 - like gl3w, but written in CMake
CMake
14
star
11

teatime

A simple egg timer application for Unity & Dash to Dock
Python
14
star
12

calibdb

web based camera calibration service - frontend
JavaScript
10
star
13

ZZIPlib

The ZZIPlib provides read access on ZIP-archives.
C
5
star
14

sensors-unity

A simple sensors GUI for Unity & Dash to Dock
Python
5
star
15

odrs-browser

Open Desktop Ratings online browser
HTML
3
star
16

ycbev

synchronized RGB-D frames and event data that enables evaluating 6DoF object pose estimation algorithms
Python
3
star
17

voxeliens

Voxeliens is a retro-style arcade shooter in which you defend your planet from waves of descending enemies. The gameplay is simple and fast paced as you battle your way through different environments using a variety of powerups.
C++
2
star
18

CoreGameEngine

Gaming engine built for Ogre3D and community technologies.
C++
2
star
19

polyvox

C++
1
star
20

OgreSceneNodeBenchmark

C++
1
star
21

ogrecascadedshadows

C++
1
star
22

sumwars

C++
1
star