Add GameMode support for Linux build #796

Merged
rluxv merged 17 commits from linux-gamemode into main 2023-05-11 01:19:44 -04:00
rluxv commented 2023-04-24 16:17:17 -04:00 (Migrated from github.com)

This PR would integrate FeralInteractive's GameMode support into Cemu, adding a setting that would allow gamemode to start automatically when Cemu runs.

Mentioned in #790, this could give a minor boost in performance to those with lower-spec computers.

This PR would integrate [FeralInteractive's GameMode](https://github.com/FeralInteractive/gamemode) support into Cemu, adding a setting that would allow gamemode to start automatically when Cemu runs. Mentioned in [#790](https://github.com/cemu-project/Cemu/issues/790), this could give a minor boost in performance to those with lower-spec computers.
qurious-pixel commented 2023-04-24 20:02:50 -04:00 (Migrated from github.com)

image

src/gui/CMakeLists.txt

if(ENABLE_FERAL_GAMEMODE)
	target_link_libraries(CemuGui PRIVATE gamemode)
endif()
![image](https://user-images.githubusercontent.com/62252937/234140421-b8dadcdf-0afd-4d13-9411-9ca68078e488.png) `src/gui/CMakeLists.txt` ``` if(ENABLE_FERAL_GAMEMODE) target_link_libraries(CemuGui PRIVATE gamemode) endif() ```
rluxv commented 2023-04-24 20:09:50 -04:00 (Migrated from github.com)

src/gui/CMakeLists.txt

if(ENABLE_FERAL_GAMEMODE)
	target_link_libraries(CemuGui PRIVATE gamemode)
endif()

Thanks!

> `src/gui/CMakeLists.txt` > > ``` > if(ENABLE_FERAL_GAMEMODE) > target_link_libraries(CemuGui PRIVATE gamemode) > endif() > ``` Thanks!
Exzap (Migrated from github.com) reviewed 2023-04-25 19:55:46 -04:00
Exzap (Migrated from github.com) commented 2023-04-25 19:52:55 -04:00
#if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE)

Imho it's more robust to check if ENABLE_FERAL_GAMEMODE is defined instead of checking if the value is non-zero since it's not assigned an explicit value.

```suggestion #if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE) ``` Imho it's more robust to check if `ENABLE_FERAL_GAMEMODE` is defined instead of checking if the value is non-zero since it's not assigned an explicit value.
Exzap (Migrated from github.com) commented 2023-04-25 19:53:13 -04:00
#if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE)
```suggestion #if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE) ```
Exzap (Migrated from github.com) commented 2023-04-25 19:53:27 -04:00
#if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE)
```suggestion #if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE) ```
deadmeu commented 2023-04-25 21:08:52 -04:00 (Migrated from github.com)

Thanks for implementing this @rluxv!
I haven't tested this yet but I do have some thoughts:

  • If the user doesn't have GameMode installed on their machine does the setting get disabled?
  • I would recommend changing the config name to "Enable Feral GameMode" (this is how it is commonly referred to in other programs). Given that it's Linux only, it might be a good idea to put "(Linux)" afterwards as well, or maybe in the tool tip?
  • It looks like you have some inconsistent indentation specifically in files CemuConfig.cpp/h and GeneralSettings2.cpp/h
Thanks for implementing this @rluxv! I haven't tested this yet but I do have some thoughts: - If the user doesn't have GameMode installed on their machine does the setting get disabled? - I would recommend changing the config name to "Enable Feral GameMode" (this is how it is commonly referred to in other programs). Given that it's Linux only, it might be a good idea to put "(Linux)" afterwards as well, or maybe in the tool tip? - It looks like you have some inconsistent indentation specifically in files `CemuConfig.cpp/h` and `GeneralSettings2.cpp/h`
rluxv commented 2023-04-25 21:14:56 -04:00 (Migrated from github.com)

Thanks for implementing this @rluxv! I haven't tested this yet but I do have some thoughts:

* If the user doesn't have GameMode installed on their machine does the setting get disabled?

* I would recommend changing the config name to "Enable Feral GameMode" (this is how it is commonly referred to in other programs). Given that it's Linux only, it might be a good idea to put "(Linux)" afterwards as well, or maybe in the tool tip?

* It looks like you have some inconsistent indentation specifically in files `CemuConfig.cpp/h` and `GeneralSettings2.cpp/h`

Hey!

  1. According to FeralInteractive, "Developers can integrate the request directly into an app. Note that none of these client methods force your users to have the daemon installed or running - they will safely no-op if the host is missing." The setting will still show up however.
  2. I can change the name, and the checkbox only shows up if you are on Linux, it checks that when you open the settings window.
  3. I'll fix that as well.

Thanks!

> Thanks for implementing this @rluxv! I haven't tested this yet but I do have some thoughts: > > * If the user doesn't have GameMode installed on their machine does the setting get disabled? > > * I would recommend changing the config name to "Enable Feral GameMode" (this is how it is commonly referred to in other programs). Given that it's Linux only, it might be a good idea to put "(Linux)" afterwards as well, or maybe in the tool tip? > > * It looks like you have some inconsistent indentation specifically in files `CemuConfig.cpp/h` and `GeneralSettings2.cpp/h` Hey! 1. According to FeralInteractive, ["Developers can integrate the request directly into an app. Note that none of these client methods force your users to have the daemon installed or running - they will safely no-op if the host is missing." ](https://github.com/FeralInteractive/gamemode/tree/master/lib)The setting will still show up however. 2. I can change the name, and the checkbox only shows up if you are on Linux, it checks that when you open the settings window. 3. I'll fix that as well. Thanks!
jn64 commented 2023-04-25 23:35:39 -04:00 (Migrated from github.com)

Is gamemode (the daemon package on distros) actually a build dep?

Does this start gamemode when Cemu starts? It should ideally only start gamemode when a game is loaded (and in the future when Cemu can stop emulation, it should stop gamemode as well).

Is `gamemode` (the daemon package on distros) actually a build dep? Does this start gamemode when Cemu starts? It should ideally only start gamemode when a game is loaded (and in the future when Cemu can stop emulation, it should stop gamemode as well).
rluxv commented 2023-04-26 09:17:41 -04:00 (Migrated from github.com)

Is gamemode (the daemon package on distros) actually a build dep?

Does this start gamemode when Cemu starts? It should ideally only start gamemode when a game is loaded (and in the future when Cemu can stop emulation, it should stop gamemode as well).

After some testing it seems like gamemode doesn't need to be installed to build (I had originally put it there just to be on the safe side). I'll revert the changes I made regarding that.

Yes, it starts gamemode when Cemu starts. I can update it so it starts only when you start a game but I'm not sure if that's necessary until Cemu can also stop emulation.

> Is `gamemode` (the daemon package on distros) actually a build dep? > > Does this start gamemode when Cemu starts? It should ideally only start gamemode when a game is loaded (and in the future when Cemu can stop emulation, it should stop gamemode as well). After some testing it seems like gamemode doesn't need to be installed to build (I had originally put it there just to be on the safe side). I'll revert the changes I made regarding that. Yes, it starts gamemode when Cemu starts. I can update it so it starts only when you start a game but I'm not sure if that's necessary until Cemu can also stop emulation.
deadmeu commented 2023-04-27 11:59:53 -04:00 (Migrated from github.com)

Yes, it starts gamemode when Cemu starts. I can update it so it starts only when you start a game but I'm not sure if that's necessary until Cemu can also stop emulation.

If you're able to update it I think it would be a good idea to make that change sooner rather than later to ensure it doesn't get accidentally forgotten about.

> Yes, it starts gamemode when Cemu starts. I can update it so it starts only when you start a game but I'm not sure if that's necessary until Cemu can also stop emulation. If you're able to update it I think it would be a good idea to make that change sooner rather than later to ensure it doesn't get accidentally forgotten about.
rluxv commented 2023-04-27 15:24:05 -04:00 (Migrated from github.com)

Yes, it starts gamemode when Cemu starts. I can update it so it starts only when you start a game but I'm not sure if that's necessary until Cemu can also stop emulation.

If you're able to update it I think it would be a good idea to make that change sooner rather than later to ensure it doesn't get accidentally forgotten about.

Sure. Working on that now.

> > Yes, it starts gamemode when Cemu starts. I can update it so it starts only when you start a game but I'm not sure if that's necessary until Cemu can also stop emulation. > > If you're able to update it I think it would be a good idea to make that change sooner rather than later to ensure it doesn't get accidentally forgotten about. Sure. Working on that now.
jn64 commented 2023-04-29 09:35:52 -04:00 (Migrated from github.com)

I tested 8b17d3e, works as expected. With this change, I guess the tooltip shouldn't say a restart is required?

I tested 8b17d3e, works as expected. With this change, I guess the tooltip shouldn't say a restart is required?
rluxv commented 2023-04-29 12:40:21 -04:00 (Migrated from github.com)

That would be correct, I'll update that.

That would be correct, I'll update that.
Exzap commented 2023-05-11 01:19:34 -04:00 (Migrated from github.com)

Looks good to me! Thanks for implementing this

Looks good to me! Thanks for implementing this
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: cemu-project_Mirror/Cemu-2024-03-05#796
No description provided.