Implement soft artnet sync for LEDs #64
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement best-effort LEDs update synchronization for multiple Art-NET universes without explicit ArtSync frames (hard sync) from the sender. This attempts to match the LEDs update rate to the implicit Art-NET refresh rate, avoiding output tearing and reducing the number of LED updates for smoother results. This is particularly significant with larger numbers of LEDs where the maximum update rate is closer to the incoming Art-NET refresh rate.
When
artnet_sync_timeout
is configured, LED output updates are buffered until any of:artnet_sync_timeout
ms have passed since the first buffered Art-NET universe was received (timeout sync)Using
leds stats
for testing: With an appropriateartnet_sync_timeout
value matched to the expected refresh rate, this should ideally result in a leds task update rate that exactly matches the Art-NET refresh rate with zero sync misses/timeouts. However, if Art-NET frames are being dropped, or the sender is only sending Art-NET frames for some of the output universes, then the the sync missed/timeout should kick in and keep the output updating.