OpenViBE forum

The OpenViBE community
It is currently Thu Dec 14, 2017 10:09 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed May 18, 2011 9:02 am 
Offline

Joined: Mon May 02, 2011 2:07 pm
Posts: 18
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:
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 :

Attachment:
refresh rate 3.jpg
refresh rate 3.jpg [ 6.38 KiB | Viewed 1440 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.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2011 2:25 pm 
Offline
Site Admin

Joined: Wed Oct 07, 2009 12:11 pm
Posts: 417
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 !


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2011 3:21 pm 
Offline

Joined: Mon May 02, 2011 2:07 pm
Posts: 18
I've done a little test with ogre timer:

Code:
for (int i=0; i<1000; i++)
{
   m_vRepetitionPerformance.push_back(perfTimer.getMicroseconds());
   perfTimer.reset();
   Sleep(5);
}


Which gives:

Attachment:
ogre timer precision.jpg
ogre timer precision.jpg [ 12.24 KiB | Viewed 1431 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:
Attachment:
flash rate 7.jpg
flash rate 7.jpg [ 13.77 KiB | Viewed 1431 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 ?


Top
 Profile  
Reply with quote  
PostPosted: Fri May 27, 2011 9:11 am 
Offline
Site Admin

Joined: Fri Sep 01, 2006 3:39 pm
Posts: 645
Dear Nicolas,

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

Did you solve the timing problems you were facing ?

Yann

_________________
CTO at Mensia Technologies | Image my blog | Image my tweets | Image my linkedin


Top
 Profile  
Reply with quote  
PostPosted: Fri May 27, 2011 1:21 pm 
Offline

Joined: Mon May 02, 2011 2:07 pm
Posts: 18
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Americanized by Maël Soucaze.