Personal tools
The Open Lighting Project has moved!

We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.

Difference between revisions of "Port Throttling"

From wiki.openlighting.org

Jump to: navigation, search
(Created page with 'Sometimes the frame rate from Output Ports has to be rate limited. The ''ThrottledOutputPortDecorator'' allows rate limits to be configured on OutputPorts using a [http://en.wiki…')
 
(Current Throttled Ports)
 
(One intermediate revision by one other user not shown)
Line 17: Line 17:
 
       190);  // throttle to 190 frames per second
 
       190);  // throttle to 190 frames per second
 
</pre>
 
</pre>
 +
 +
When port throttling is in place, messages will appear at log level 4 similar to:
 +
 +
<pre>
 +
PortDecorators.h:48: Port rated limited, dropping frame
 +
</pre>
 +
 +
=== Current Throttled Ports ===
 +
 +
* [[DMX USB Pro]] - 190 frames/second
 +
* [[Arduino RGB Mixer]] - 20 frames/second
 +
* [[DMX-TRI]] - 40 frames/second
 +
 +
For some devices, values can be changed in ~/.ola/ola-usbserial.conf

Latest revision as of 13:42, 25 October 2011

Sometimes the frame rate from Output Ports has to be rate limited. The ThrottledOutputPortDecorator allows rate limits to be configured on OutputPorts using a Token Bucket Algorithm.

The following example shows applying the ThrottledOutputPortDecorator to an Output port to rate limit the output.

Before (no throttling):

OutputPort *output_port = new UsbProOutputPort(this, 0, "");

After (throttle to 190 frames per second)

OutputPort *output_port = new ThrottledOutputPortDecorator(
      new UsbProOutputPort(this, 0, ""),  // the port to throttle
      plugin_adaptor->WakeUpTime(),  // the select server wake up time
      10,  // start with 10 tokens in the bucket                                                                                                                  
      190);  // throttle to 190 frames per second

When port throttling is in place, messages will appear at log level 4 similar to:

PortDecorators.h:48: Port rated limited, dropping frame

Current Throttled Ports

For some devices, values can be changed in ~/.ola/ola-usbserial.conf