Radio equipment for transmitting digital audio streams
By using controllable oscillators and timers in radio receiver equipment, measuring data packet intervals and adjusting the output rate, the buffer problem caused by the lack of synchronized clocks in radio communications is solved, achieving stable audio output, reducing artifacts and Reduce power consumption.
Patent Information
- Application Number
- CN202080059552.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-08-23
- Filing Date
- 2020-08-20
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-08-20
AI Technical Summary
In radio communication links, when the transmitting and receiving devices do not contain synchronized clocks, buffer underruns or sudden rate changes may occur when the received digital audio stream is converted to an analog signal, introducing audible artifacts.
By using a controllable oscillator and timer in the radio receiver device, the received radio data packet intervals are measured and the output rate is incrementally adjusted while outputting the audio samples to avoid buffer underruns or overflows while avoiding Sudden change in output rate.
Buffer underruns or overflows are effectively avoided, artifacts due to output rate changes are reduced, and in some embodiments, the audio output rate can be controlled more effectively than using an asynchronous sample rate converter, such as using a lower power consumption.
Smart Images

Figure CN114270735B_ABST
Abstract
Description
Background Art
[0001] The present invention relates to a radio device and a method for transmitting a digital audio stream.
[0002] As is known, via a radio communication link (such as Bluetooth TM or WiFi channel) for substantially real-time output (i.e., with minimal buffering on the receiving device). Such technology can be used for wireless phone headsets, wireless headphones, wireless speakers, etc.
[0003] However, when the transmitting and receiving devices do not include synchronized clocks, it is not straightforward to ensure that the received digital audio stream is converted to analog (or otherwise processed) at a rate that avoids the introduction of audible artifacts. Such artifacts may occur, for example, due to buffer underruns, or due to abrupt changes in the output rate to avoid buffer underruns.
[0004] The present invention aims to solve this problem. Summary of the invention
[0005] According to a first aspect, the invention provides a radio communication system comprising a radio transmitter device and a first radio receiver device,
[0006] wherein the radio transmitter device is configured to transmit, at fixed intervals, to the first radio receiver device, a sequence of radio data packets encoding a digital audio stream, wherein each radio data packet encodes a respective number of audio samples from the digital audio stream, and
[0007] Wherein, the first radio receiver device comprises:
[0008] a radio circuit for receiving said sequence of radio data packets;
[0009] A digital audio interface for outputting audio samples from a received digital audio stream;
[0010] a controllable oscillator configured to control an output rate at which the audio samples are output from the digital audio interface;
[0011] timer; and
[0012] Control logic is configured to use a timer to measure an interval between receiving each of a pair of radio data packets and, while outputting audio samples from one radio data packet, control an oscillator to incrementally change the output rate in a plurality of steps, wherein the number of steps or the size of each step or both depends on the measurement interval.
[0013] According to a second aspect, the present invention provides a radio receiver apparatus comprising:
[0014] a radio circuit for receiving a sequence of radio data packets transmitted at fixed intervals, the sequence of radio data packets encoding a digital audio stream, wherein each radio data packet encodes a respective number of audio samples from the digital audio stream;
[0015] A digital audio interface for outputting audio samples from a received digital audio stream;
[0016] a controllable oscillator configured to control an output rate at which the audio samples are output from the digital audio interface;
[0017] timer; and
[0018] Control logic is configured to use a timer to measure an interval between receiving each of a pair of radio data packets and, while outputting audio samples from one radio data packet, control an oscillator to incrementally change the output rate in a plurality of steps, wherein the number of steps or the size of each step or both depends on the measurement interval.
[0019] According to a third aspect, the present invention provides a method for processing a digital audio stream, the method comprising:
[0020] receiving a sequence of radio data packets transmitted at fixed intervals, the sequence of radio data packets encoding a digital audio stream, wherein each radio data packet encodes a corresponding number of audio samples from the digital audio stream;
[0021] Outputting audio samples from a received digital audio stream at a variable output rate;
[0022] measuring an interval between receiving each of a pair of radio data packets; and
[0023] While outputting audio samples from one radio data packet, the output rate is incrementally adjusted in a plurality of steps, wherein the number of steps or the size of each step or both depend on the measurement interval.
[0024] It can thus be seen that, according to the present invention, audio samples from a single data packet are output at a rate that can be changed over the course of a single packet when appropriate, wherein the rate of change of the output rate depends on the measurement interval between the incoming radio data packets. In this way, the receiver can avoid buffer underruns or buffer overflows by correcting the output rate over the course of a single packet while avoiding sudden changes in the output rate. In at least some embodiments, the receiver can also control the audio output rate more efficiently (e.g., using lower power consumption) than an apparatus using an asynchronous sample rate converter.
[0025] In some embodiments, the number of steps (when non-zero) may be as low as one step, at least for one or more received radio data packets. However, in a preferred embodiment, the control logic is capable of controlling the oscillator to change the output rate in multiple steps while outputting audio samples from one radio data packet, e.g., changing the output rate at least two, ten, one hundred, or one thousand times while outputting the audio samples contained in one data packet. A large number of steps reduces any artifacts caused by step changes in the output rate by making the output rate vary more nearly linearly over the duration of one data packet.
[0026] In some embodiments, the step size and / or the number of steps are fixed while outputting audio samples from one radio data packet.The control logic may be configured to determine a respective step size and / or a respective number of steps for outputting audio samples from each consecutive radio data packet.
[0027] In some embodiments, the control logic may be configured to repeatedly determine the number of steps before or upon commencing output of frequency samples from each successive radio data packet.
[0028] In some cases, it may not be necessary to change the output rate; therefore, for some data packets, the step size and / or the number of steps may be set to zero.
[0029] The controllable oscillator may provide an interface (e.g., a register interface) for receiving data from the control logic, the data representing the step size and / or the number of steps. The oscillator may include a circuit for incrementally changing its output rate, for example, within a predetermined period (e.g., the nominal duration of the audio stream contained in one data packet), based on the received step size and the number of steps. In some embodiments, the controllable oscillator may provide an interface for configuring the step interval. The step interval may be selected from a set of step interval values. The step interval is configurable so that when the step size is non-zero, it corresponds to between about 100 steps and about 1000 steps on the interval between receiving the pair of radio data packets.
[0030] The controllable oscillator may comprise a sigma-delta modulator.
[0031] The receiver may include an interface circuit (e.g., an I2S peripheral) for controlling the output of audio samples from a digital audio interface. The controllable oscillator may output a periodic signal to the audio interface circuit, which may determine the output rate from the digital audio interface. The audio interface circuit may set the output rate equal to the frequency of the periodic signal, or to a predetermined multiple or fraction of the frequency.
[0032] The digital audio interface may be an external interface of the receiver device, such as an S / PDIF (Sony / Philips Digital Interface) port. However, in other embodiments, the digital audio interface is an internal interface (e.g., a connection to an Inter-Integrated Circuit Audio (I2S) bus of the receiver device) that may be used to output audio samples to another component of the receiver device (e.g., to a digital-to-analog converter (DAC) within the receiver device).
[0033] In some embodiments, the radio receiver device includes a DAC, an amplifier, and an acoustic transducer (such as a speaker) for outputting the audio stream as sound. The radio receiver device may be or include wireless headphones, wireless earphones, wireless speakers, a smartphone, a home assistant, or any other device with audio output capability.
[0034] The radio transmitter device may be or include a server, a router, a television, a smartphone, a cellular network base station, or any other suitable apparatus or device.
[0035] The radio transmitter device and the radio receiver device may be asynchronous (except for periodic transmission of radio data packets). The two devices may include respective clocks that are asynchronous to each other. The receiver device may use its asynchronous clock to provide a clock signal to digital logic in the radio circuit and / or control logic.
[0036] In some embodiments, each radio data packet of the sequence of radio data packets may encode the same number of audio samples from the digital audio stream.
[0037] The pair of received radio data packets may be adjacent radio data packets of a sequence of radio data packets, although this is not necessary. The radio data packets may be the two most recently received radio data packets in the sequence.
[0038] The interval may be between the reception time of the first element in the first radio data packet and the reception time of the second element in the second radio data packet. The first and second elements may have a common location with the corresponding data packet. These elements may be address fields in the corresponding data packet. In this way, the interval may be consistently timed between multiple pairs of data packets in a sequence.
[0039] The interval between each pair of adjacent radio data packets within the received sequence can be measured. Each interval can be used to adjust a variable output rate of audio samples for outputting a radio data packet, which can be one of the radio data packets of the corresponding pair (e.g., the later received data packet in the pair), or another subsequently received radio data packet.
[0040] The timer can include a hardware timer circuit or a software-based timer. A hardware timer can provide greater accuracy.
[0041] The control logic may be configured to repeatedly determine whether to adjust the output rate each time the sequence of radio data packets is received.
[0042] The control logic may include hardwired control circuitry (ie, digital logic). However, in some embodiments, the receiver device includes a processor (eg, an ARM TM Cortex-M TM A processor) and a memory storing software for execution by the processor. The control logic may be at least partially implemented by the software.
[0043] The control logic may control the oscillator by writing a value representing the number of steps and / or a value representing the step size to one or more registers of the controllable oscillator.
[0044] The oscillator may have a starting frequency which is configurable (e.g. by writing it to a register of the oscillator). The control logic may set the starting frequency once for a digital audio stream (e.g. before receiving the first data packet of the digital audio stream). It may then, when required, incrementally adjust the output rate over the duration of the audio stream by controlling the step size and number of steps to be performed on each data packet of the sequence of radio data packets.
[0045] The receiver device may be configured to measure the interval between each of a pair of frames of output audio samples, wherein each frame is composed of audio samples contained in a corresponding radio data packet. The number of steps or the size of each step or both may further depend on the measurement interval between a pair of output frames. The receiver may use a hardware timer to perform the measurement. The pair of frames may be adjacent frames of an audio stream, but this is not necessary. The interval may be between the output of a first element in a first frame and the output time of a second element in a second frame. The first and second elements may have a common position with the corresponding frame. These elements may be the first sample of each frame.
[0046] The control logic may be configured to compare the interval between receiving each of the pair of radio data packets and outputting the interval between the audio samples contained in these radio data packets or contained in the second pair of radio data packets. The second pair of data packets may have a radio data packet identical to the first pair of data packets, or may be composed of two other data packets (e.g., two earlier received data packets). In some cases, it may be advantageous to use the same two radio data packets because the interval between these packets may capture any short-term changes in the clock rate of the transmitter device that occurs when the corresponding audio samples are generated or processed for transmission. If an earlier radio data packet interval is used, or if the interval is measured on multiple radio data packets, such changes may be missed, resulting in less accurate reconstruction of the sampling rate.
[0047] The control logic can calculate the step size and / or the number of steps to give an average (average) output rate over a time window that is equal to the transmission rate over the same interval as the time window duration (but may deviate from the time window in time). The duration of the time window may be equal to the duration of a (uncompressed) digital audio stream or any other duration, wherein the digital audio stream is transmitted by two radio data packets or one radio data packet. The correct average rate for two radio data packets allows a buffer delay of a complete radio data packet, which may help ensure uninterrupted audio output.
[0048] In some embodiments, the control logic can be configured to determine the step size and / or number of steps that achieves the desired output rate at the minimum step size, subject to any restrictions on the step size and / or step interval set by the device. The control logic can control the oscillator to use that step size and / or number of steps. In situations where more than one combination of step size and step interval will achieve the desired output rate, this may help reduce sound distortion.
[0049] The digital audio stream may be compressed within a radio data packet. The digital audio stream may be compressed according to MPEG, aptX or other audio streaming protocols. The receiver device may include circuitry and / or software for decompressing the audio samples.
[0050] The structure of the radio data packets and / or the radio communication protocol used by the radio transmitter and receiver may partially or completely conform to Bluetooth TM or Bluetooth TM Low Energy version of the specification. Digital audio streaming can be done over one or more Bluetooth TM Low power synchronous channel transmission.
[0051] The receiver device may include a buffer memory for buffering audio samples from a received digital audio stream before outputting the audio samples from the digital audio interface. The buffer memory may receive the audio samples from a decompression unit or a codec. The size of the buffer memory may be set to store audio samples from at least one, two or more radio data packets. The buffer memory may include a set (e.g., a pair) of buffers (e.g., first-in, first-out buffers) that may be used cyclically or alternately to buffer audio samples from corresponding consecutive radio data packets. A pair of buffers (each buffer sized to store audio samples from one radio data packet) may be particularly memory-efficient while avoiding buffer underruns.
[0052] In some embodiments, the radio communication system may include a second radio receiver device. The system may be configured to receive a second audio stream from a radio transmitter device. For example, a first receiver may receive a left stream of a stereo audio stream, and a second receiver may receive a right stream. The second receiver may have any of the features disclosed herein in the context of the first radio receiver. Both receivers may keep their audio output rate consistent with the transmission rate of the transmitter device. Each radio receiver may be configured to start outputting an audio stream at the same predetermined interval after receiving the first radio data packet of the sequence. Thus, the two streams may remain aligned for the duration of the audio stream. The system may include additional receivers, such as Dolby TM Part of a 5.1 surround sound system.
[0053] In some embodiments, the radio receiver device can be a radio transceiver device. The device can also be configured to send a sequence of output radio data packets for encoding an output digital audio stream. Each output radio data packet can encode a corresponding number of audio samples from the output digital audio stream, and the number can be a constant on the stream. The output radio data packets can be sent to the above-mentioned radio transmitter device, or different devices. The radio receiver device can include a microphone or other audio inputs for generating an output digital audio stream. This arrangement may be useful, for example, in a voice-controlled home assistant device, when full-duplex or half-duplex telecommunication support is required.
[0054] The radio transceiver device may include a digital audio interface for receiving audio samples for transmission in an output digital audio stream, and a buffer memory for buffering the audio samples received at the output digital audio interface. The device may include a controllable oscillator (which may be the above-mentioned controllable oscillator or a different oscillator) configured to control the buffer rate at which the audio samples are input to the buffer memory. The device may include control logic configured to control the oscillator to incrementally change the output rate with multiple steps while the audio samples of a radio data packet are input to the buffer memory. The number of steps or the size of each step or both may depend on the aforementioned measurement interval.
[0055] In some embodiments, the radio transceiver device need not receive and process the incoming digital audio stream at all.
[0056] Therefore, viewed from another aspect, the present invention provides a radio communication system comprising a radio transmitter device and a radio transceiver device,
[0057] wherein the radio transmitter device is configured to send a sequence of radio data packets to the radio transceiver device at fixed intervals,
[0058] Wherein, the radio transceiver device comprises:
[0059] a radio receiving circuit for receiving a sequence of incoming radio data packets;
[0060] a radio transmission circuit for transmitting a sequence of output radio data packets encoding an output digital audio stream, wherein each respective output radio data packet of the sequence of output radio data packets corresponds to a respective input radio data packet of the sequence of input radio data packets;
[0061] a digital audio interface for receiving audio samples for transmission in an output digital audio stream;
[0062] a buffer memory for buffering audio samples received at the digital audio interface;
[0063] a controllable oscillator configured to control a buffering rate at which audio samples are input to a buffer memory;
[0064] timer; and
[0065] Control logic is configured to use a timer to measure an interval between receiving each of a pair of input radio data packets and control an oscillator to incrementally change the buffering rate in a plurality of steps while inputting audio samples of one radio data packet into a buffer memory, wherein the number of steps or the size of each step or both depends on the measurement interval.
[0066] Viewed from another aspect, the present invention provides a radio transceiver device comprising:
[0067] a radio receiving circuit for receiving a sequence of incoming radio data packets transmitted at fixed intervals;
[0068] a radio transmission circuit for transmitting a sequence of output radio data packets encoding an output digital audio stream, wherein each respective output radio data packet of the sequence of output radio data packets corresponds to a respective input radio data packet of the sequence of input radio data packets;
[0069] a digital audio interface for receiving audio samples for transmission in an output digital audio stream;
[0070] a buffer memory for buffering audio samples received at the digital audio interface;
[0071] a controllable oscillator configured to control a buffering rate at which audio samples are input to a buffer memory;
[0072] timer; and
[0073] Control logic is configured to use a timer to measure an interval between receiving each of a pair of input radio data packets and control an oscillator to incrementally change the buffering rate in a plurality of steps while inputting audio samples of one radio data packet into a buffer memory, wherein the number of steps or the size of each step or both depends on the measurement interval.
[0074] From another aspect, the present invention provides a method for transmitting a digital audio stream, the method comprising:
[0075] receiving a sequence of incoming radio data packets transmitted at regular intervals;
[0076] measuring an interval between receiving each of a pair of incoming radio data packets;
[0077] inputting audio samples of an output digital audio stream into a buffer memory at a variable buffer rate;
[0078] transmitting a sequence of output radio data packets encoding an output digital audio stream, wherein each output radio data packet encodes a respective number of buffered audio samples, and wherein each respective output radio data packet of the sequence of output radio data packets corresponds to a respective input radio data packet of the sequence of input radio data packets; and
[0079] While audio samples of one radio data packet are being input into the buffer memory, the buffer rate is incrementally changed in a plurality of steps, wherein the number of steps or the size of each step or both depend on the measurement interval.
[0080] The radio receiver device may have some or any of the features disclosed with reference to the radio receiver device of the previous aspect. The output digital audio stream may be transmitted via one or more Bluetooth TM Low power synchronous channel transmission.
[0081] A corresponding outgoing radio data packet may be sent in response or reply to each incoming radio data packet.The time interval between receiving an incoming radio data packet and transmitting a corresponding outgoing radio data packet may be constant or variable, but is preferably always smaller than the interval between consecutive incoming radio data packets.
[0082] The buffer memory may be sized to hold audio samples of at least one, two or more outgoing radio data packets. The buffer memory may include a set (e.g. a pair) of buffers (e.g. a first-in first-out buffer) that may be used cyclically or alternately to buffer audio samples of corresponding consecutive outgoing radio data packets. A pair of buffers (each buffer is sized to hold the audio samples of one radio data packet) may be particularly memory efficient while avoiding buffer underruns.
[0083] The audio samples may be output from the buffer memory to a compression unit or codec for compressing the output digital audio samples before they are transmitted by the radio transmit circuitry.
[0084] The digital audio interface may be configured to receive audio samples from a digital microphone, an analog-to-digital converter (ADC), or another digital audio source, any of which may be internal or external to the radio transceiver device. The oscillator may control the buffering rate by outputting a clock signal to an audio supply component (such as a digital microphone or ADC) that may be used to control the rate at which audio samples are received at the digital audio interface.
[0085] The sequence of incoming radio data packets may have an empty data payload, or may contain only non-audio data. However, in some embodiments, the sequence of incoming radio data packets may encode a digital audio stream that may be processed by the radio transceiver, or may be ignored by the radio transceiver (e.g., for use with a different device).
[0086] In some embodiments, a controllable oscillator for controlling the buffering rate of output audio samples may also be used to control the output rate of input audio samples of an input digital audio stream output from a digital audio output interface of the device. The output rate may be the same as the buffering rate (e.g., if the input and output audio streams have the same bit rate), or there may be a constant ratio between the output rate and the buffering rate. The same digital audio interface may be used for input and output audio samples, or there may be different corresponding interfaces.
[0087] In any embodiments disclosed herein, the transmitter, receiver, or transceiver device may include any one or more of the following: a processor, a power supply, digital logic, a DSP, an ASIC, volatile memory, non-volatile memory (e.g., for storing software and / or persistent data), active electronic components, passive electronic components, antennas, amplifiers, filters, timers, inputs, outputs, etc.
[0088] Features of any aspect or embodiment described herein may be applied to any other aspect or embodiment described herein where appropriate.When referring to different embodiments or sets of embodiments, it should be understood that these embodiments are not necessarily different, but may overlap. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Certain preferred embodiments of the present invention will now be described, by way of example only, with reference to the accompanying drawings, in which:
[0090] Figure 1 is a schematic diagram of an audio distribution system embodying the present invention;
[0091] Figure 2 is a schematic diagram of a receiver device embodying the present invention;
[0092] Figure 3is a timing diagram illustrating radio data packets received and processed according to an embodiment of the present invention;
[0093] Figure 4 is a schematic diagram of the elements of the software and hardware architecture of the receiver device;
[0094] Figure 5 is a schematic diagram of a controllable oscillator of a receiver device;
[0095] Figure 6 is a graph of the output frequency of the controllable oscillator changing with time;
[0096] Figure 7 is a flow chart of steps performed by software running in a receiver device; and
[0097] Figure 8 is a schematic diagram of elements of the software and hardware architecture of an audio recording device embodying the present invention. DETAILED DESCRIPTION
[0098] Figure 1 A system for distributing stereo audio streams from a server 1 to a pair of wireless speakers 2a, 2b is shown. The server 1 sends a left audio stream encoded in a first sequence of radio data packets to the first wireless speaker 2a, and sends a right audio stream encoded in a second sequence of radio data packets to the second wireless speaker 2b.
[0099] The server 1 may send the radio data packets using any suitable radio protocol. The data packet structure may be specified by the protocol. In one set of embodiments, the data packets conform to Bluetooth TM A version of the low power protocol.
[0100] It is important that both loudspeakers 2a, 2b accurately play back the left and right audio streams at the correct speed so that the left and right audio outputs are correctly synchronized.
[0101] The loudspeakers 2a, 2b do not have internal clocks that are precisely synchronised with the server 1. Instead, they use the timing of the radio data packet stream itself to control the speed of the audio playback, as described below.
[0102] Figure 2 More details are provided of some of the internal hardware components of the speaker 2. The two speakers 2a, 2b have essentially the same hardware and software (although their functionality differs, for example if the radio protocol requires one of the speakers 2a, 2b to play a primary role and the other a secondary role).
[0103] The loudspeaker 2 contains a radio microcontroller chip 4, an audio microcontroller chip 5 and other components 6-11 within a housing 3.
[0104] Radio chip 4 supports Bluetooth TM Low-power communications. The chip can also support other radio protocols such as IEEE 802.11, 3GPP LTE Cat-M1, 3GPP LTE NB-IoT, IEEE 802.15.4, Zigbee TM 、Thread TM ANT TM The chip contains radio receiver circuits including a low noise amplifier (LNA) 13, a local oscillator (LO) 14, a quadrature mixer 15 for down-mixing an input RF signal, signal filtering 16, an analog-to-digital converter (ADC) 17, a radio memory 18, and a radio processor 19. The radio memory 18 may include volatile memory (e.g., RAM) and non-volatile memory (e.g., flash memory). The radio processor 19 may be a general-purpose processor such as an Arm processor. TM Cortex-M TM The processor may also include one or more DSPs. The radio chip 4 includes a timer 20, but may also include other peripheral devices, buses, etc., which will not be described here for simplicity.
[0105] The device 2 also includes a separate audio microcontroller chip 5, which includes its own processor 21 and memory 22 (for storing software and data), as well as a timer 23, a frequency adjustable low jitter oscillator 24 and an Inter-IC Sound bus (I2S) output peripheral 25. The device may include other peripherals, buses, etc.
[0106] The device 2 also includes a system processor 6, a system memory 7, various peripherals 8 (such as other timers and I / O modules), and a battery 9. One peripheral of particular note is a digital-to-analog converter (DAC) 10, which is connected via an I2S bus to an I2S peripheral 25 of an audio microcontroller chip 5. An audio amplifier 11 is configured to amplify the analog audio signal output by the DAC 10 in order to drive a speaker 12.
[0107] The various components of the device 2 may be connected via one or more printed circuit boards and / or may be integrated in one or more silicon chips in any suitable combination. The radio antenna 26 may be located inside or outside the housing 3 and connected to the radio chip 4. It will be appreciated that the device 2 may contain a variety of other components which are not shown for simplicity. Figure 2 Other elements shown in the figure, such as buses, crystals, digital logic, analog circuits, discrete active components, discrete passive components, other processors, user interface components, etc.
[0108] In use, software stored in the radio memory 18 is executed by the radio processor 19 to implement BluetoothTM The radio processor 19 in combination with the audio microcontroller 5 also manages the processing of the audio stream from the server 1 .
[0109] Data packets containing compressed audio are transmitted by server 1 at regular intervals (e.g. every 10 ms, as measured by server 1's clock). The transmission time may be assumed to be jitter-free. Each radio data packet contains a number of audio samples sufficient to produce audio output for at least the duration of the interval between consecutive packets (e.g. at least 10 ms of audio). For example, if data packets are transmitted every 10 ms, mono audio sampled at 48 kHz will have 480 samples in each data packet (48,000*10 ms=480). The samples are compressed using an appropriate codec. The data packets may additionally encode metadata associated with the audio stream (such as sampling rate and width).
[0110] Figure 3 The key principles used by the wireless speaker systems 1, 2 to ensure synchronized audio output are shown.
[0111] As the loudspeaker 2a, 2b receives each radio packet, it determines the time interval T that has passed between the reception of the current data packet k+1 and the reception of the previous data packet k. k This is accomplished by timing the intervals between the arrival times of common points in each corresponding packet, for example, the arrival times of the corresponding address fields of the packets (given by Figure 3 denoted by the vertical arrow in the figure).
[0112] The frequency adjustable low jitter oscillator 24 determines the rate at which audio is output from the audio microcontroller 5, i.e. the playback sampling clock rate. The frequency of the oscillator 24 is controlled by a software algorithm based on the measurement interval T k and the playback duration P of data packet k k The frequency output of oscillator 24 is adjusted by any difference between k+1 Depends on the time interval T k , and can be controlled to compensate for any early inaccuracies in the playback rate. In this way, the playback rate of each loudspeaker 2a, 2b is matched to the clock of the server 1, rather than relying on a local, unsynchronized clock within each loudspeaker 2a, 2b, so that the playback rates of the two loudspeakers 2a, 2b remain consistent (at least on average over a suitable period of time). As the audio stream carried by the current packet k is output, the software algorithm incrementally adjusts the oscillator 24 to avoid any sudden jumps in rate, which could otherwise cause audible artifacts.
[0113] Figure 4The hardware and software components in each speaker 2 are shown, which work together to control the rate at which the received audio stream is output from the I2S peripheral 25 to the DAC 17. These operations are shared between the radio microcontroller unit (MCU) domain 4' and the audio MCU domain 5'.
[0114] The radio components in the radio MCU domain 4' are configured to detect when the address of an incoming radio packet is received with little or no jitter. This detection of the address can determine a very precise point in time that is suitable for defining when a data packet is received. Each time it is detected, the radio signals an "address" event.
[0115] The radio processor 19 receives the packet and decodes it. If the packet contains audio data, a slightly delayed version of the "address" event is forwarded to the audio MCU domain 5' via the inter-processor communication channel. The added delay provides sufficient time for the radio processor 19 to fully decode the incoming frame, and sufficient processing time for the audio microcontroller 5 to process the audio data. The added delay is constant and jitter-free, and is timed by the crystal oscillator 41 associated with the radio MCU domain 4'. This delayed address event serves as a "time reference" event.
[0116] In more detail, the reception of the address event triggers the start of a timer 20 (TIMER1) in the radio MCU domain 4'. The timer 20 is configured to output a TIMEREF event signal after a predetermined additional delay period. This TIMEREF event is a time reference event. The event is distributed to the audio microcontroller domain 5' via an inter-processor communication channel, where it is received by the I2S peripheral 25 and the second timer 23 (TIMER2). The predetermined additional delay is the worst-case processing time of the network and audio MCUs 4', 5', which can be determined by analysis or experimentation. The TIMEREF event is also fed back to TIMER1 to clear TIMER1 for the next address event.
[0117] Radio data packets that are not part of the audio chain can be handled appropriately without forwarding the time reference event. This means that the loudspeaker 2 is not limited to processing only audio. Any type of radio frame can be sent or received, or other tasks processed, without affecting the audio chain. In particular, if a received packet is not part of the audio chain, the network software stops (i.e. cancels) the timer 20 (in Figure 4 A TIMEREF event is signaled.
[0118] exist Figure 4, TIMER1 runs on a clock (obtained from the first crystal 41) that is asynchronous to both the server 1 and the I2S audio output peripheral 25, because the audio MCU domain 5' containing the I2S peripheral 25 is timed by the second crystal 42. However, in other embodiments, TIMER1 may be implemented in the audio MCU domain 5'. In some embodiments, the radio MCU domain 4' and the audio MCU domain 5' may share a crystal.
[0119] The time between two consecutive TIMEREF events is measured by the second timer 23 (TIMER2) in the MCU domain 5'. Whenever the TIMER1 timer sends a TIMEREF event signal, the software executed on the audio processor 21 captures the timer value from the second timer 23. This value represents the most recent time interval T k Although synchronized with the high frequency clock of the local system 5', the TIMEREF event is primarily dependent on the timing of the remote system 1 and the wireless communication link.
[0120] After successful decoding by the radio microcontroller 4, the payload including the compressed audio samples and metadata is transferred to the memory 22 of the audio MCU domain 5'. The audio microcontroller 5 decompresses the audio data into PCM samples (in PCM frames) using a software or hardware decoder 43 and places them in an audio buffer memory 40 within the memory 22, which can be accessed by the I2S audio output peripheral 25. The audio buffer memory 40 includes a pair of FIFO buffers, each of which is equal to or larger than a single PCM frame (or a single packet of audio content). These buffers may be located in system RAM or flash memory, or they may be dedicated registers.
[0121] The I2S peripheral 25 can receive a start task input that activates playback of the first PCM frame in the audio stream. Each PCM frame is written to one of the two frame-sized FIFO buffers in the audio buffer memory 40 in an alternating "ping-pong" manner. The I2S peripheral 25 reads from the two FIFO buffers alternately. When the I2S peripheral 25 begins processing each consecutive PCM frame, it outputs a FRAMESTART event signal. Therefore, when playback reaches the end of the first FIFO buffer, the I2S peripheral 25 signals the FRAMESTART event and starts playback from the first FIFO buffer, and vice versa, thereby generating a continuous audio stream output to the DAC 17.
[0122] The FRAMESTART event is received by the second timer 23 (TIMER2), except for T k In addition to periodic timing, the timer also independently counts the interval P between consecutive frame starts. k In addition to Tk In addition to the measured values, these P k The timer value is captured by software executed in the audio MCU domain 5'.
[0123] The events and signals referred to herein may be transmitted via a peripheral device interconnect system separate from an address or data bus, for example as disclosed in the applicant's earlier application WO 2013 / 088121.
[0124] I2S samples are output from the I2S peripheral 25 at a clock rate set by a controllable audio oscillator 24. The oscillator 24 provides a memory-mapped register interface that is accessible to the audio processor 21. The oscillator 24 can be controlled by software executing in the audio MCU domain 5' by writing appropriate values to the following three registers: FREQUENCY, FREQINC, and FREQINCPERIOD. The value written first to the FREQUENCY register determines the starting frequency of the oscillator 24. The software can set it once at the beginning of the audio stream (for example, based on metadata received from the server 1). The FREQINC and FREQINCPERIOD registers are used to gradually change the output frequency of the oscillator. The value in FREQINCPERIOD defines the time period of the timer in the oscillator 24. If a non-zero signed value is written to FREQINC, the oscillator 24 begins to repeatedly add the signed value as a frequency increment to the current output frequency stored in the FREQINC register within each time period defined by FREQINCPERIOD.
[0125] The register interface can be summarized as follows:
[0126] FREQUENCY: Indicates the current oscillator frequency. The step size is approximately 3ppm.
[0127] FREQINCPERIOD: Frequency increment period, in the range of 0μs to 10μs, with 1μs as adjustable step.
[0128] FREQINC: Every FREQINCPERIOD, this symbol value is added to the current frequency. The resolution is approximately 3ppm.
[0129] Figure 5 The controllable oscillator 24 is shown in more detail. The oscillator 24 is a device that generates a signal having an output frequency F SThe oscillator 24 is a hardware module for a signal. This signal controls the rate at which audio samples are transferred to the DAC 17 over the I2S bus, thereby providing a clock reference to the DAC 17. It takes a 32MHz input as a reference (obtained from the second crystal 42) and can generate a tunable output frequency based on one of two selectable nominal frequencies: 11.289MHz and 12.288MHz. Both frequencies are adjustable between + / -1% to support all popular sampling rates in audio DACs. The oscillator 24 includes a MASH (1,1) sigma-delta modulator (SDM) to achieve a frequency resolution of 3.3ppm and a typical jitter of 200ps.
[0130] Software executing in the audio MCU domain 5' compares the time between two frame start events with the time between two time reference events to determine whether the local sampling clock is too slow or too fast when compared to the clock used by the server 1 to send radio packets. The software uses this information to write the appropriate FREQINC and FREQINCPERIOD values so that the frequency of the oscillator 24 converges to the required frequency.
[0131] The software may use any suitable algorithm to adjust the frequency of the local audio oscillator 24 to achieve the target. A group of synchronized speakers 2a, 2b may require higher precision than a single playback device (e.g., a mono audio device), for example, sampling times consistent with microsecond accuracy, and may therefore benefit from a different adjustment process than a system including a single playback device.
[0132] One possible algorithm is linear adjustment, where the frequency is linearly increased or decreased to a level such that the average playback speed (e.g., the average of every two data packets) matches the audio transmission rate of server 1. However, more complex algorithms can be used to minimize the distortion caused by frequency adjustment.
[0133] If the frequency deviation (or error) between the frequency at the beginning of a data packet and the target frequency at the end of the data packet (duration of 10ms) is F err , the software can select a pair that satisfies the formula F err =FREQINC x (10ms / FREQINCPERIOD). In some cases, there are multiple possible FREQINC and FREQUINCPERIOD pairs that can be used to produce the desired frequency adjustment. In this case, the software can choose the smallest available FREQINC value (i.e., with the largest number of steps), which helps minimize audible distortion. For very small errors, FREQINC will be set to the smallest possible non-zero value (e.g., 1ppm), and FREQINCPERIOD will be as large as possible to minimize Ferr For larger errors, even at the fastest update rate (e.g. a FREQINCPERIOD of 1μs), a FREQINC of 1ppm may be too small an increment to correct the F err , so here FREQINC is set to be greater than 1ppm, but still as small as possible.
[0134] In some embodiments, FREQINCPERIOD can be set so that the average sampling rate is always reached within the duration of the next received PCM frame (there may be some overshoot, as described below in reference to Figure 6 explained).
[0135] The output frequency of the oscillator 24 is gradually adjusted so that the playback PCM frame rate matches the received frame rate. Once convergence is achieved, or once the average (mean) sample playback rate measured over a period of one or more frames equals the sample transmission rate of the server 1, the speakers 2a, 2b will be synchronized with the clock of the server 1 and with each other over the same period.
[0136] Figure 6 shows the playback rate being adjusted linearly (using repeated frequency increments) over the duration of each PCM frame, with a gradient determined by the values written to FREQINC and FREQINCPERIOD. It can be seen that in this example, perfect convergence is never sustained, and the output frequency F S Oscillates on either side of the packet transmission rate set by the server 1, thereby having the correct average rate A within each two-frame period.
[0137] In the playback period P of the nth frame n During this time, the software gradually increases the playback rate based on the previous determination that the rate was too low. At the beginning of the n+1th frame, the software determines that the playback rate is now too high because the interval P between the FRAMESTART event of the n+1th frame and the FRAMESTART event of the nth frame is n Less than the interval T between the time reference event of the n+1th data packet (including the n+1th frame) and the time reference event of the nth data packet (including the nth frame) n Therefore, the software calculates the appropriate negative increment (decrement) and time period and writes it to the FREQINC and FREQINCPERIOD registers. This causes the oscillator output to be stepped down over the playback duration of the n+1th frame, thereby avoiding the risk of buffer underruns due to one FIFO buffer of the audio buffer memory 40 being completely played out before the n+2th data packet has been received into the other FIFO buffer. Because the oscillator 24 needs to be set to compensate for the period P n and Pn+1 The playback rate is higher than the long-term average A, so in period P n+1 At the end, the frequency will be very high. Therefore, in the next interval P n+2 During this time, software writes a positive increment and the time period to the FREQINC and FREQINCPERIOD registers.
[0138] In addition to giving the correct average rate over the two frame period and avoiding buffer underruns or overflows, this approach also inherently adjusts for any long term changes in the server 1 clock frequency (eg due to temperature changes).
[0139] Of course, while the audio buffer memory 40 is described here as buffering only two frames to minimize latency, other embodiments may provide a larger buffer and may update the settings of the oscillator 24 at different points in time, but the overall effect is the same.
[0140] To ensure that playback of the first PCM frame of the audio stream (i.e. encoded in data packet P0) starts at the correct time, the initial time reference event is used to start the I2S peripheral 25 by triggering its startup task. This can be done by connecting the radio MCU domain 4' to a dedicated event signaling line of the I2S peripheral 25, rather than via a bus that may be subject to contention. In this way, the delay is predictable (e.g., one CPU cycle). If the two speakers 2a, 2b achieve the same delay, then their audio streams will both be synchronized with the transmission from the server 1, and therefore with each other.
[0141] Then, at each FRAMESTART event, a new frequency adjustment is calculated and made. In some embodiments, the software may also use the time reference event to align playback of individual samples. Typically, this might be used to align playback of the first sample in a PCM stream.
[0142] Figure 7 This summarizes the main steps performed by software running on device 2 when decoding an audio stream. 71: Software reads the next data packet interval value T from the second timer 23 (TIMER2). k 72: Then, it reads the next frame interval value P from the second timer 23 k . 73: Next, as mentioned above, according to T k and P k 74: It then writes these values to the register interface of the oscillator 24. These steps are repeated until the audio stream ends.
[0143] Figure 8Shown are selected hardware and software components from an alternative embodiment of the present invention, which is an audio recording device 102 (eg, a wireless microphone) that can convert received sound signals into audio data and transmit the audio data over the air.
[0144] The recording device 102 has Figure 4 The same features as the loudspeaker 2 shown, for example Figure 4 The domains 4 ′, 5 ′ shown are similar (but not identical) to the radio MCU domain 104 and the audio MCU domain 105 .
[0145] The recording device 102 includes a digital microphone 86 which outputs a pulse density modulated (PDM) electrical signal. This is received by a PDM-to-PCM converter 85 located in the audio MCU domain 105 which converts the PDM signal into pulse code modulated (PCM) data which is input to the audio buffer memory 80. The audio buffer memory 80 comprises a pair of frame-sized FIFO buffers, each of which is sized to hold a single PCM frame (or the audio content of a single data packet). These buffers may be located in system RAM or flash memory, or may be dedicated registers. As previously described, each PCM frame is written to the corresponding frame-sized FIFO buffer in an alternating "ping-pong" manner. The buffered audio is then acquired in 10ms blocks and compressed by the encoder 83 before being passed to the radio MCU domain 104 for radio transmission, for example, via Bluetooth. TM Low energy synchronization channel.
[0146] A frequency adjustable low jitter oscillator 124 in the audio MCU domain 105 controls the sampling rate from the digital microphone 86 , thereby determining the fill rate of the audio buffer memory 80 .
[0147] An alternative embodiment may include an analog microphone and an external ADC, which may be coupled via an I2S bus to the audio MCU domain 105. The oscillator 124 would then control the sampling rate of the external ADC.
[0148] In the radio MCU domain 104, incoming data packets are received approximately every 10 ms. As previously described, the receipt of an address event triggers the start of a timer 120 (TIMER1) timer, which outputs a TIMEREF event signal after a predetermined additional delay period. The time between consecutive TIMEREF events is measured by a second timer 123 (TIMER2) in the audio MCU domain 105. Software running in the audio MCU domain 105 uses these time intervals to control the sampling rate of the recorded audio, as described below.
[0149] The oscillator 124 may be the same as the oscillator 24 described in the previous embodiment, with the same register interface. The oscillator 124 is controlled based on the intervals between radio data packets received by the device 102 from a remote radio transceiver (not shown), and using the same principles disclosed above in the context of receiving audio. The incoming radio data packets do not have to carry the incoming audio data for processing by the device 102 (although this may be done). Instead, these data may be used primarily as timing signals for the recording device 102, without containing audio data. The device 102 replies to each incoming radio data packet by sending a corresponding response radio data packet from the antenna 126 containing a predetermined amount of compressed pulse code modulated data derived from the microphone 86 (e.g., corresponding to 10ms of decompressed audio).
[0150] Similar to the previous embodiment, software running in the audio MCU domain 105 measures the time it takes to fill a FIFO buffer in the audio buffer memory 80 and compares it to the time between two time reference events set by two received incoming radio data packets. Thus, the software determines the time based on how much the microphone sampling clock is too slow or too fast compared to the clock used by the remote radio transceiver to time the transmission of the incoming radio data packets. The software uses this information to write appropriate FREQINC and FREQINCPERIOD values to the oscillator 124 so that the frequency of the oscillator 124 reaches the desired average frequency over time to avoid overflow or underrun of the audio buffer memory 80. As previously described, the software can use any suitable algorithm to adjust the frequency of the local audio oscillator 24 to achieve the target.
[0151] In this way, the audio-bearing radio transmissions from the device 102 are synchronised with the clock of the external radio transceiver, rather than being dependent on the crystal 81, 82 of the recording device 102. This ensures that the device 102 can always send a timely response containing a fixed length of audio data to each incoming radio packet, without the risk of the audio buffer memory 80 overflowing or underrunning.
[0152] In this recording embodiment, reference can also be used Figure 4 Any relevant features disclosed in the embodiments of the present invention.
[0153] Other embodiments incorporate an audio receiving system (e.g., similar to Figure 2 and Figure 5 The loudspeaker 2 shown) and an audio recording system (e.g. similar to Figure 8The device may be combined with a microphone device 102 shown in the figure. Such a device may record and output audio simultaneously. For example, the device may be a wireless home assistant device that may simultaneously send a recording of a user's voice commands to a server via radio while simultaneously outputting music received from the server via radio. In some cases, the device may respond to each input radio data packet carrying a compressed input audio frame with a corresponding output radio data packet, and respond to each input radio data packet carrying a compressed output audio frame with timing of the recording and playback rates determined by the intervals between the input radio data packets, as described above.
[0154] The device can use the same hardware to implement Figure 5 and 8 Some common elements are shown, such as using the same radio to receive and transmit data. In particular, the device can use a single oscillator 24 / 124 to control the rate at which audio samples are written to the output audio buffer memory 80 and the rate at which samples are read from the input audio buffer memory 40. If the audio bit rate of the input and output streams is the same, then the uncompressed duration of the compressed audio data stored in each frame will be the same, and the buffer write rate and read rate can be the same. If the sample rates are different, the same oscillator can still be used, but the write and / or read rates are derived from the oscillator output by appropriate integer and / or fractional scaling.
[0155] It will be appreciated by those skilled in the art that the present invention has been described by way of the description of one or more specific embodiments thereof but is not limited to these embodiments; many variations and modifications are possible within the scope of the appended claims.
[0156] In particular, it should be understood that in other embodiments, hard-wired logic circuits may be used rather than software running on a processor to implement Figure 7 and other steps disclosed herein. Thus, in some embodiments, the audio MCU domain may not need to include a processor at all.
Claims
1. A radio receiver device, comprising: a radio circuit for receiving a sequence of radio data packets transmitted at fixed intervals, the sequence of radio data packets encoding a digital audio stream, wherein each radio data packet encodes a respective number of audio samples from the digital audio stream; a digital audio interface for outputting audio samples from said received digital audio stream; a controllable oscillator arranged to control the output rate of said audio samples from said digital audio interface; Timer; as well as control logic configured to measure, using the timer, an interval between receiving each of a pair of the radio data packets and, while outputting the audio samples from one radio data packet, control the oscillator to incrementally change the output rate in a plurality of steps, wherein the number of steps or the size of each step or both depends on the measured interval.
2. The radio receiver device of claim 1, wherein the control logic is configured to incrementally adjust the output rate in at least one hundred steps while outputting the audio samples from one radio data packet.
3. A radio receiver device according to claim 1 or 2, wherein the control logic is configured to determine a respective step size for outputting audio samples of each consecutive radio data packet of the sequence.
4. A radio receiver device according to claim 1 or 2, wherein the control logic is configured to use the timer to measure an interval between receiving each pair of adjacent radio data packets within the sequence.
5. A radio receiver device according to claim 1 or 2, wherein the control logic is further configured to measure the interval between each frame of a pair of audio sample frames output, wherein each frame consists of the audio samples contained in the corresponding radio data packet, and is configured to determine the number of steps or the size of each step or both additionally based on the measured interval between a pair of output frames.
6. A radio receiver device according to claim 1 or 2, wherein the controllable oscillator provides an interface for receiving data representing the step size and / or for receiving data from the control logic, i.e. representing the number of steps, and includes circuitry for making incremental changes to the periodic output of the oscillator in accordance with the received data.
7. The radio receiver apparatus according to claim 1 or 2, further comprising a digital audio converter for receiving the audio samples from the digital audio interface.
8. The radio receiver apparatus of claim 7, further comprising an amplifier and an acoustic transducer for outputting the digital audio stream as sound.
9. A radio receiver device as claimed in claim 1 or 2, further comprising a radio transmission circuit and configured to transmit a sequence of outgoing radio data packets encoding an outgoing digital audio stream.
10. The radio receiver device according to claim 9, comprising: an output digital audio interface for receiving audio samples for transmission in said output digital audio stream; a buffer memory for buffering the audio samples received at the output digital audio interface; the controllable oscillator or another controller oscillator configured to control a buffering rate at which audio samples are input to the buffer memory; Control logic is configured to incrementally change the buffering rate in a plurality of steps while inputting the audio samples of one radio data packet into the buffer memory, wherein the number of steps or the size of each step or both depends on the measured interval.
11. A method for processing a digital audio stream, the method comprising: receiving a sequence of radio data packets transmitted at fixed intervals, the sequence of radio data packets encoding a digital audio stream, wherein each radio data packet encodes a corresponding number of audio samples from the digital audio stream; outputting audio samples from said received digital audio stream at a variable output rate; measuring an interval between receiving each of a pair of radio data packets; as well as While outputting the audio samples from one radio data packet, the variable output rate is incrementally adjusted in a plurality of steps, wherein the number of steps or the size of each step or both are dependent on the measured interval.
12. A method according to claim 11, comprising adjusting the variable output rate incrementally in at least one hundred steps while outputting the audio samples from one radio data packet.
13. A method as claimed in claim 11 or 12, comprising determining a respective step size for outputting the audio samples of each consecutive radio data packet of the sequence.
14. A method as claimed in claim 11 or 12, comprising measuring the interval between receiving each pair of adjacent radio data packets within the sequence.
15. A method according to claim 11 or 12, comprising measuring the interval between each frame of a pair of audio sample frames output, wherein each frame consists of the audio samples contained in a corresponding radio data packet, and wherein the number of steps or the size of each step or both are additionally determined based on the measured interval between a pair of output frames.
16. A radio communication system comprising a radio transmitter device and a first radio receiver device, wherein the radio transmitter device is configured to transmit, at fixed intervals, to the first radio receiver device, a sequence of radio data packets encoding a first digital audio stream, wherein each radio data packet encodes a respective number of audio samples from the first digital audio stream, and in, The first radio receiver device comprises: a radio circuit for receiving said sequence of radio data packets; a digital audio interface for outputting audio samples from said received first digital audio stream; a controllable oscillator arranged to control the output rate of said audio samples from said digital audio interface; timer; and control logic configured to measure, using the timer, an interval between receiving each of a pair of radio data packets and, while outputting the audio samples from one radio data packet, control the oscillator to incrementally change the output rate in a plurality of steps, wherein the number of steps or the size of each step or both depends on the measured interval.
17. The radio communication system according to claim 16, further comprising a second radio receiver device, wherein the radio transmitter device is configured to send a second sequence of radio data packets to the second radio receiver device at fixed intervals, the second sequence of radio data packets encoding a second digital audio stream, wherein each radio data packet of the second sequence of radio data packets encodes a respective number of audio samples from the second digital audio stream, and in, The second radio receiver device comprises: radio circuitry for receiving said second sequence of radio data packets; a digital audio output for outputting audio samples from said received second digital audio stream; a controllable oscillator arranged to control the output rate of said audio samples from said second digital audio stream from said digital audio interface; timer; and control logic configured to measure, using the timer, an interval between reception of each of a pair of the radio data packets of the second sequence of radio data packets, and to control the oscillator to incrementally change the output rate in a plurality of steps while outputting the audio samples of one radio data packet from the second sequence of radio data packets, wherein the number of steps or the size of each step or both depends on the measured interval.
18. The radio communication system according to claim 17, wherein the first digital audio stream and the second digital audio stream are a left audio stream and a right audio stream of a stereo audio stream.
19. A radio transceiver device comprising: a radio receiving circuit for receiving a sequence of incoming radio data packets transmitted at fixed intervals; a radio transmission circuit for transmitting a sequence of output radio data packets encoding an output digital audio stream, wherein each respective output radio data packet of the sequence of output radio data packets corresponds to a respective input radio data packet of the sequence of input radio data packets; a digital audio interface for receiving audio samples for transmission in said output digital audio stream; a buffer memory for buffering the audio samples received at the digital audio interface; a controllable oscillator configured to control a buffering rate at which audio samples are input to the buffer memory; Timer; as well as control logic configured to measure, using the timer, an interval between receiving each of a pair of the input radio data packets and, while inputting the audio samples of one radio data packet into the buffer memory, control the oscillator to incrementally change the buffer rate in a plurality of steps, wherein the number of steps or the size of each step or both depends on the measured interval.
20. A method for transmitting a digital audio stream, the method comprising: receiving a sequence of incoming radio data packets transmitted at regular intervals; measuring an interval between receiving each of a pair of said radio data packets; inputting audio samples of an output digital audio stream into a buffer memory at a variable buffer rate; transmitting a sequence of output radio data packets encoding the output digital audio stream, wherein each output radio data packet encodes a respective number of audio samples from the buffer memory, and wherein each respective output radio data packet of the sequence of output radio data packets corresponds to a respective input radio data packet of the sequence of input radio data packets; as well as While inputting the audio samples of one radio data packet into the buffer memory, the variable buffer rate is incrementally adjusted in a plurality of steps, wherein the number of steps or the size of each step or both depend on the measured interval.
