On Fri, Mar 06, 2015 at 04:05:08PM +0100, Richard Cochran wrote: > There are really two issues: > > 1. The filter algorithm itself. > 2. How the new filter fits into the SW design. > > Although I am not convinced about #1
Not convinced that the raw offset should be sent to the servo when the number of remote and local timestamps is balanced? > , I really won't mind merging the > filter as an option, as long as #2 is cleanly handled. The trouble is the raw mode is not a filter that can be easily plugged in, it has a different input than servos. It's a fundamentally different approach in how are the timestamps handled. In the raw mode we use only the last four timestamps, in filtered mode we use the last two timestamps and a long term average of delays from past sets of four timestamps. Assigning weight to the samples is a separate problem. What I proposed needs the last four timestamps and also the long term average of delay, but there are other ways how it could be done. > But if the > code is "in line" unconditionally, then it really has to work for > everybody. If you are worried this could make things worse in same cases, it can be fully configurable. How about this? - in clock_synchronize() calculate both sets of raw and filtered offset/delay - add a new option for raw mode - use filtered offset in the servo_sample() if the raw option is disabled, use raw offset if enabled - add weight parameter to servo_sample() function and use it in the servos, weight 1.0 doesn't change the behavior - add a new option for weighting mode - set the weight to 1.0 if the weighting option is disabled, set it to the ratio of the filtered and raw delay if enabled Both options are disabled by default. Later we can decide if they should be enabled by default or the switching should be automatic. What do you think? -- Miroslav Lichvar ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel