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 上的遊戲
您可以使用 Gamescope 從 Steam 運行遊戲,只需將以下內容添加到遊戲啟動選項即可:
$ 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 管理器一起使用,方法與安裝軟體包相同。但是,它要求您首先使用以下命令從 Flathub 安裝 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+o
FSR銳度減1。 -
Super+i
FSR銳度加1。
HDR 支持
運行遊戲時,Gamescope 是 HDR10 的必要條件 ,要使用此功能, 請給 Gamescope 啟動參數加上 --hdr-enabled
標誌.
Mangoapp
不支持將傳統 MangoHud 和 Gamescope 結合使用。相反,應當使用 gamescope 的 --mangoapp
標誌。這允許 MangoHud 在 gamescope ,而不是在底層應用程式上運行。某些 MangoHud 配置,如顯示 FSR 或 HDR 狀態,需要使用帶有 gamescope 的 mangoapp 才能工作。某些 MangoHud 配置,比如顯示 FSR 或 HDR 狀態,需要使用 gamescope 才能工作。
可變刷新率
如果顯示器支持它,通過傳遞 --adaptive-sync
標誌以啟用可變刷新率。
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%
常見問題
光標表現不正確
如果光標沒有被應用程式捕捉到,例如限制相機的移動或者沒有正確地從菜單中消失,那麼使用 --force-catch-cursor
標誌。一些 proton 或 wine 遊戲需要這種變通方法。
切換至全屏模式後性能降低
當使用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)
MESA_VK_DEVICE_SELECT
為 Gamescope 指定要使用的 GPU。看 這裡。您可以使用ananicy-gitAUR或類似的方法來繞過這個限制。在 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
其中 packageid
是 Gamescope 或您要使用Gamescope的應用程式的Flatpak包標識符,如Bottles。將 nvidia-XXX-YY-ZZ
替換為當前安裝的nvidia驅動程序版本;在Flatpak內部,可以使用以下命令進行查詢:
$ flatpak run --command=ls packageid /usr/lib/x86_64-linux-gnu/GL
其中 packageid
是任何一個 Flatpak 包標識符,請注意該目錄只存在於 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]
Wayland下在較老的AMD顯卡上崩潰
Gamescope 3.14.3 引入了一個Wayland後端,以提升Wayland下的性能。雖然,儘管如此,它目前無法在較舊的AMD GPU上運行。追蹤上游問題#1218。
Gamescope在啟動時崩潰,例如這樣:
gamescope: types/wlr_linux_dmabuf_v1.c:526: feedback_compile: Assertion `table_len > 0' failed.
您可以通過強制回退舊的 SDL2 後端,添加 --backend
標誌來解決這個問題:
$ gamescope --backend sdl -- game
Swapchain 錯誤
Swapchain錯誤的一個常見原因是不正確地嘗試使用 mangohud 而不是 mangoapp。請參閱上文。
從 Steam 啟動遊戲,在大約24分鐘後卡頓
如果從steam啟動gamescope後,您在大約24分鐘後遇到嚴重的卡頓,那麼您可以添加Steam overlay 的 -e
標誌 或用不同的值覆蓋環境變量 LD_PRELOAD
來解決這個問題。例如:
$ LD_PRELOAD="" gamescope -- %command%
參見https://github.com/ValveSoftware/gamescope/issues/163
高回報率的滑鼠導致卡頓
在遊戲窗口中移動一個高回報率(observed with 4000Hz)的滑鼠時,可能導致卡頓或暫時凍結 [2]。設置一個更低的比如 1000Hz 的回報率應該可以繞過這個問題。