Skip to content

Comments

Regulator updates to further minimize unnecessary glitches#1464

Merged
cchafe merged 1 commit intodevfrom
bugfix/plc-reduced-glitches
Feb 6, 2026
Merged

Regulator updates to further minimize unnecessary glitches#1464
cchafe merged 1 commit intodevfrom
bugfix/plc-reduced-glitches

Conversation

@mikedickey
Copy link
Collaborator

This builds upon the refinement introduced by:
#1437

That PR allowed us to use a good packet ignoring skips if the previous callback was serviced using a prediction (glitch).

However, we were still effectively throwing out the next good packet whenever there were skips and the previous callback was not serviced using a prediction.

This PR takes a slightly different approach by allowing us to stash and use the next good packet on the following callback. This also helps slow down jumping sequence numbers when there are multiple skipped packets in a row (which causes abrupt drops in latency).

This also addresses a special case where we are only skipping a single good packet due to tolerance. Rather than returning a prediction, we allow it to use the packet.

For this to work, we need to ease the tolerance restrictions slightly by allowing it to sometimes expand by the duration of an additional packet. Effectively, this also means that tolerance restrictions alone will only cause glitches when the skew exceeds at least one packet in duration.

My initial testing indicates that these changes significantly reduce glitch counts, by as much as 2x, resulting in a slightly improved signal (at least to my ears).

sudo tc qdisc add dev eth0 root netem slot distribution pareto 0.1ms 3.0ms loss 10%

@mikedickey mikedickey requested a review from cchafe January 25, 2026 19:30
@mikedickey mikedickey force-pushed the bugfix/plc-reduced-glitches branch 3 times, most recently from 3cb764c to ec4dff3 Compare January 25, 2026 20:00
@mikedickey mikedickey marked this pull request as ready for review January 25, 2026 20:26
@mikedickey mikedickey force-pushed the bugfix/plc-reduced-glitches branch from 543f786 to 59ff4a7 Compare January 25, 2026 23:57
This builds upon the refinement introduced by:
#1437

That PR allowed us to use a good packet ignoring skips if the
previous callback was serviced using a prediction (glitch).

However, we were still effectively throwing out the next good
packet whenever there were skips and the previous callback was
not serviced using a prediction.

This PR takes a slightly different approach by allowing us to
stash and use the next good packet on the following callback.
This also helps slow down jumping sequence numbers when there
are multiple skipped packets in a row (which causes abrupt
drops in latency).

This also addresses a special case where we are only skipping
a single good packet due to tolerance. Rather than returning
a prediction, we allow it to use the packet.

For this to work, we need to ease the tolerance restrictions
slightly by allowing it to sometimes expand by the duration
of an additional packet. Effectively, this also means that
tolerance restrictions alone will only cause glitches when
the skew exceeds at least one packet in duration.

My initial testing indicates that these changes significantly
reduce glitch counts, by as much as 2x, resulting in a
slightly improved signal (at least to my ears).

sudo tc qdisc add dev eth0 root netem slot distribution pareto 0.1ms 3.0ms loss 10%

This also eliminates the use of "goto" statements in the
regulator code and fixes a bug with auto headroom adjustments
@mikedickey mikedickey force-pushed the bugfix/plc-reduced-glitches branch from 59ff4a7 to 3a890f1 Compare January 29, 2026 20:20
Copy link
Collaborator

@cchafe cchafe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great improvement

@cchafe cchafe merged commit a3d9465 into dev Feb 6, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants