RTP Payload Format for Standard apt-X and Enhanced apt-X Codecs
Extracted elements (28)
A default packet interval of 4 milliseconds was chosen to maintain an acceptable ratio of payload to header bytes while minimizing end-to-end delay, enabling viable interactive applications. At certain sample rates (11025, 22050, 44100 Hz) the interval must be rounded down to 3.99 ms to preserve an integer number of coded samples.
Generic FEC schemes (RFC 5109, RFC 2733) can be applied to apt-X RTP streams to improve resilience to packet loss at the expense of higher bit rate, since apt-X itself provides no inherent redundancy or error-control coding mechanism.
Standard apt-X and Enhanced apt-X decoders that have not been set up with the correct embedded autosync, auxiliary data, and stereo-pairing information will play out PCM samples with a loss of decoding quality. In the case of Standard apt-X, the quality loss can be significant.
The only negotiable parameter in the SDP offer/answer model is the delivery method; all other parameters (variant, bitresolution, channel configuration, etc.) are declarative and MUST NOT be altered on answer.
A channel MUST NOT be paired with more than one other channel in the stereo-channel-pairs parameter. When a channel is stereo paired, the first channel as defined in stereo-channel-pairs MUST be specified in the embedded-autosync-channels list, and the second channel MUST be specified in the embedded-aux-channels list.
All implementations MUST support the default 4-millisecond packetization interval.
An application implementing this payload format MUST understand all the payload parameters defined in this specification, and any mapping of these parameters to a signaling protocol MUST support all parameters.
Coded samples for all channels belonging to a single coded sampling instant MUST be contained in the same packet, and all channels in the same RTP stream MUST be sampled at the same frequency.
Coded samples MUST be packed contiguously into payload octets in network byte order (big-endian), starting with the most significant bit, and an integer number of coded samples MUST be within the same packet.
In the SDP offer/answer model, the answerer MUST remove every delivery method and configuration URI that is not supported, and all parameters (other than delivery method) MUST NOT be altered on answer.
RTP packetization of the encoded data SHALL be on a byte-by-byte basis.
The default packetization interval MUST have a duration of 4 milliseconds. When an integer number of coded samples per channel cannot be contained within this interval, the default packet interval MUST be rounded down to the nearest packet interval that can contain a complete integer set of coded samples.
The encoder MUST be presented with an integer number S of input audio samples, where S is an arbitrary multiple of 4. The encoder will produce exactly S/4 coded audio samples.
The payload type (PT) field MUST use a dynamic payload type as per RFC 3551.
The required parameters 'variant' and 'bitresolution' MUST be included in the SDP 'a=fmtp' attribute. The parameter 'maxptime', when present, MUST be included in the SDP 'a=maxptime' attribute.
apt-X coded data streams can optionally carry synchronization information and an auxiliary data channel within the coded audio data without additional overhead. The auxiliary data bit rate is 1/4 of the sample frequency (e.g., 12 kbit/s at Fs=48 kHz). Out-of-band signaling is required to notify the receiver when autosync and auxiliary data are embedded.
apt-X provides stereo-pairing of channels so that the embedded autosync and auxiliary data channel can be shared across the channel pair. By default, channel-pairing is not enabled; out-of-band signaling is required to notify the receiver when the option is being used.
Both codecs produce a constant coded bit rate of 1/4 of the uncoded audio bit rate, irrespective of the sample resolution. For example, a 1.536 Mbit/s stereo stream at 48 kHz is encoded at 384 kbit/s.
Optional SDP parameters include 'ptime' (default 4 ms), 'maxptime', 'stereo-channel-pairs' (defines paired channels using brace-enclosed comma-separated channel numbers), 'embedded-autosync-channels', and 'embedded-aux-channels'.
Standard apt-X encodes four successive 16-bit PCM samples from each audio channel into a single 16-bit coded sample. Enhanced apt-X encodes four successive 16-bit or 24-bit PCM samples and produces a single 16-bit or 24-bit coded sample per channel respectively.
The media type audio/aptx has four required parameters: 'rate' (RTP timestamp clock rate equal to sampling rate in Hz), 'channels' (number of logical audio channels), 'variant' (standard or enhanced), and 'bitresolution' (16 for Standard apt-X; 16 or 24 for Enhanced apt-X).
This document registers one media type, audio/aptx, in the IANA 'Media Types' registry, in accordance with RFC 4855 and using the template of RFC 6838.
A potential denial-of-service threat exists for codecs with non-uniform receiver-end computational load, where an attacker injects pathological datagrams to overload the decoder. Standard apt-X and Enhanced apt-X do not exhibit significant non-uniformity, mitigating this risk.
A receiver may be overloaded by receipt of too many packets (desired or undesired). Network-layer authentication may be used to discard packets from undesired sources, though the processing cost of authentication itself may be prohibitive. Multicast source pruning via IGMP is a potential future mitigation.
Confidentiality of apt-X RTP streams is achieved by encryption. Because coding is applied end to end, encryption may be performed after audio coding with no conflict. Standard and Enhanced apt-X are CBR codecs, so the VBR timing-attack vulnerability described in RFC 6562 for Secure RTP does not apply.
Coded samples are packed contiguously in network byte order (big-endian), most significant bit first, in time sequence (oldest first). For multi-channel streams, coded samples from all channels at a single sampling instant are interleaved into a coded sample block using standard audio channel ordering (e.g., for stereo: left, right, left, right...).
For 5.1 audio (six channels, 24-bit Enhanced apt-X at 48 kHz, 4 ms interval), each RTP packet contains 864 bytes of encoded data comprising 48 coded samples per channel. Each 24-bit sample is packed as MSB, Middle Byte, LSB in sequence.
The RTP timestamp reflects the instant at which the first audio sample in the packet was sampled (the oldest information in the packet), as per RFC 3550.