Hello,
How time is managed in openViBE? How to produce a command at regular interval duration?
time management
Re: time management
Dear matthieuG,
the kernel currently runs at 128 Hz, this can be configured in the configuration file.
In a box, you can find the current time using :
This value represents the number of seconds elapsed since the user pressed play in fixed point on 64 bits (32 bits for integer part and 32 for fractional part).
Tell me if something is not clear here.
Hope this helps,
Yann
the kernel currently runs at 128 Hz, this can be configured in the configuration file.
In a box, you can find the current time using :
Code: Select all
this->getPlayerManager().getCurrentTime()
Tell me if something is not clear here.
Hope this helps,
Yann
Re: time management
all is clear : I can know what time it is. But how to assure that a command is executed at a regular time. I can mesure the time in process(), so if I keep it in a buffer, I can have a duration at the next step. So if this time duration is too big, I missed to send the request (execution) ; if the duration is less than the period I need, I can wait the next process() or send the resquest with an advance.
With this logic, I can't really assure a regular command. Can you propose a better solution?
With this logic, I can't really assure a regular command. Can you propose a better solution?
Re: time management
Dear matthieuG
please, have a look to the IBoxAlgorithm class documentation. You will find a function named getClockFrequency which tells the player how often your box should be clock notified. As soon as your box should be notified, the player will call your processClock callback so that you can examine current time and eventually mark your algorithm as ready to process.
I hope this helps,
Yann
please, have a look to the IBoxAlgorithm class documentation. You will find a function named getClockFrequency which tells the player how often your box should be clock notified. As soon as your box should be notified, the player will call your processClock callback so that you can examine current time and eventually mark your algorithm as ready to process.
I hope this helps,
Yann