Jul 27, 2006 16:38
Main assumptions: constant trip delay, zero packet loss (using these for simplicity... can be extended later)
Two different solutions.
Server Side:
-keep an IDictionary(Node,AugmentTime), play packet at time t = ArrivalTime + AugmentTime.
-slowest connection has 0 AugmentTime, fastest connection has largest AugmentTime.
Therefore, in theory with zero packet loss all notes will be played upon the arrival of the longest packet. In practice it will be more complicated then this but this is just a base to work with.
Client Side:
-keep an augment time, delay sending all notes by the augment time.
Both augment times on the server side and the client side will be determined in a setup (synchronization) phase.
Problems:
The assumption of constant trip delay and zero packet loss are only valid on small LAN. Over an open network zero packet loss is too strict an assumption. Constant delay can still be achieved but more then likely you'll have variable delay. The solution to the variable delay problem is to update the augment time every 5 seconds or so.