An Apple patent (number 8037220) for techniques for providing audio for synchronized playback by multiple devices has appeared at the US Patent & Trademark Office. The invention relates to synchronizing audio with multiple devices and, more specifically, to handling the communication of audio information between applications and multiple devices.
The patent involves an audio system communicates with an aggregate device that includes multiple audio devices. When providing audio data for playback, the system compensates for presentation latency differences between the various audio devices. In addition, the system adjusts for device clock drift by selecting a master device and resampling the audio data provided to the other devices based on the difference between the device clock of the master device and the device clocks of the other devices. The inventors are Jeffrey C. Moore, William G. Stewart, and Gerhard H. Lengeling.
Here’s Apple’s background and summary of the invention: “Electronic devices, such as computer systems, typically communicate with audio devices through device drivers associated with the audio devices. For example, a computer system plays sound on a speaker by sending audio information to a device driver designed for the speaker. Similarly, a computer system captures audio information from a microphone by receiving audio data from the device driver associated with the microphone.
“Various approaches may be used to handle the communication of audio information between client applications (“clients”) that use audio information and the device drivers of audio devices. For example, according to an interrupt-based approach, a direct connection is established between the driver and its client application. Any time the driver wants audio data from the client, the driver raises an interrupt, suspending other activity on the Central Processing Unit (CPU) of the computer system on which the client is running. Therefore, for a certain period of time, the driver is in control of the computer system.
“To avoid problems associated with the interrupt approach, a ‘ring buffer’ approach has been developed. According to the ring buffer approach, execution of a device driver is decoupled from execution of its client application by using a ring buffer as a rendezvous point for communicating audio data between the device driver and the client application. Specifically, the device driver for a playback device reads audio data from the ring buffer without directly communicating with the client application.
“The client application, in turn, feeds audio data into the ring buffer ahead of the device driver so that the device driver continues to have new audio data to read. Similarly, the device driver for a recording device writes audio data into the ring buffer without directly communicating with the client application. The client application, in turn, reads audio data from the ring buffer at a rate to ensure that the device driver does not overwrite unread audio data.
“As audio systems become more sophisticated, the type and number of audio devices used by a system has increased. Consequently, there is a need to be able to send audio to multiple playback devices connected to a system in a manner that results in synchronized playback by the multiple devices. Similarly, there is a need to be able to consume audio from multiple audio sources connected to a system, to allow a single client application to concurrently consume audio from the various audio sources.”
— Dennis Sellers