m4dEngi / RemotePlayWhatever

Tiny application that lets you force remote play together any game you have in your steam library including non-steam ones.
MIT License
1.02k stars 38 forks source link

[Request] Make this work with Steam Deck in Game Mode #58

Closed Ihmoda closed 1 year ago

Ihmoda commented 2 years ago

This is awesome stuff and would be really handy for the Steam Deck. Issue is that the current implementation doesn't seem to work in Game Mode on the Steam Deck (no way to create a link / invite a friend).

I was able to build the app and launch it on the Steam Deck in Desktop Mode, but I'm unfortunately running into a bug reported in a separate issue that is preventing me from creating links or inviting friends.

Below are the steps I took to build the project, might be helpful to add this to the Wiki or README at some point if you get questions on Steam Deck Support.

Steps to Build with Steam Deck:

1) Hold power button and select “Switch to Desktop”

2) In bottom left (start button location) click the steam icon and select applications -> console. This will bring up a terminal that you can use to enter the commands presented in later steps.

3) If you have not already, use passwd to create a password for the deck user.

passwd

4) Disable read-only mode:

sudo btrfs property set -ts / ro false

5) Initialize the pacman keyring:

sudo pacman-key --init

6) Populate the pacman keyring with the default Arch Linux keys:

sudo pacman-key --populate archlinux

7) Install Needed Dependencies

sudo pacman -S base-devel
sudo pacman -S cmake
sudo pacman -S glibc linux-api-headers
sudo pacman -S wxgtk2
sudo pacman -S wxgtk3
sudo pacman -S wxgtk-common

8) Now that you have required dependencies, you can follow the normal Linux instructions for building the app.

m4dEngi commented 2 years ago

This might require way more work than just getting SteamOS image running in VM... Would be nice feature to have tho. I'll think about it.

Ihmoda commented 2 years ago

Yeah, there is an unofficial ISO for SteamOS that might be useful for development https://github.com/theVakhovskeIsTaken/holoiso.

Might be as simple as providing a window for the app instead of running from system tray as you can't see the tray in game mode.

There are hacks out there to quickly switch to desktop mode from game mode https://old.reddit.com/r/SteamDeck/comments/uddyat/desktop_mode_within_gaming_mode/

So perhaps making this work with Game Mode isn't a huge deal. Probably more important would be supporting Flatpak or AppImage format because the SteamOS 3.0 operating system on the deck is immutable and new packages added by the user manually get wiped with system updates.

jakequi commented 1 year ago

Just a bump, with the creation of the new AppImage, and it working seamlessly deck to deck (as long as one is in Desktop Mode) - it seems all that is needed for it to work in Game Mode is a small UI from which to invite friends rather than just being a systray, then it'll be fully supported

m4dEngi commented 1 year ago

https://github.com/m4dEngi/RemotePlayWhatever/issues/7#issuecomment-1042865156 You can use this old method with non-steam games on deck btw Just need to change "START IN" property for non-steam shortcut to point to some other location inside /home/deck/ and create steam_appid.txt there.

so it'll be something like this:

Add https://store.steampowered.com/app/1853840/Polygunners/ to your library (or any other game that support RPT and controller)

  1. Add a non-steam game to your library
  2. Create a new folder inside /home/deck/ and call it let's say fakeapp
  3. Create a text file steam_appid.txt inside /home/deck/fakeapp with only text 1853840 for Polygunners
  4. In non steam game properties in steam library set START IN to point to /home/deck/fakeapp instead of './'
  5. Start the game from steam library and send invites to your friends like you would normally do with supported game, you don't even need RemotePlayWhatever or going through tedious process of downloading and replacing game files...
joamjoamjoam commented 1 year ago

Hmm if I was to create a Decky Loader plugin for this, would you recommend using the workaround listed above or a UI to replace the systray?

jakequi commented 1 year ago

Hmm if I was to create a Decky Loader plugin for this, would you recommend using the workaround listed above or a UI to replace the systray?

Definitely the UI in my opinion! The workaround above doesn't work with Yuzu and many other emulators. A Decky loader plugin would be perfect

joamjoamjoam commented 1 year ago

The UI is doable I think. I'll review the code tonight after work and see how I can hook in.

joamjoamjoam commented 1 year ago

Hmm from what i can see there is no interprocess communication available. Is there a CLI that csn be used to hook a game?

Tbh it looks like the workaround is the right solution as it prevents client updates from breaking RPW and its seamlessly built into the UI already.

If yuzu doesnt work im not sure it would work if made a UI anway since that is likely due to rpw not being able to hook into it.

jakequi commented 1 year ago

Go ahead! Give it a go

Ihmoda commented 1 year ago

@m4dEngi

With AppImage, I've pretty much got everything to work including Yuzu with EmulationStation (including controls). Bummer that future steam client updates will break RPW as this + EmulationStation on the Steam Deck is truly game-changing. @m4dEngi Is it pretty much guaranteed that RPW will break with the next client update?

I started with the "conventional" workaround, and it is pretty cool that it allows you to use the Steam Deck's native RemotePlayTogether UI to invite friends. Problem is that I couldn't get it to work with EmulationStation, RA, Yuzu, and many other emulators. The other issue is that it's a bit janky to setup and not exactly a seamless experience.

The dream would be if we could bundle RPW with EmuDeck to create a user-friendly way to play classic games with your friends that just works. The only real hurdles I see to that are Steam Client update breakages as well as the inability to generate links/invites from within the Steam Deck UI.

There are some plugin frameworks for Steam Deck that might make this possible:

https://crankshaft.space/ https://github.com/SteamDeckHomebrew/decky-loader

Another option would be if the RPW had a version that provided a full UI. Then maybe it would be possible to add RPW as a non-steam game.

Of course, not sure if either method is feasible as things currently stand.

m4dEngi commented 1 year ago

@Ihmoda it's almost guaranteed that RPW will break on steam client update right now. RPW uses client internal unversioned interfaces to force create remote play sessions.

I'm working on a new UI, but i don't think there's anything we can do about client updates breaking the app. And the fact that deck and desktop clients versions are different makes maintaining it a little bit complicated...

Ihmoda commented 1 year ago

That is a shame, but it seems like it's possible to update along with the clients.

For the Steam Deck client, are the interfaces captured anywhere (i.e. https://github.com/m4dEngi/open-steamworks). I don't know C++ but I'm interested in poking around to see what APIs might be available for Steam Deck specifically.

joamjoamjoam commented 1 year ago

If we can add a way to communicate between processes like a local socket or a command line interface i could make a decky loader plugin to show the ui. The best way would still be to use the workaround listed above if you could get it to work.

Its possible that the yuzu window is grabbing the main focus have you tries launching a game directly via command line ans adding that as a non steam game

giodude12 commented 1 year ago

Could this possibly be turned into a decky plugin to work in game mode?

m4dEngi commented 1 year ago

New reworked UI is here https://github.com/m4dEngi/RemotePlayWhatever/releases/tag/0.2.0-pre-alpha . Needs some testing and improvement suggestions.

Ihmoda commented 1 year ago

@m4dEngi Thanks for this, super cool!

On the Steam Deck, I was able to add the AppImage as a non-Steam game and then launch it within game mode. Once in game mode I was able to successfully create a shared session and join on my PC and then switch over to EmulationStation. What's really amazing is that once the session is created the RemotePlayTogether native UI works on the Steam Deck.

One issue within game mode - doesn't seem that I'm able to exit the RemotePlayTogether app without restarting the Steam Deck -- it just spins and can't seem to force close it.

Also tested on desktop mode and things seem to be working as expected.

One other note -- I tested with my Razr Kishi in game mode and wasn't able to get XInput. However, Kishi continues to work in Desktop mode and I could connect to a PC with an Xbox controller.

Ihmoda commented 1 year ago

I'm going to go ahead and close the issue, as it's now technically possible to use this within Desktop game mode. Separate issue for not being able to close RemotePlayWhatever App within Steam Deck gamemode.

thanone2 commented 2 months ago

all i did was put the appimage into steam