kozec / sc-controller

User-mode driver and GTK3 based GUI for Steam Controller
GNU General Public License v2.0
1.52k stars 129 forks source link

XBox controller mode not working #479

Open h-2 opened 5 years ago

h-2 commented 5 years ago

I have two computers I am using my steam controller with. One runs some recent Ubuntu release and sc-controller works without problems. The other is a recent Devuan GNU/Linux with the following uname:

Linux debian 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5 (2019-06-19) x86_64 GNU/Linux

On this system the "Keyboard+Mouse" mode works flawlessly, but the Xbox-Emulation mode is not detected by any of the games I tried. The sc-controller interface appears like everything is fine, switching between profiles works, everything looks "right", but the games simply don't detect a controller when in Xbox-mode.

Another thing that I noticed is that on the Ubuntu computer when switching to Xbox-Profile the right touch-pad of the controller becomes silent (the one that emulates the mouse in Desktop-Profile) while on the Devuan computer there is still the rumble-effect after switchting to the Xbox-Profile.

This is the dmesg displayed when plugging in the controller while sc-controller is running and set to Xbox-profile:

[ 2720.116281] usb 1-13: new full-speed USB device number 37 using xhci_hcd
[ 2720.443465] usb 1-13: New USB device found, idVendor=28de, idProduct=1102, bcdDevice= 1.00
[ 2720.443468] usb 1-13: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2720.443469] usb 1-13: Product: Wired Controller
[ 2720.443470] usb 1-13: Manufacturer: Valve Software
[ 2720.465493] input: Valve Software Wired Controller as /devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-13/1-13:1.0/0003:28DE:1102.00AE/input/input158
[ 2720.524290] hid-steam 0003:28DE:1102.00AE: input,hidraw5: USB HID v1.11 Keyboard [Valve Software Wired Controller] on usb-0000:02:00.0-13/input0
[ 2720.531356] input: Valve Software Wired Controller as /devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-13/1-13:1.1/0003:28DE:1102.00AF/input/input159
[ 2720.531588] hid-steam 0003:28DE:1102.00AF: input,hidraw6: USB HID v1.11 Mouse [Valve Software Wired Controller] on usb-0000:02:00.0-13/input1
[ 2720.539523] hid-steam 0003:28DE:1102.00B0: hiddev2: USB HID v1.11 Device [Valve Software Wired Controller] on usb-0000:02:00.0-13/input2
[ 2720.539625] hid-steam 0003:28DE:1102.00B1: hidraw7: USB HID v1.11 Device [Valve Software Wired Controller] on usb-0000:02:00.0-13/input2
[ 2720.545200] hid-steam 0003:28DE:1102.00B0: Steam Controller 'FC60123098' connected
[ 2720.554245] input: Steam Controller as /devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-13/1-13:1.2/0003:28DE:1102.00B0/input/input160
[ 2721.008005] hid-steam 0003:28DE:1102.00B0: Steam Controller 'FC60123098' disconnected

Note that although it says "disconnected" last, it works fine in Desktop-Profile.

Anything I can do to debug this further?

Thanks for providing this useful tool!

h-2 commented 5 years ago

Tested with 0.4.6.1 and latest master branch.

kozec commented 5 years ago

Check if there really is not any mention of SC-Controller in dmesg at all. If keyboard & mouse emulation works, there should be at least something like:

[693212.498933] input: SC Controller Mouse as /devices/virtual/input/input1545
[693212.499318] input: SC Controller Keyboard as /devices/virtual/input/input1546

and this line for gamepad emulation:

[693212.498757] input: Microsoft X-Box 360 pad as /devices/virtual/input/input1544

To check for errors from sc-controller, turn off emulation from menu and run scc-daemon debug from terminal.

h-2 commented 5 years ago

Thank you for the quick reply!

Yes, I have those lines, too, they are added when running SC Controller (independent of whether a controller is plugged in):

[   54.781549] input: SCController Keyboard as /devices/virtual/input/input17
[   54.781783] input: SCController Mouse as /devices/virtual/input/input18
[   54.782234] input: Microsoft X-Box 360 pad as /devices/virtual/input/input19

This is the output of running the daemon with debug in foreground:

D SCCDaemon     Starting SCCDaemon...
D SCCDaemon     Initializing drivers...
W SCCDaemon     Skipping disabled driver 'fake'
W SCCDaemon     Skipping disabled driver 'remotepad'
W evdev         Failed to enable Evdev driver: 'python-evdev' package is missing.
D USB           Registered USB driver for 054c:09cc
D USB           Registered USB driver for 28de:1102
D USB           Registered USB driver for 28de:1142
W DevMon        Failed to load libbluetooth.so, bluetooth support will be incomplete
D Mapper        Creating virtual devices
D Mapper        Keyboard: <scc.uinput.Keyboard object at 0x7f3cfa17a890>
D Mapper        Mouse:    <scc.uinput.Mouse object at 0x7f3cfa17ad10>
D Mapper        Gamepad:  <scc.uinput.UInput object at 0x7f3cfa17ab90>
D SCCDaemon     Created control socket /home/hannes2/.config/scc/daemon.socket
D SCCDaemon     Connected to XServer :0.0

(scc-osd-daemon.py:4254): Gtk-WARNING **: 11:25:04.882: Locale not supported by C library.
    Using the fallback 'C' locale.

(scc-osd-daemon.py:4254): dbind-WARNING **: 11:25:04.884: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
D SCCable       Got wired SC with serial 1:14
D USB           USB device added: 28de:1102
D SCCDaemon     Assigned default_mapper to <SCByCable sc1:14>
D SCCDaemon     Controller added: <SCByCable sc1:14>
D OSD DaemonCtrl    Connected to daemon, version 0.4.6
D OSD DaemonCtrl    Daemon reported profile change for sc1:14: /home/hannes2/devel/sc-controller/default_profiles/XBox Controller.sccprofile
D OSD DaemonCtrl    Daemon is ready.
I SCCDaemon     Registered scc-osd-daemon
I OSD osd.daemon    Sucessfully registered as scc-osd-daemon
W SCCDaemon     Refused 'Observe' request: Sniffing disabled

BTW, I have also blacklisted hid_steam as is recommended in some places, but it doesn't change the behaviour.

kozec commented 5 years ago

Ok, so it looks like emulation does work. Can you check with jstest-gtk (or jstest or anything similar) just to be sure? It should show "Microsoft X-Box 360" that reacts when XBox mode is activated.

If that works, next suspect is game you are playing. Can you give example of some? Are you using any sandboxing, flatpack or similar mess?