来自 Arch Linux 中文维基

Gamescope 是来自 Valve 并用于 Steam Deck微混成器. 其目标是提供一种针对游戏量身定制的独立合成器,并支持许多以游戏为中心的功能,例如:

  • 分辨率伪装.
  • 使用 AMD FidelityFX™ Super Resolution 或 NVIDIA Image Scaling 进行图像上采样.
  • 限制帧率.

作为一个微混成器,它被设计为在现有桌面环境之上作为嵌套会话运行,尽管也可以将其用作嵌入式混成器。

安装

Gamescope 可以通过 gamescope包或gamescope-gitAUR安装。另外,还有gamescope-plusAUR包提供了包含不在主线版本中的一些额外补丁的版本。

安装要求

  • AMD: Mesa 20.3 或更高
  • Intel: Mesa 21.2 或更高
  • NVIDIA: 专有驱动 515.43.04 或更高,以及 nvidia-drm.modeset=1 内核参数

使用

Gamescope 有很多选项。可以通过在终端执行 gamescope --help 命令获取完整选项列表。

运行桌面环境

下面的命令会用 Gamescope 运行 supertuxkart,强制使用 1920x1080 60 FPS分辨率。

$ gamescope -W 1920 -H 1080 -r 60 -- supertuxkart

运行Steam

你可以通过下面的命令强制 Steam 通过 Gamescope 运行:

$ gamescope -e -- steam
注意: 标志 -e 告诉 Gamescope 启用 Steam Integration.

你也可以通过添加以下游戏启动参数,用 Gamescope 运行 Steam 上的游戏

gamescope -- %command%
注意: 从Steam启动时,仍然需要设置分辨率、FPS等标志,否则Gamescope将以不正确的分辨率启动。例如,您可以通过与从终端相同的方式执行此操作
gamescope -W 1920 -H 1080 -r 60 -- %command%

运行Wine

当使用 Gamescope 通过 Wine 运行程序时,简单地用 wine 加上可执行程序名称即可。

$ gamescope -W 1920 -H 1080 -r 60 -- wine supertuxkart

几乎全部流行的 Wine 管理器都支持 Gamescope,例如 LutrisBottles,和 PlayOnLinux。使用它们就像安装所需的 Gamescope 软件包并检查“使用Gamescope”(或类似)选项一样简单。

注意: Wine 管理器还倾向于使用GUI界面来配置基本的Gamescope选项,这使它们成为使用Gamescope的最简单方法。

运行Flatpak

您也可以将 Gamescope 与FlatpakSteam提供的Wine管理器一起使用,方法与安装软件包相同。但是,它要求您首先使用以下命令从Flathhub安装Gamescope:

$ flatpak install gamescope

上采样

可以用 -F fsr-F nis 标志对游戏分别使用 AMD FidelityFX™ Super Resolution 1.0 (FSR) 或 NVIDIA Image Scaling v1.0.3 (NIS) 进行上采样。你也可以用 -S integer 进行整数上采样,或者用 -S stretch 拉伸画面.

使用 FSR 将 720p 游戏上采样至 1440p :

$ gamescope -h 720 -H 1440 -F fsr -- supertuxkart

使用 NIS 在内部以 1080p 分辨率运行游戏但是以 4K 显示:

$ gamescope -w 1920 -h 1080 -W 3840 -H 2160 -F nis -- supertuxkart

低分辨率的游戏通常默认在全屏上使用线性过滤,有时会被拉伸。这在经典的JRPG中尤为明显。要获得像素化外观并保持纵横比:

$ gamescope -F nearest -S fit -- tecnoballz

在游戏运行时调整使用的滤镜:

  • Super+n 切换最近邻采样。
  • Super+u 切换FSR上采样。
  • Super+y 切换NIS上采样。
  • Super+i FSR锐度加1。
  • Super+o FSR锐度减1。

HDR 支持

Gamescope is a requirement for HDR10 support when playing games, to make use of this feature you must launch your Gamescope session using the --hdr-enabled flag.

注意: Linux上的HDR支持仍处于起步阶段,有许多需要注意的地方。有关详细信息,请参阅HDR monitor support

Wayland 支持

Gamescope 默认不支持 Wayland 客户端。要启用对 Wayland 客户端的支持,请给 Gamescope 启动参数加上 --expose-wayland 标志。

SDR 增益范围

Since SteamOS 3.5.5, Valve has changed the default color rendering for the Steam Deck LCD. The effect is achieved through Gamescope by changing the "wideness" of the gamut for SDR content, which can result in a warmer and more vibrant color appearance depending on the adjustment.

In a Steam game's launch options, simply add --sdr-gamut-wideness followed by a value that's equal or between 0-1:

gamescope --sdr-gamut-wideness 1 -- %command%

常见问题

切换至全屏模式后性能降低

当使用Gamescopes全屏热键 Meta+f 时,这是一个已知的错误,如果你遇到这个问题,可以在启动游戏时使用全屏标志 -f 来解决。

设置 Gamescopes 优先级

另一个已知的低性能或卡顿的原因是没有正确设置Gamescope的优先级。如果你在Gamescope运行时在终端中看到这样的错误,说明你遇到了现在所说的这种情况:

No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.

用下面的命令可以修复:

# setcap 'CAP_SYS_NICE=eip' $(which gamescope)

在 NVIDIA 环境运行 Flatpak 应用没有窗口

这是因为 Flatpak Gamescope 访问 NVIDIA DRM's GBM 后端失败. 这可以简单地通过下面的命令设置一个环境变量解决:

$ flatpak override --env=GBM_BACKENDS_PATH=/usr/lib/x86_64-linux-gnu/GL/nvidia-XXX-YY-ZZ/extra/gbm packageid

where packageid is the Flatpak package identifier of Gamescope or the app you want to use Gamescope with, such as Bottles. Replace nvidia-XXX-YY-ZZ with the currently installed NVIDIA driver version; inside Flatpak, it can be queried with this command:

$ flatpak run --command=ls packageid /usr/lib/x86_64-linux-gnu/GL

where packageid is any Flatpak package identifier; do note that the directory only exists inside Flatpak.

注意:

这篇文章的某些内容需要扩充。

原因: This step can probably be automated by a pacman hook. (在 Talk:Gamescope 中讨论)

The command must be reran, and modified accordingly, on every driver update.

使用 Intel 显卡出现图像损坏

If gamescope outputs corrupted image colors on Intel graphics disabling lossless color compression can be a work-around at the cost of increased memory bandwidth utilization. [1] To disable it pass INTEL_DEBUG=noccs environment variable.

启用 HDR 时 VRR 卡顿

If VRR and HDR work independently, but the framerate is unstable when they're both enabled, then you may be hitting issues with long HDR compositing times. See https://github.com/ValveSoftware/gamescope/issues/1006. This only applies to using Gamescope in embedded mode, and not when using gamescope within an existing wayland or X session.

使用AMD显卡时可以使用实验性的 AMD 颜色管理解决这个问题,这会使用硬件 planes 完成最终图像的合成。使用以下两个步骤之一:

Steam Deck 内核

启用实验性AMD颜色管理的 Linux 内核

高回报率的鼠标导致卡顿

在游戏窗口中移动一个高回报率(observed with 4000Hz)的鼠标时,可能导致卡顿或暂时冻结 [2]。设置一个更低的比如 1000Hz 的回报率应该可以绕过这个问题。

另请参阅