SYNCHRONIZATION IN AUDIO PLAYBACK NETWORK INDEPENDENT OF SYSTEM CLOCK

20180012631 · 2018-01-11

Assignee

Inventors

Cpc classification

International classification

Abstract

A method is provided for synchronizing playback of audio an/or video by a plurality of separate devices in a computer network. Each separate device generates a virtual clock in response to a timing of the audio codec of a received audio stream. Either the virtual clock is generated directly in response to the tick counter of the audio codec, or by a periodic measurement of the timing of the audio codec interpolated by a monotonic clock. A sample rate converter may be used to slightly adjust the frequency of the virtual clock.

Claims

1. A method for synchronizing playback of audio and/or video from a source in network of a plurality of separate devices in a computer network session, wherein each of the separate devices in the computer network session are programmed to: receive an audio stream according to an audio codec via the computer network, generate a virtual clock in response to a timing tick counter of a clock system of the audio codec, and use the virtual clock for synchronizing audio and/or video playback.

2. (canceled)

3. Method according to claim 1, wherein the virtual clock is generated in response to periodic measurements of the audio codec clock.

4. Method according to claim 3, wherein the virtual clock is generated in response to an interpolation between said periodic measurements of the audio codec clock.

5. Method according to claim 4, wherein a monotonic helper clock is used to interpolate time between said periodic measurements of the audio codec clock.

6. Method according to claim 1, wherein the virtual clock is adjustable with respect to clock frequency, so as to allow synchronization to an other clock, such as by means of a sample rate converter to slightly lengthen or shorten time for playback of individual buffers.

7. Method according to claim 1, wherein at least one of the plurality of separate devices comprises a loudspeaker arranged to playback audio streamed to the device in a wired or wireless network session in a synchronized manner, such as in accordance with synchronization information provided by a session leader.

8. Method according to claim 1, wherein at least one of the plurality of separate devices comprises a display arranged to show video streamed to the device in a wired or wireless network session in a synchronized manner, such as in accordance with synchronization information provided by a session leader.

9. Method according to claim 1, wherein the computer network is a wireless computer network, such as a wi-fi network.

10. Method according to claim 1, wherein the virtual clock is used to synchronize an event other than playback of audio and/or video.

11. Method according to claim 10, comprising receiving an audio stream of zeros, i.e. a no-audio signal (silence), in order to provide a reference of timing to generate the virtual clock in response to the timing of the audio codec virtual clock.

12. A protocol for controlling a plurality of separate devices in a computer network, wherein the protocol implemented in each of the separate devices in the computer network session comprises: receiving an audio stream according to an audio codec via the computer network, generating a virtual clock in response to a tick counter of a clock system of the audio codec, and using the virtual clock for synchronizing audio and/or video playback.

13. A computer executable program code arranged to perform the method according to claim 1.

14. (canceled)

15. A device comprising a processor and a network interface arranged to receive audio and/or video via a computer network from a source in a synchronized manner in response to synchronization information, such as synchronization information from a session leader, wherein the processor is programmed to operate according to the method according to claim 1.

16. Device according to claim 15, wherein the device comprises an audio device arranged to receive audio data via the network interface and playback an acoustic signal accordingly.

17-18. (canceled)

19. An electronic chip comprising an implementation of the protocol according to claim 12.

Description

BRIEF DESCRIPTION OF THE FIGURES

[0018] The invention will now be described in more detail with regard to the accompanying figures of which

[0019] FIG. 1 illustrates one embodiment of a virtual clock (10) based on an Audio CODEC (12), with the possibility of fine tuning,

[0020] FIG. 2 shows discrete updates of the virtual clock in terms of measurement points (30), and how time is interpolated between them (32), and

[0021] FIG. 3 illustrates steps of a virtual clock synchronization scheme embodiment.

[0022] The figures illustrate specific ways of implementing the present invention and are not to be construed as being limiting to other possible embodiments falling within the scope of the attached claim set.

DETAILED DESCRIPTION OF THE INVENTION

[0023] FIG. 1 illustrates an audio pipeline, where an audio source (22) delivers its audio data to the audio driver (16) with an intermediate sample rate converter (18).

[0024] The Audio CODEC (12) is driven by a clock system (14), and produces an audio signal (digital or analog) which is passed on to downstream elements (20), such as a loudspeaker or an amplifier.

[0025] The virtual clock (10) can be driven by the clock system (14) or the audio driver (16), depending on the hardware and operating system configuration. The helper clock (24) may be needed, if the clock system (14) does not provide a tick counter. The Sample rate converter (18) is used to adjust the playback rate, in case the clock system (14) frequency cannot be fine-tuned.

[0026] Defining a virtual clock (10), which is driven by the audio codec (12) of an audio device, allows reasoning about time in the domain of the audio device. By allowing the current time to be read and adjusted with minimal involvement of other clocks or timing sources, the virtual clock maintains a close relationship with the audio codec timing of a single sample. This is preferred to allow high quality synchronization between multiple devices across a computer network.

[0027] In order to be independent of the audio driver architecture, the virtual clock can be implemented in at least the two preferred ways: One utilizing direct access to the tick counter of clock system of the audio codec, and one making periodic measurements and interpolating between these measurements.

[0028] For systems that allow access to the tick counter of the clock system (14), which drives the audio codec (12), the tick counter will be used as the primary timing information. Reading the value of the virtual clock will therefore return the tick counter value. However, in order to deal with overflows of the tick counter, a value internal to the virtual clock is added, as will be described shortly.

[0029] In systems, where the tick counter of the clock system driving the audio codec cannot be accessed, the virtual clock is controlled by either a) keeping track of the pace at which samples are consumed by the audio driver (16), or, b) interrupts at regular intervals generated by the clock system (14).

[0030] FIG. 2 shows discrete updates of the virtual clock in terms of measurement points (30), and how time is interpolated between them (32). In general, this yields regular measurement points (30). The rate of these are either equal to the number of write interactions with the audio driver, or with the rate of interrupts generated by the clock system (14). In order to allow the virtual clock to have a resolution higher than this rate, a monotonic helper clock (24) is used to interpolate time (32) between the measurement points (30) that these updates constitute. An example of such a monotonic clock is the monotonic system clock. In order to ensure that the frequency of the virtual clock follows that of the audio codec, a frequency adjustment is made when interpolating as to match the audio codec's frequency, as measured between the updates. The frequency of audio driver interaction or the frequency of the interrupt is kept high enough such that the period where interpolation occurs is short. Each update (interrupt or driver interaction) will correct any drift introduced by the monotonic helper clock.

[0031] In order to allow a virtual clock to be synchronized with one or more other clocks, it must be possible to adjust the frequency of the virtual clock (and thus the audio codec's playback rate) ever so slightly, as large or abrupt adjustments are perceptible to the human ear. For systems that allow direct control with the clock system (14) of the audio codec (12), this adjustment can be made directly. For systems where this is not possible, a sample rate converter (18) may be used to slightly lengthen or shorten playback time of individual buffers.

[0032] In order to allow the virtual clock to be used to synchronize playback within the audio network, it is preferably be monotonic. When a tick counter is provided by the clock system (14), the absolute value of the virtual clock is a sum of the tick counter and an offset internal to the virtual clock. When the tick counter of the underlying clock shows non-monotonic behavior, the virtual clock compensates for this by increasing its internal offset. If no tick counter is provided, the virtual clock's internal offset is increased on each timer update, be it driven by an interrupt or an audio driver interaction. If the interpolation between two updates results in non-monotonic behavior, the virtual clock compensates by temporarily increasing the internal offset, and adjusting the frequency used for interpolations until next update. This ensures monotonicity of the virtual clock, regardless of the physical clock or audio driver behavior.

[0033] Using the virtual clock to synchronize events requires the virtual clock to be running at all times. However, being dependent on the audio codec's clocking, audio needs to pass through the audio pipeline in order for the virtual clock to be running. This can be achieved by playing zeros: There is no audio, but the entire audio pipeline is kept running, and timing is maintained.

[0034] FIG. 3 shows an example of steps of a synchronization scheme embodiment, where a virtual clock is generated in response to the incoming audio stream, and wherein the virtual clock is used to synchronize playback of audio and/or video, and/or an other event.

[0035] To sum up: the invention provides a method for providing a synchronization in a computer network for synchronized playback of audio an/or video by a plurality of separate devices. Each separate device generates a virtual clock in response to a timing of the audio codec of a received audio stream. Either the virtual clock is generated directly in response to the tick counter of the audio codec, or by a periodic measurement of the timing of the audio codec interpolated by a monotonic clock. A sample rate converter may be used to slightly adjust the frequency of the virtual clock.

[0036] Although the present invention has been described in connection with the specified embodiments, it should not be construed as being in any way limited to the presented examples. The scope of the present invention is to be interpreted in the light of the accompanying claim set. In the context of the claims, the terms “including” or “includes” do not exclude other possible elements or steps. Also, the mentioning of references such as “a” or “an” etc. should not be construed as excluding a plurality. The use of reference signs in the claims with respect to elements indicated in the figures shall also not be construed as limiting the scope of the invention. Furthermore, individual features mentioned in different claims, may possibly be advantageously combined, and the mentioning of these features in different claims does not exclude that a combination of features is not possible and advantageous.