VR application: get more precise calls to process function ?

Making & changing box plugins and external apps
Post Reply
ntarrin
Posts: 18
Joined: Mon May 02, 2011 2:07 pm

VR application: get more precise calls to process function ?

Post by ntarrin »

Hello,

I'm trying to precisely control flashings in an openvibe P300 VR application.

In "COgreVRApplication::frameStarted", I removed tests on frequency and sleeps, so that "this->process" is called each time "frameStarted" is.

In my process function, I measured elapsed time using Ogre timers.

Code: Select all

std::vector<double> m_vRepetitionPerformance;
Timer perfTimer;

[...]

m_vRepetitionPerformance.push_back(perfTimer.getMicroseconds());
perfTimer.reset();
All this is compiled in release mode, run on Imac/Intel Duo 2,6G/windows XP/NVIDIA GeForce 9400 - 60Hz. An openvibe designer is running a P300 replay scenario in the background.

The measured refresh rate looks like this :
refresh rate 3.jpg
refresh rate 3.jpg (6.38 KiB) Viewed 4948 times
x: elapsed time since last call in µs.
y: number of frame for each time window

I expect to have at most 16ms (1/60) between each frame, and we see several calls at 20ms and more. Is there a way to avoid this in Ogre ? Or am I missing something ?

Thanks.
Nicolas.

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: VR application: get more precise calls to process functi

Post by lbonnet »

Hi Nicolas,

Sorry but I don't know how you can optimize the Ogre process...
Do you know the precision of the Ogre Timer ?
we know there is some problem when measuring time using the Windows Time::getTime function (minimum 15ms refresh), bu I don't know the Ogre timer...

Laurent-
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

ntarrin
Posts: 18
Joined: Mon May 02, 2011 2:07 pm

Re: VR application: get more precise calls to process functi

Post by ntarrin »

I've done a little test with ogre timer:

Code: Select all

for (int i=0; i<1000; i++)
{
	m_vRepetitionPerformance.push_back(perfTimer.getMicroseconds());
	perfTimer.reset();
	Sleep(5);
}
Which gives:
ogre timer precision.jpg
ogre timer precision.jpg (12.24 KiB) Viewed 4939 times
This should be ideally centered on 5000. It looks like this timer is at least 1ms precise, which is ok for my needs. Is there an openvibe timer ?



Below is the flash durations I have, expecting 100ms each:
flash rate 7.jpg
flash rate 7.jpg (13.77 KiB) Viewed 4939 times
Most of them are between 100 and 110ms, which is acceptable, but it can be up to 130 or 140ms. I guess I'll have to deal with this performances...

Did you measure your flash durations for the P300 speller scenario ?

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: VR application: get more precise calls to process functi

Post by yrenard »

Dear Nicolas,

no we did not measure the flash duration of the P300 scenarios

Did you solve the timing problems you were facing ?

Yann

ntarrin
Posts: 18
Joined: Mon May 02, 2011 2:07 pm

Re: VR application: get more precise calls to process functi

Post by ntarrin »

Hi Yann,

Nope, for the moment I'll use this as is, flash precision is not that bad, and if we need more precise durations, it may heavily depend on Ogre engine. After a quick search on the net, I found nothing about having Ogre calling the frameStarted callback more steadily. If someone find something, I'll be happy to take benefit from it :)

Nicolas.

Post Reply