ValveSoftware / gamescope

SteamOS session compositing window manager
Other
3.17k stars 213 forks source link

Steam Deck - gamescope vsync doesn't work with some apps #439

Open LiamDawe opened 2 years ago

LiamDawe commented 2 years ago

Hey guys trying out Core Keeper, Dying Light, UT99, SuperTuxKart and Teardown, all seem to not work with the built in limiter that the Deck has, which is powered by Gamescope right?

I had to use in-game vsync to lock them to 60FPS otherwise it was quite high.

Other OpenGL apps are probably affected too.

You can test easily by installing STK through Discover, adding to Steam and loading in Deck UI / Game Mode.

CompaqDisc commented 2 years ago

My system is NOT Steam Deck Can confirm with Minecraft launched via gamescope (using MultiMC's wrapper commands feature) Must enable vsync in game options to be limited. Might be WAI?

Gamescope command and version:

gamescope -w1280 -h800 -H1440 -Ubr 60 -- 

$ yay -Si gamescope
Repository      : community
Name            : gamescope
Version         : 3.11.22-2
Description     : SteamOS session compositing window manager
Architecture    : x86_64

System Information:

Computer Information:
    Manufacturer:  ASUSTeK COMPUTER INC.
    Model:  PRIME X470-PRO
    Form Factor: Desktop
    No Touch Input Detected

Processor Information:
    CPU Vendor:  AuthenticAMD
    CPU Brand:  AMD Ryzen 5 2600 Six-Core Processor            
    CPU Family:  0x17
    CPU Model:  0x8
    CPU Stepping:  0x2
    CPU Type:  0x0
    Speed:  4000 Mhz
    12 logical processors
    6 physical processors
    HyperThreading:  Supported
    FCMOV:  Supported
    SSE2:  Supported
    SSE3:  Supported
    SSSE3:  Supported
    SSE4a:  Supported
    SSE41:  Supported
    SSE42:  Supported
    AES:  Supported
    AVX:  Supported
    AVX2:  Supported
    AVX512F:  Unsupported
    AVX512PF:  Unsupported
    AVX512ER:  Unsupported
    AVX512CD:  Unsupported
    AVX512VNNI:  Unsupported
    SHA:  Supported
    CMPXCHG16B:  Supported
    LAHF/SAHF:  Supported
    PrefetchW:  Unsupported

Operating System Version:
    "Arch Linux" (64 bit)
    Kernel Name:  Linux
    Kernel Version:  5.16.12-arch1-1
    X Server Vendor:  The X.Org Foundation
    X Server Release:  12101003
    X Window Manager:  Mutter (Muffin)
    Steam Runtime Version:  steam-runtime_0.20220119.0

Video Card:
    Driver:  AMD AMD Radeon RX 6800 XT (SIENNA_CICHLID, DRM 3.44.0, 5.16.12-arch1-1, LLVM 13.0.1)
    Driver Version:  4.6 (Compatibility Profile) Mesa 21.3.7
    OpenGL Version: 4.6
    Desktop Color Depth: 24 bits per pixel
    Monitor Refresh Rate: 144 Hz
    VendorID:  0x1002
    DeviceID:  0x73bf
    Revision Not Detected
    Number of Monitors:  2
    Number of Logical Video Cards:  1
    Primary Display Resolution:  2560 x 1440
    Desktop Resolution: 4480 x 1440
    Primary Display Size: 23.50" x 13.23" (26.97" diag)
                                            59.7cm x 33.6cm (68.5cm diag)
    Primary VRAM: 16384 MB

Sound card:
    Audio device: ATI R6xx HDMI

Memory:
    RAM:  32087 MB
BNieuwenhuizen commented 2 years ago

@CompaqDisc The vsync enforcement is Deck specific and won't happen on desktop.

On the Deck this is basically enforced with a export vblank_mode=3 in the session for GL (and something else for Vulkan), seems like that doesn't quite do the right thing there.

BNieuwenhuizen commented 2 years ago

Can confirm supertuxkart still has no limit applied on the beta image, which has vsync forcing changes. Gotta see what mesa path changes this hits.

LiamDawe commented 2 years ago

Added Dying Light to the list.

BNieuwenhuizen commented 2 years ago

I think I figured out why SuperTuxKart doesn't work: Forcing the framelimiter is done in mesa, and flatpaks use their own mesa instead of the driver from the deck.

BNieuwenhuizen commented 2 years ago

For non-flatpak the issue seems to be using vblank_mode=1 instead of vblank_mode=3 in /usr/bin/gamescope-session. the frame limiter should work in the beta image already, and stable should be fixed whenever that image gets promoted.

(tested with dying light)

For flatpak fixing is going to be messy most likely.

robertoszek commented 2 years ago

Can confirm that for Crusader Kings II on the Deck, setting the launch options to: vblank_mode=3 %command% is needed. Otherwise the frame limiter doesn't make any difference. In this particular game even forcing VSync in the game settings didn't seem to cap the framerate.