ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.26k stars 175 forks source link

Spacemouse mapped to Virtual Joystick misdetected as XBox 360 Controller #9124

Open kermitfrog opened 1 year ago

kermitfrog commented 1 year ago

Your system information

Please describe your issue in as much detail as possible:

Spacemouse mapped to a Virtual Joystick is misdetected as XBox 360 Controller, causing some inputs to be unusable.

My assumption about the bug's cause is this: Steam does see a Joystick/Controller, but does not know what it is. So as a fallback it configures it as XBox 360. The problem here, is that anything on that device, not fitting a XBox Controllers input signals, is discarded.

Question: What exactly are the criteria to determine the kind of device in Steam Input?

Possible solutions (best use both..):

Background: The 3DConnexion Spacemouse is basically a 6-Axis Joystick. For some reason the driver reports it's events as REL instead of ABS (they clearly should be ABS) , which is why it needs to be remapped to a virtual joystick to be of any use. I use it to play X4: Foundations. This worked fine before, but after not playing for a month or so, now 2 of the axes are reported as triggers, making them only work as one direction.

As Steam Input reports the device as an XBox 360 Controller, which is clearly wrong, I suspect the cause there.

Steps for reproducing this issue:

The easiest is probably to create a virtual device via uinput, which I assume, Steam Input developers know how to do.

An alternative (if you have a SpaceMouse) is this. Personally I'm using inputmangler - but that should not make any difference.

Appendix: SpaceMouse, Virtual Joystick & real XBox 360 Controller as seen in /proc/bus/input/devices

I: Bus=0003 Vendor=256f Product=c635 Version=0111    
N: Name="3Dconnexion SpaceMouse Compact"    
P: Phys=usb-0000:00:14.0-5.4/input0    
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.4/1-5.4:1.0/0003:256F:C635.0009/input/input43    
U: Uniq=    
H: Handlers=event7 leds     
B: PROP=0    
B: EV=20017                           
B: KEY=3 0 0 0 0    
B: REL=3f       
B: MSC=10    
B: LED=100

I: Bus=0003 Vendor=0000 Product=0000 Version=0001    
N: Name="Virtual Joystick/Gamepad"    
P: Phys=    
S: Sysfs=/devices/virtual/input/input70    
U: Uniq=    
H: Handlers=event21 js0     
B: PROP=0    
B: EV=b    
B: KEY=c000000000 0 0 0 0    
B: ABS=ff    

I: Bus=0003 Vendor=045e Product=028e Version=0110    
N: Name="Microsoft X-Box 360 pad"    
P: Phys=usb-0000:00:14.0-5.2/input0    
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.2/1-5.2:1.0/input/input71    
U: Uniq=    
H: Handlers=event22 js1     
B: PROP=0    
B: EV=20000b    
B: KEY=7cdb000000000000 0 0 0 0    
B: ABS=3003f    
B: FF=107030000 0    
kisak-valve commented 1 year ago

Hello @kermitfrog, this looks like a libSDL issue which should also be mentioned upstream (https://github.com/libsdl-org/SDL).

kermitfrog commented 1 year ago

You might be right.

So steam uses libSDL as a backend for input?

There is an entry it the changelog for 2.26.0 (Nov 22), hinting at changes that might have caused this:

Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 to control whether the HIDAPI driver for XBox 360 controllers should be used

I tried to verify this by replacing ~/.local/share/Steam/ubuntu12_32/libSDL2-2.0.so.0 with my systems version, but steam seems to have an auto-repair feature and replaced it back with it's own version on startup. Is there a way to disable this?

I will look at the libSDL code.

Balderick commented 1 year ago

after changing sdl libraries you could use -noverifyfiles when launching steam so that it will start.

"Question: What exactly are the criteria to determine the kind of device in Steam Input?"

Now that is a good question. imo Steam users should choose which devices get listed in controller settings not Steam Input. Define Layout used to allow setting of any supported controller type to any detected controller. But it is broken. There is new test and define layout tools in newbigpicture but there is no option to set saved controller layout as any controller type at all - Steam Input decides. But it is broken too. You should try those tools and make appropriate bug reports for those issues.

What you are describing remionds me of what i used to with steering wheel buttons. Steam Input would detect it as xbox controller and if i Defined Layout and saved as ps2 type controller i could use wheel base buttons to navigate big picture out with game. All i had to do to get steering wheel speaking to proprietary drivers for force feedback etc in ghames that supported it was disable Steam Input for game. This added huge immersion to VR sim racing as it meant i just needed steering wheel to do everything once gaming session had started. I think this is all you need to do get your space mouse/virtual joystick working both in bigpicture ui and in game like what is needed.

At least your device does not get blacklisted by Steam Input like my steering wheel and you at last have the choice to setup Steam Input appropriately for your needs.

Much more than just sdl stuff going on thats for sure. Steam Input has been gimped compared to what it used to work like.

kermitfrog commented 1 year ago

after changing sdl libraries you could use -noverifyfiles when launching steam so that it will start.

Thanks. Unfortunately steam quit itself with the message "steamui.so: undefined symbol: SDL_GetJoystickGUIDInfo", so older versions won't work :/

[..] imo Steam users should choose which devices get listed in controller settings not Steam Input.

Not sure, this is the best way. I believe Steam Input lists everything that shows up as /dev/input/js* and is not grabbed by another process. If it works perfectly, that would be fine. The problem is that right now some inputs of these devices can't be used at all... Lower level remapping, like turning a mouse into a joystick is probably better left to other tools.

Define Layout used to allow setting of any supported controller type to any detected controller. But it is broken.

Yeah.. if I could do this, it would probably solve my problem.

At least your device does not get blacklisted by Steam Input like my steering wheel and you at last have the choice to setup Steam Input appropriately for your needs.

Is your steering wheel listed in /dev/input/js* ? If not, what are it's capabilities? (entry in /proc/bus/input/devices)

Balderick commented 1 year ago

Thanks for trying to help but i use windows. Just found a logitech g29 user confirms steering wheel and pedals are detected by Steam Input as what appears to be a new supported controller type called "usb game controllers" Here is open bug report on steam for steam not showing Thrustamster T500 RS as detected device . https://steamcommunity.com/groups/SteamClientBeta/discussions/0/3763356923841756034/ Steam SDL should just grab any detected device seen by operating system but it isnt especially for devices that used be just detected as generic gamepad. Steam SDL aka Steam Input is not detecting 8Bit Pro 2 set to dinput mode as ps3 type controller any more and just gets detected as generic gamepad. Setting ps3 controller type in define layout ui is also now completely broken. broken for controllers that are detected as generic gamepad. The thread open for that can be found at https://steamcommunity.com/groups/SteamClientBeta/discussions/3/3763356482614563631/

Steam SDL has lost all of its configurability for me. Very frustrating. Just feels like everything is hardcoded by Valve nowadays which would be fine if their coding worked like expected. But it falls well short of being usable ootb. Nothing is working like expected and cant be configured manually because of the the broken stuff. Bug "fixes" provided by Valve quickly get broken again with next update.

Although i can see what is described in op is directly related to the issues i am seeing on Steam for windows must apologise for derailing this thread and the suggested -noverifyfiles didnt help out.