FrogTheFrog / moondeck

A plugin that makes it easier to manage your gamestream sessions from the SteamDeck.
GNU General Public License v3.0
128 stars 7 forks source link

Share steamdeck's controller? #64

Open djmulder opened 2 days ago

djmulder commented 2 days ago

So moonlight will not properly share the controller of the steamdeck. Stuff like gyro is not working. Making moonlight great but not perfect.

Is there a way to add usb sharing like usb/ip or virtualhere to moondeck's startup? And if the game isn't connected anymore, also disconnect the USB? (I think this last one is the hardest)

FrogTheFrog commented 2 days ago

Moonlight can detect SteamDeck controller, however Steam prevents Moonlight from seeing it in gamemode (it instead exposes it as xbox controller). I tried enabling it, but then it caused weird issues, like double input and so on.

Would usb/ip even work for a SteamDeck controller?

djmulder commented 2 days ago

Virtualhere works and properly attaches the controller.

I haven't tried usb/ip itself yet, I did get it to install. Need to make the file system not read only to get the package manager to work

FrogTheFrog commented 2 days ago

You can provide custom Moonlight executable btw, it can also be a script. I'll check if maybe Moonlight no longer gets double input when forcing it to use SteamDeck controller directly.

FrogTheFrog commented 2 days ago

Still broken. You can use this script to play around yourself:

#!/bin/bash

SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD=0 SDL_GAMECONTROLLER_IGNORE_DEVICES="0x28de/0x11ff" /usr/bin/flatpak run com.moonlight_stream.Moonlight "$@"

In the logs you'll see that Moonlight is reading SteamDeck controller directly, but it's still broken in gamemode somehow.

Use this to ignore input from it completely. This way you could try to get the usb/ip or virtualhere working:

#!/bin/bash

SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD=0 SDL_GAMECONTROLLER_IGNORE_DEVICES="0x28de/0x11ff,0x28de/0x1205" /usr/bin/flatpak run com.moonlight_stream.Moonlight "$@"
djmulder commented 1 day ago

Hmm I got this to work fine if in Apollo (fork of Sunshine with virtual displays built in) I set the controller to Playstation.

Could it just be a shear lack of driver/library in Sunshine/Apollo?

FrogTheFrog commented 1 day ago

Hmm I got this to work fine if in Apollo (fork of Sunshine with virtual displays built in) I set the controller to Playstation.

Could it just be a shear lack of driver/library in Sunshine/Apollo?

How does it work fine? What did you do?

djmulder commented 1 day ago

I added that first script of yours as custom moonlight executable and in Apollo I went to: configuration -> input and changed "Emulated Gamepad Type" from Xbox 360 to automatic. Left all the other settings to default:

Screenshot_20241118-174457

I can use all buttons and gyro. tho dpad and the "open menu" button are mismapped (dpad up seems mapped to "open menu" and open menu to screenshot)

FrogTheFrog commented 1 day ago

Why do I get double input in this case then 🤔? Well, at least it works for you.

djmulder commented 1 day ago

Hmm i will do more testing. Perhaps it's situational. And yeah it works but yeah my ocd doesn't like the Playstation images on my buttons haha