ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.21k stars 174 forks source link

[AMD] Stuttering FPS in TF2 with TearFree driver option enabled #271

Closed mutcianm closed 11 years ago

mutcianm commented 11 years ago

What happens:

Despite net_graph always showing around 60 FPS, overall framerate is definitely lower, e.g. occasional freeze-ups and jitter.

How to reproduce:

What does not influence bug behavior:

In addition, latest AMD driver(12.11-1) is very unstable, e.g. it might crash randomly running any 3d application, the longer you run 3d apps, the higher chances are it would crash.

I've found several issues that might be similar, however they do not state any VSync and TearFree correlation. Issue #159 Issue #138

mutcianm commented 11 years ago

Processor Information: Vendor: GenuineIntel Speed: 3401 Mhz 8 logical processors 4 physical processors HyperThreading: Supported FCMOV: Supported SSE2: Supported SSE3: Supported SSSE3: Supported SSE4a: Unsupported SSE41: Supported SSE42: Supported

Network Information: Network Speed:

Operating System Version: Linux (64 bit) Kernel Name: Linux Kernel Version: 3.6.10-1-ARCH X Server vendor: The X.Org Foundation X Server release: 11301000

Video Card: Driver: ATI Technologies Inc. AMD Radeon HD 6900 Series

Driver Version:  4.2.11978 Compatibility Profile Context
Desktop Color Depth: 24 bits per pixel
Monitor Refresh Rate: 59 Hz
VendorID:  0x1002
DeviceID:  0x6718
Number of Monitors:  2
Number of Logical Video Cards:  1
Primary Display Resolution:  2560 x 1440
Desktop Resolution: 4608 x 1440
Primary Display Size: 23.50" x 13.23"  (26.97" diag)
                                        59.7cm x 33.6cm  (68.5cm diag)
Primary VRAM Not Detected

Sound card: Audio device: Realtek ALC889

Memory: RAM: 7957 Mb

Miscellaneous: UI Language: English LANG: en_US.UTF-8 Microphone: Not set Total Hard Disk Space Available: 117236 Mb Largest Free Hard Disk Block: 86296 Mb

Installed software:

Recent Failure Reports: Sat Dec 22 12:35:22 2012 GMT: file ''/tmp/dumps/assert_20121222163518_1.dmp'', upload yes: ''CrashID=bp-b2267e45-739f-41ed-9430-de0c82121222''

MrSchism commented 11 years ago

I find that using the client-side command

cl_showfps 2

works very nicely

mutcianm commented 11 years ago

Update: tearing and lag with disabled TearFree and composting enabled was caused by KWin's vsync option. It did some sort of double(or even triple if TearFree was enabled) vsync(TearFree+wm+game itself) which caused lag and tearing. Just disable window managers's(at least in KWin it works) vsync option and stick to TearFree.

cl_showfps 2 didn't show any new info: min fps is close to max, close to 60, ~16 ms/per frame

MrSchism commented 11 years ago

Thanks for the update. Marking this as closed - not a bug because it was mostly to do with the window manager's vsync at the heart of the issue.

This will serve as a good reference, though. Thank you for that.

Ruedii commented 11 years ago

Is there an option to make the loader scripts for TF2 detect this, run the appropriate command, then undo the command when TF2 exits?

Just curious, as it would be a nice feature.

MrSchism commented 11 years ago

@Ruedii: make a new issue with that as a feature request.

mutcianm commented 11 years ago

@Ruedii: The only thing i've found so far is this dbus method of KWn: method Q_NOREPLY void org.kde.KWin.toggleCompositing() example usage: qdbus org.kde.kwin /KWin toggleCompositing AFAIK there is no direct way to control vsync though dbus, however you can edit kwinrc(~/.kde4/share/config/kwinrc) directly and set GLVSync=false, then call org.kde.KWin.reconfigure() if disabling desktop effects completely seems like an overkill. Once again, this only works for KWin which is part of KDE, workarounds for Unity should be investigated separately.

As for AMD driver's TearFree option, I can't say for sure as I've recently switched to nvidia. This command: aticonfig --del-pcs-key=DDX,EnableTearFreeDesktop will disable, and this: aticonfig --set-pcs-u32=DDX,EnableTearFreeDesktop,1 will enable TearFree respectively. It should be noted that both require administrative privileges.