Tip: Overlay frames per second on fullscreen 3d games

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
asb
Level 1
Level 1
Posts: 6
Joined: Tue Jun 14, 2011 5:25 am

Tip: Overlay frames per second on fullscreen 3d games

Post by asb »

It's often handy to be able to see the current frames per second when testing a game under wine as it allows you to pinpoint where frame rate problems occur and how serious they are. It's easy to get the framerate from wine by setting WINEDEBUG=fps. However, it's not easy to track framerate changes as you play when the game runs fullscreen. Fraps[1] is a good solution to this problem under Windows but the FPS measuring functionality does not work under Wine (see bug #23765[2]).

I found it's actually easy to view the current fps by using `osd_cat` to
overlay output from WINEDEBUG=fps on the screen. Just launch your program
with:

WINEDEBUG=fps wine MYAPP.exe 2>&1 | tee /dev/stderr | grep --line-buffered "^trace:fps:" | osd_cat`

osd_cat is provided by xosd-bin on Debian/Ubuntu. Check the man page for ways of configuring it if the defaults aren't too your liking. I tee to /dev/stderr so output is still shown in the terminal. If the trace:fps lines show more information than you want you could use sed to grab just the current fps, and pass --lines=1 to osd_cat to get something more fraps-like.

I haven't observed any cases where the act of overlaying this fps information has a measurable difference on the observed framerate (Nvidia binary drivers on Ubuntu 11.04). Just thought I'd share because I find it to be pretty useful, and am interested any other related tips or ideas for improvement.

Regards,

Alex

[1]: http://www.fraps.com
[2]: http://bugs.winehq.org/show_bug.cgi?id=23765
asb
Level 1
Level 1
Posts: 6
Joined: Tue Jun 14, 2011 5:25 am

Post by asb »

Ignore the stray `, correct command line is:

WINEDEBUG=fps wine MYAPP.exe 2>&1 | tee /dev/stderr | grep --line-buffered "^trace:fps:" | osd_cat
Locked