Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 06-May-2008, 10:19   #1
willow
Registered
 
Join Date: May 2008
Posts: 3
Default Timers - multi media vs query performance counter

Hi all from a newbie

Wonder if you guys can help with the following ?

We are working on a plugin to pull real time telemetry information out of racing games, such as rFactor, GTR2 etc etc. As you may or may not know, rfactor (ISI) are very helpful in this respect providing a whole host of information. We need to pull the right data out of the game as quickly as possible and have been working on this for some time.

We can pull the data out, no problem, the current issue we have is around timers. We must be able to run our software without it impacting frame rate significantly. Our current route has been to use MS multimedia timer - however we are consistently seeing a 20% reduction in frame rates when running the game with our software.

We have considered queryPerformance Counter but really are not sure of the pro's and con's vs MS Mmt.

Because we want as much information to be pulled from the game software as possible in real time, we need a timing solution that will allow us to pull data at 300/ 400 times a second but with minimal/ no impact to frame rate.

Any experience of this area - specifically what is the best option and why - would be very much appreciated.

Thanks all
willow is offline   Reply With Quote
Old 06-May-2008, 14:25   #2
sebbbi
Senior Member
 
Join Date: Nov 2007
Posts: 1,340
Default

Windows multimedia timer timeGetTime() has pretty good precision if you are using timeBeginPeriod() and timeEndPeriod() to change the timer resolution to 1 ms. It's also the most safe way to time your application.

QueryPerformanceCounter() and QueryPerformanceFrequency() offer a bit better resolution, but have different issues. For example in Windows XP, all AMD Athlon X2 dual core CPUs return the PC of either of the cores "randomly" (the PC sometimes jumps a bit backwards), unless you specially install AMD dual core driver package to fix the issue. We haven't noticed any other dual+ core CPUs having similar issues (p4 dual, p4 ht, core2 dual, core2 quad, phenom quad).

Some links I quickly googled:
http://www.mindcontrol.org/~hplus/pc-timers.html
http://www.virtualdub.org/blog/pivot/entry.php?id=106
sebbbi is offline   Reply With Quote
Old 06-May-2008, 15:10   #3
Davros
Naughty Boy!
 
Join Date: Jun 2004
Posts: 11,075
Default

doesnt the DataAcquisitionPlugin.dll do it for you ?
Davros is offline   Reply With Quote
Old 06-May-2008, 17:06   #4
willow
Registered
 
Join Date: May 2008
Posts: 3
Default

Thanks for the quick responses! Useful and informative links.
re: DataAcquisitionPlugin.dll
yes, this gives us a usable time interval for rFactor, but we're really looking for a more general solution, that will work for other games too, and we currently get a slower frame rate in the game when using QueryPerformanceCounter or the other timers in our outboard application.

Are there known issues with these precision timers running outside DirectX games, affecting the game? Any links would be very helpful, thankyou
willow is offline   Reply With Quote
Old 06-May-2008, 17:44   #5
Tokelil
Member
 
Join Date: Mar 2002
Location: Denmark
Posts: 329
Send a message via ICQ to Tokelil Send a message via MSN to Tokelil
Default

This might be a stupid question, but if you see a 20% drop in fps with the timing functions, what are the framerate drop leaving them out but keeping the rest of the log logic? I wouldn't have thought either would impact performance much, compared to "real work".
Tokelil is offline   Reply With Quote
Old 07-May-2008, 15:08   #6
willow
Registered
 
Join Date: May 2008
Posts: 3
Default

Hi guys ..... Are there known issues with these precision timers running outside DirectX games, affecting the game? Any links would be very helpful, thankyou
willow is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:10.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.