DroidMote on Linux with Steam Games

Discussion about DroidMote Server for Linux
subcore
Posts: 1
Joined: Sun Oct 02, 2016 9:15 pm

DroidMote on Linux with Steam Games

Postby subcore » Sun Oct 02, 2016 9:51 pm

Hi everybody!

None of my Steam Games recognized the DroidMote Linux Server as Input Device, but I have found a solution using xboxdrv. I'm posting it here, in case someone has a similar problem.
This works for me in Ubuntu 16.04.

First, make sure you have the droidmote client and server set up correctly and connected. You can test that f.ex. with something like jstest-gtk.

The droidmote gamepad registers as /dev/input/jsX, jstest-gtk should find it even though Steam won't.
You can confirm the device number looking at /proc/bus/input/devices - it should contain something like:

Code: Select all

I: Bus=0003 Vendor=08fe Product=0929 Version=0004
N: Name="droidmote"
P: Phys=
S: Sysfs=/devices/virtual/input/input38
U: Uniq=
H: Handlers=sysrq rfkill kbd mouse1 event17 js1
B: PROP=0
B: EV=f
B: KEY=7fff000100070000 ffffffffffffffff ffffffffffffffff ffffffffffffffff fffffffffffffffe
B: REL=103
B: ABS=3003f

I: Bus=0003 Vendor=08fe Product=092a Version=0004
N: Name="droidmotemt"
P: Phys=
S: Sysfs=/devices/virtual/input/input39
U: Uniq=
H: Handlers=mouse2 event18
B: PROP=1
B: EV=b
B: KEY=400 0 0 0 0 0
B: ABS=260800000000003

I: Bus=0003 Vendor=08fe Product=092b Version=0004
N: Name="droidmotegt"
P: Phys=
S: Sysfs=/devices/virtual/input/input40
U: Uniq=
H: Handlers=mouse3 event19
B: PROP=2
B: EV=b
B: KEY=400 0 0 0 0 0
B: ABS=260800000000003


What we're looking for are the 'Handlers'. The gamepad registers as the first device, named 'droidmote'. so it's relevant handlers are, in my case, event17 and js1 (meaning /dev/input/event17 and /dev/input/js1, respectively).

We will use xboxdrv to simulate a game pad that steam games recognize:

Code: Select all

apt-get install xboxdrv


now, create a file (f.ex. evdev.xboxdrv) in your home directory or wherever you like and paste this xboxdrv-config into it:

Code: Select all

[xboxdrv]
evdev = /dev/input/event17

# set evdev-debug to true to see the actual Axis' names
# in case you want to create your own mapping.
evdev-debug = false

evdev-grab = false
mimic-xpad = true

detach-kernel-driver = true

[evdev-absmap]
ABS_HAT0X = X1
ABS_HAT0Y = Y1
ABS_X = LT
ABS_Y = X2
ABS_Z = Y2
ABS_RZ = RT

[evdev-keymap]
BTN_START = start
BTN_Z = back
BTN_Y = Y
BTN_X = X
BTN_TR = TR
BTN_TL = TL
BTN_B = B
BTN_A = A

KEY_LEFT = LEFT
KEY_RIGHT = RIGHT
KEY_UP = UP
KEY_DOWN = DOWN

# EOF #


enter your correct handler for 'evdev'.
this is a sample mapping and maps the accelerometer data to X1 and X2.
see /usr/share/doc/xboxdrv/examples or 'xboxdrv --help-all' for further info.

start xboxdrv with this config using:

Code: Select all

xboxdrv -c evdev.xboxdrv


now wait a few moments, for some reason it takes a little while for xboxdrv to recognize droidmote inputs. (a minute or so)

and that's all! you can verify that it works using jstest-gtk on the new, virtual gamepad device.

here's a quick'n'dirty shell script to automate the few steps to start it up. the script waits for you to hit 'enter' once your droidmote client is connected to the server - that has to happen before xboxdrv is started. the script assumes both the droidmote executable and the config file evdev.xboxdrv are in the current directory.

Code: Select all

#!/bin/bash
killall xboxdrv
killall droidmote
sleep 2s
droidmote 2302 asdf 2>&1 >/dev/null &
sleep 2s
read
xboxdrv -c evdev.xboxdrv 2>&1 >/dev/null &


have fun!

User avatar
zulu99
Site Admin
Posts: 2483
Joined: Tue Oct 09, 2012 6:42 am

Re: DroidMote on Linux with Steam Games

Postby zulu99 » Mon Oct 03, 2016 4:50 pm

Many thanks. Very useful.
Developer of DroidMote Server and DroidMote Client. Read the Quick Start Guides and then I'll be happy to help.
Donate with Paypal or Donate with Crypto

lawand
Posts: 1
Joined: Fri Feb 10, 2017 11:17 pm

Re: DroidMote on Linux with Steam Games

Postby lawand » Fri Feb 10, 2017 11:22 pm

Thanks for the info. Exactly what I needed :)

I have a question though, my phone is now recognized by steam as a controller, but now when I start the game (rocket league), both the controller and the keyboard control one player.. I was aiming to use my phone to control one player and the keyboard to control another..

Thanks in advance

User avatar
zulu99
Site Admin
Posts: 2483
Joined: Tue Oct 09, 2012 6:42 am

Re: DroidMote on Linux with Steam Games

Postby zulu99 » Sat Feb 11, 2017 5:33 am

lawand wrote:Thanks for the info. Exactly what I needed :)

I have a question though, my phone is now recognized by steam as a controller, but now when I start the game (rocket league), both the controller and the keyboard control one player.. I was aiming to use my phone to control one player and the keyboard to control another..

Thanks in advance


at system level, multiple clients connected are multiple physical keyboards and controllers.
the hardware keyboard of your pc is also another completly different keyboard, therefore should be the sofware / game that should be able to manage multiple controllers and keyboards.

On linux, in the past, i tested multiple controllers in some linux native games that support multiple controllers and everything work very well.
Developer of DroidMote Server and DroidMote Client. Read the Quick Start Guides and then I'll be happy to help.
Donate with Paypal or Donate with Crypto


Return to “DroidMote Server for Linux”

Who is online

Users browsing this forum: No registered users and 2 guests