Clock synchronization techniques including modification of sample rate conversion
Methods and systems provide control of media synchronization using time stamp pairs. In an embodiment, a first device may request a time stamp from a second device. The first device may determine any de-synchronization between the first and second devices based on the requested time stamp and characteristics of the request. The first device may define a rate scalar based on the determined de-synchronization. A sample rate conversion may be performed for the first device based on the rate scalar such that the outputs of the first device and the second device are synchronized.
1. A system, comprising:
a time synchronization manager configured to:
determine a difference between a first sample rate of the system and a second sample rate of an external device based on timing of communications between the system and the external device and on the communications' delay time; and
determine a rate scalar based on the difference between the first sample rate and the second sample rate;
a clock device communicatively coupled to the time synchronization manager and configured to define the first sample rate;
a sample rate converter configured to convert a received signal to an output signal based on the rate scalar;
input/output hardware configured to output the output signal synchronously with an output of the external device.
2. The system of claim 1 , wherein a protocol for a first communication link between the system and the external device and a protocol for a second communication link between the system and the external device are different from each other.
3. The system of claim 2 , wherein the protocol for the first communication link includes at least one of: Internet Authentication Service (IAS), Precision Time Protocol (PTP), and serial time protocol (STP).
4. The system of claim 2 , wherein the protocol for the second communication link includes at least one of: Internet Authentication Service (IAS), Precision Time Protocol (PTP), and serial time protocol (STP).
5. The system of claim 1 , wherein the received signal is an audio signal.
6. The system of claim 1 , wherein the received signal is a video signal.
7. The system of claim 1 , wherein the received signal is a light signal.
8. The system of claim 1 , wherein the output signal is an audio signal.
9. The system of claim 1 , wherein the output signal is a video signal.
10. The system of claim 1 , wherein the output signal is a light signal.
11. The system of claim 1 , wherein the input/output hardware is a microphone.
12. The system of claim 1 , wherein the input/output hardware is a speaker.
13. The system of claim 1 , wherein the input/output hardware is a renderer.
14. A media synchronization method implemented by a computer, comprising:
receiving a signal;
determining a first sample rate of an external device;
calculating a difference between a second sample rate of the computer and the first sample rate based on timing of communications between the computer and the external device and on the communications' delay time;
determining a rate scalar based on the calculated difference;
converting the received signal by applying the rate scalar; and
outputting the converted signal such that the output signal is synchronized with an output of the external device.
15. The method of claim 14 , wherein the calculating a difference between the first sample rate and the second sample rate includes:
sending a query to the external device at a first time;
receiving a response to the query at a second time;
determining a delay of a network over which the query is sent;
determining a level of de-synchronization based on a difference between the first time and the second time less the network delay; and
determining the difference between the first sample rate and the second sample rate based on the determined level of de-synchronization.
16. The method of claim 14 , wherein a protocol for a first communication link between the computer and the external device and a protocol for a second communication link between the computer and the external device are different from each other.
17. The method of claim 14 , wherein the received signal is one of an audio signal, a video signal, or a light signal.
18. A non-transitory computer-readable medium storing program instructions that, when executed, cause a processor to perform a method, the method comprising:
receiving a signal;
determining a first sample rate of an external device;
calculating a difference between a second sample rate of the computer and the first sample rate based on timing of communications between the computer and the external device and on the communications' delay time;
determining a rate scalar based on the calculated difference;
converting the received signal by applying the rate scalar; and
outputting the converted signal such that the output signal is synchronized with an output of the external device.
19. The medium of claim 18 , wherein a protocol for a first communication link between the computer and the external device and a protocol for a second communication link between the computer and the external device are different from each other.
20. The medium of claim 18 , wherein the received signal is one of an audio signal a video signal, or a light signal.
21. The method of claim 14 , wherein the output signal is one of an audio signal, a video signal, or a light signal.
22. The method of claim 14 , wherein the input/output hardware is one of a microphone, a speaker, or a renderer.
23. The medium of claim 18 , wherein the output signal is one of an audio signal, a video signal, or a light signal.
24. The medium of claim 18 , wherein the input/output hardware is one of a microphone, a speaker, or a renderer.