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%
gamescope -W 1920 -H 1080 -r 60 -- %command%
運行Wine
當使用 Gamescope 通過 Wine 運行程序時,簡單地用 wine 加上可執行程序名稱即可。
$ gamescope -W 1920 -H 1080 -r 60 -- wine supertuxkart
幾乎全部流行的 Wine 管理器都支持 Gamescope,例如 Lutris,Bottles,和 PlayOnLinux。使用它們就像安裝所需的 Gamescope 軟體包並檢查「使用Gamescope」(或類似)選項一樣簡單。
運行Flatpak
您也可以將 Gamescope 與Flatpak或Steam提供的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.
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.
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 內核
- The Steam Deck Linux kernel linux-neptune-65AUR or a kernel built with the Steam Deck color management patch
- gamescope包 or gamescope-gitAUR
啟用實驗性AMD顏色管理的 Linux 內核
- Linux 6.8 及以上,編譯時
KCFLAGS
包含-DAMD_PRIVATE_COLOR
,例如 linux-amd-colorAUR - gamescope patched to work with upstream kernel, available in AUR as gamescope-amd-colorAUR[損壞的連結:package not found]
高回報率的滑鼠導致卡頓
在遊戲窗口中移動一個高回報率(observed with 4000Hz)的滑鼠時,可能導致卡頓或暫時凍結 [2]。設置一個更低的比如 1000Hz 的回報率應該可以繞過這個問題。