https://wiki.openlighting.org/api.php?action=feedcontributions&user=195.146.245.223&feedformat=atomwiki.openlighting.org - User contributions [en]2024-03-29T09:52:06ZUser contributionsMediaWiki 1.29.1https://wiki.openlighting.org/index.php?title=Port_Throttling&diff=3973Port Throttling2011-10-25T20:42:33Z<p>195.146.245.223: /* Current Throttled Ports */</p>
<hr />
<div>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.wikipedia.org/wiki/Token_bucket Token Bucket Algorithm].<br />
<br />
The following example shows applying the ''ThrottledOutputPortDecorator'' to an Output port to rate limit the output.<br />
<br />
Before (no throttling):<br />
<pre><br />
OutputPort *output_port = new UsbProOutputPort(this, 0, "");<br />
</pre><br />
<br />
After (throttle to 190 frames per second)<br />
<br />
<pre><br />
OutputPort *output_port = new ThrottledOutputPortDecorator(<br />
new UsbProOutputPort(this, 0, ""), // the port to throttle<br />
plugin_adaptor->WakeUpTime(), // the select server wake up time<br />
10, // start with 10 tokens in the bucket <br />
190); // throttle to 190 frames per second<br />
</pre><br />
<br />
When port throttling is in place, messages will appear at log level 4 similar to:<br />
<br />
<pre><br />
PortDecorators.h:48: Port rated limited, dropping frame<br />
</pre><br />
<br />
=== Current Throttled Ports ===<br />
<br />
* [[DMX USB Pro]] - 190 frames/second<br />
* [[Arduino RGB Mixer]] - 20 frames/second<br />
* [[DMX-TRI]] - 40 frames/second<br />
<br />
For some devices, values can be changed in ~/.ola/ola-usbserial.conf</div>195.146.245.223