Steam Deck

Steam Deck

X_NRG Jul 5, 2022 @ 10:28am
Desktop mode without closing running game
Hello,

I am wondering whether it is possible to NOT close the game you have running in Game mode, when you want to switch to desktop mode on the Steam Deck.
The usecase is simple: I am playing a game, that I had previously run in Game mode, then (for whatever reason) I wish to enter desktop mode and preserve the game running.
My experience with the latest Stable branch is that when you switch to Desktop mode, any running game in Game mode is automatically closed, which can be inconvenient for some games that do not have mid-level checkpoints and you have to start the level all over from the beginning.
I found out about this script, which runs the Plasma desktop environment as a non-Steam application from within Game mode, so I know it is possible to achieve what I need, but now I wonder why it has not already been implemented that way.

Thanks!
< >
Showing 1-10 of 10 comments
Clone303 Jul 5, 2022 @ 10:29am 
it would be hard to do for it's 2 modes
X_NRG Jul 5, 2022 @ 10:34am 
Originally posted by Clone303:
it would be hard to do for it's 2 modes
Of course I forgot to post the link to the reddit post with the script I mentioned in my original post: https://reddit.com/r/SteamDeck/comments/uddyat/desktop_mode_within_gaming_mode/

Here it is mentioned that it is possible to run the desktop alongside the games you have running in Game mode, but I wish to hear a possible explanation for why the current Desktop mode implementation has the necessity to close the running games. For sure I am missing something. :)
Nathan Jul 5, 2022 @ 10:57am 
Why not just play in desktop mode? The point of game mode is to intentionally kill everything from desktop mode. This whole concept seems redundant.
X_NRG Jul 5, 2022 @ 11:29am 
Originally posted by Nathan:
Why not just play in desktop mode? The point of game mode is to intentionally kill everything from desktop mode. This whole concept seems redundant.
I believe Desktop mode is not yet polished enough and has its issues, plus, the default mode is the Game mode, which is definitely more convenient for launching games on the Deck and just works flawlessly out of the box now. This is not the point, though.
You may have misunderstood me, but my issue is not with Game mode killing Desktop mode apps, but the other way around. I don't find it necessary, since Desktop mode is supposed to run a lot of stuff in parallel and I don't understand the prerequisite to start clean.
This is why my question still stands.
Originally posted by X_NRG:
Originally posted by Clone303:
it would be hard to do for it's 2 modes
Of course I forgot to post the link to the reddit post with the script I mentioned in my original post: https://reddit.com/r/SteamDeck/comments/uddyat/desktop_mode_within_gaming_mode/

Here it is mentioned that it is possible to run the desktop alongside the games you have running in Game mode, but I wish to hear a possible explanation for why the current Desktop mode implementation has the necessity to close the running games. For sure I am missing something. :)
As I understand they're technically two different users. They might share a home directory though as games in game mode can see files that you've put onto the desktop in desktop mode.

I should clarify, the reason this is important is that they're likely logging the game mode user out when switching to desktop. Logging out typically kills all running processes for that user.
Last edited by Man's Best Friend; Jul 5, 2022 @ 1:05pm
retrogunner Jul 5, 2022 @ 7:06pm 
So here's the short short version (as I've gather from other sources):
* Game mode - uses Wayland (with Gamescope) and is tuned so it appears at 8 cores due to game engines (4 core * 2 threads) - allowing some games to use 6 or so "cores".
* Desktop mode - uses Xorg (with X11) and the CPU appears as the genuine 4 core with 2 threads each.

There is the hack script to launch Desktop mode as a Non-Steam game. But as indicated, YMMV. You cannot do the same from Desktop mode - you just get the Steam Client.

When you switch Game<>Desktop mode, it shut downs services and starts others - such as the display compositors, etc.

If you play games in the Desktop mode, you will likely see performance hits for both video and CPU. Plus, you loose access to the Gamescope perf controls. There may also be graphic performance hits around vulkan or the lack there-of.

And this should all be as the 'deck' linux account as Steam directory in /home/deck/ houses all the steam user data, common directory (game installs), etc.
Last edited by retrogunner; Jul 5, 2022 @ 7:09pm
X_NRG Jul 5, 2022 @ 11:54pm 
Thanks for the detailed explanation, @retrogunner.
If I understand correctly, when I start the Xorg desktop via the script, I'm just going to have the overhead of all the extra running services, but if I still launch the games via game mode, even if desktop mode is running in the background, the games would still see 8 cores exposed. Am I right?
Then in this case, the Steam client in the desktop mode, I suppose, is still going to see 4 cores x 2 threads each and it is not the preferred way to run games unless you want to fiddle with the game resolution, let's say when using external monitor.

Thanks again.
ReBoot Jul 6, 2022 @ 12:07am 
Have you tried running why ever you need the desktop from Steam? I've been using TeamSpeak & Edge this way.
retrogunner Jul 6, 2022 @ 9:36am 
(I've not played with the hackneyed script yet but as a experienced user/admin)

When using the script to run "desktop" in Game mode, you don't start any duplicate system services or daemons. There could be a second Steam client instance but I don't think so given Steam is a singleton application (one instance only).

But, you would be running a new instance of the entire KDE Desktop X11 application environment along with the game. This isn't so bad. In the X11 world, we have a utility called Xnest that does a similar thing. If you're not running a multicore-aware game with the hack, I don't suspect you'll see a performance hit. Even if you are, so long as they don't push past "4 cores" in game mode, you should still be fine.

Regarding Game mode cores, it's all a matter of how the total cpu thread count is - that is how many "active"kernel processes can run. Games are finicky, highly (or poorly) tuned programs. Whereas most desktop/general purpose apps are less so. They tend to care more about threads vs core count. This is why Valve presents Game mode a total of 8 threads as 8 cores vs 4 core w/ 2 threads each. As you noted, if you run Steam in Desktop mode, games will only see a max of 4 cores & 2 threads. So, play games in Game mode for the best performance.

Even in Game mode, you can still use an External monitor and adjust the resolution. I have. When using an external monitor, just be aware of your Refresh rate. You cannot use the 40hz/40fps setting on a 60hz TV/monitor -- unless it supports a variable refresh rate. If you play on a 1080P 60Hz TV, you may need a 30 FPS cap to improve game performance when using game graphic settings higher than medium-high.

As @ReBoot above mentions, it's better that you use single desktop apps in game mode instead. By far the easiest & dynamic way to do this using flatpaks and Decky Loader:
https://github.com/SteamDeckHomebrew/decky-loader
with
https://github.com/Fisch03/SDH-QuickLaunch

If you install Decky Loader, it has a plugin manager so you can install them directly from https://plugins.deckbrew.xyz . The SDH-QuickLaunch plugin presents all your installed Flakpaks in game mode - no more adding a Non-Steam game for each one.

(Flatpaks can be found in the Discovery software manager or you can check it at https://flathub.org )

Cheers, retro
X_NRG Jul 6, 2022 @ 2:25pm 
Thanks a lot, my friend! This is one great explanation! :) I'll check out the links you provided.
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Jul 5, 2022 @ 10:28am
Posts: 10