{"id":35145,"date":"2019-10-31T22:02:32","date_gmt":"2019-10-31T19:02:32","guid":{"rendered":"https:\/\/prohoster.info\/blog\/audio-cherez-bluetooth-maksimalno-podrobno-o-profilyah-kodekah-i-ustrojstvah\/"},"modified":"2019-10-31T22:02:32","modified_gmt":"2019-10-31T19:02:32","slug":"audio-cherez-bluetooth-maksimalno-podrobno-o-profilyah-kodekah-i-ustrojstvah","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/audio-cherez-bluetooth-maksimalno-podrobno-o-profilyah-kodekah-i-ustrojstvah","title":{"rendered":"Audio over Bluetooth: a detailed look at profiles, codecs, and devices","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/48eced30a8d5e569e0c70ab4d60c5a9f.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nWith the mass release of smartphones without a 3.5 mm audio jack, wireless Bluetooth headphones have become the primary way for many to listen to music and communicate in headset mode.<br \/>\nWireless device manufacturers do not always provide detailed product specifications, and articles about Bluetooth audio on the internet are inconsistent, sometimes incorrect, do not cover all features, and often replicate the same misleading information.<br \/>\nLet's explore the protocol, the capabilities of Bluetooth stacks on operating systems, headphones and speakers, Bluetooth codecs for music and speech, determine what affects sound quality and latency, and learn how to gather and decode information about supported codecs and other device features.<\/p>\n<p><b>TL;DR<\/b>: <\/p>\n<ul>\n<li>SBC is a standard codec.<\/li>\n<li>Headphones have their own equalizer and post-processing for each codec separately.<\/li>\n<li>aptX is not as good as its advertising claims.<\/li>\n<li>LDAC is marketing nonsense.<\/li>\n<li>Call quality is still low.<\/li>\n<li>Audio encoders can be embedded in the browser using C, compiled to WebAssembly via emscripten, and they won\u2019t cause significant lag.<\/li>\n<\/ul>\n<p>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h1>Music over Bluetooth.<\/h1>\n<p>The functional aspect of Bluetooth is determined by profiles\u2014specifications for specific functions. Music transmission over Bluetooth is done using the high-quality one-way audio transmission profile A2DP. The A2DP standard was adopted in 2003, and since then it has not changed significantly.<br \/>\nWithin the profile, 1 mandatory low-complexity codec SBC, specifically designed for Bluetooth, and 3 additional codecs are standardized. The use of undocumented codecs of proprietary implementation is also permitted.<\/p>\n<p>As of June 2019, we are located <noindex><a rel=\"nofollow\" href=\"https:\/\/xkcd.com\/927\/\">in the xkcd comic.<\/a><\/noindex> with 14 A2DP codecs:<\/p>\n<ul>\n<li><b>SBC<\/b> \u2190 standardized in A2DP, supported by all devices.<\/li>\n<li><b>MPEG-1\/2 Layer 1\/2\/3<\/b> \u2190 standardized in A2DP: the well-known <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/MP3\">MP3<\/a><\/noindex>, used in digital TV. <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/MPEG-1_Audio_Layer_II\">MP2<\/a><\/noindex>, and the unknown <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/MPEG-1_Audio_Layer_I\">MP1<\/a><\/noindex><\/li>\n<li><b>MPEG-2\/4 AAC<\/b> \u2190 standardized in A2DP.<\/li>\n<li><b>ATRAC<\/b> \u2190 an old codec from Sony, standardized in A2DP.<\/li>\n<li><b>LDAC<\/b> \u2190 a new codec from Sony.<\/li>\n<li><b>aptX<\/b> \u2190 a codec from 1988.<\/li>\n<li><b>aptX HD<\/b> \u2190 the same as aptX, just with different encoding parameters.<\/li>\n<li><b>aptX Low Latency<\/b> \u2190 a completely different codec, with no software implementation.<\/li>\n<li><b>aptX Adaptive<\/b> \u2190 another codec from Qualcomm.<\/li>\n<li><b>FastStream<\/b> \u2190 a pseudo-codec, a bidirectional modification of SBC.<\/li>\n<li><b>HWA LHDC<\/b> \u2190 new codec from Huawei<\/li>\n<li><b>Samsung HD<\/b> \u2190 supported by 2 devices<\/li>\n<li><b>Samsung Scalable<\/b> \u2190 supported by 2 devices<\/li>\n<li><b>Samsung UHQ-BT<\/b> \u2190 supported by 3 devices<\/li>\n<\/ul>\n<p>You might ask why codecs are even necessary when Bluetooth has EDR, which allows data transmission at speeds of 2 and 3 Mbps, while for uncompressed two-channel 16-bit PCM, only 1.4 Mbps is needed?<\/p>\n<p><\/p>\n<h1>Data transmission via Bluetooth<\/h1>\n<p>Bluetooth features two types of data transmission: Asynchronous Connection Less (ACL) for asynchronous transmission without establishing a connection, and Synchronous Connection Oriented (SCO) for synchronous transmission with prior connection agreement.<br \/>\nTransmission is carried out using a time-division frequency-hopping scheme (Frequency-Hop\/Time-Division-Duplex, FH\/TDD), where time is divided into 625-microsecond intervals called slots. One device transmits during even-numbered slots, while another transmits during odd-numbered slots. The transmitted packet can occupy 1, 3, or 5 slots, depending on the data size and established transmission type; in this case, one device transmits in both even and odd slots until the transmission is complete. A total of up to 1600 packets can be sent and received per second if each occupies 1 slot, provided both devices continuously transmit and receive data.<\/p>\n<p>2 and 3 Mbps for EDR, which can be found in announcements and on the Bluetooth website, represent the maximum channel transmission speed for all data combined (including the technical headers of all protocols that encapsulate the data) in both directions simultaneously. The actual data transmission speed will vary significantly.<\/p>\n<p>To transmit music, an asynchronous method is used, nearly always with packets of type 2-DH5 and 3-DH5, which carry the maximum amount of data at EDR rates of 2 Mbps and 3 Mbps, respectively, occupying 5 slots of time-division spectrum.<\/p>\n<p>A schematic representation of the transmission using 5 slots by one device and 1 slot by another (DH5\/DH1):<br \/>\n<img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/e5875cb59648c349a63c8e7196e9afbf.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nDue to the principle of time-division duplexing, we have to wait for a 625-microsecond time slot after transmitting a packet if the second device does not send anything or sends a small packet, and for a longer time if the second device is transmitting large packets. If more than one device is connected to the phone (for example, headphones, a watch, and a fitness tracker), the transmission time is divided among all of them.<\/p>\n<p>The need to encapsulate audio in special transport protocols L2CAP and AVDTP takes away 16 bytes from the possible maximum amount of transmitted audio payload.<\/p>\n<p>Packet type<br \/>\nNumber of slots<br \/>\nMax. number of bytes in a packet<br \/>\nMax. number of bytes of A2DP payload<br \/>\nMax. bitrate of A2DP payload<\/p>\n<p>2-DH3<br \/>\n3<br \/>\n367<br \/>\n351<br \/>\n936 kbps<\/p>\n<p>3-DH3<br \/>\n3<br \/>\n552<br \/>\n536<br \/>\n1429 kbps<\/p>\n<p>2-DH5<br \/>\n5<br \/>\n679<br \/>\n663<br \/>\n1414 kbps<\/p>\n<p>3-DH5<br \/>\n5<br \/>\n1021<br \/>\n1005<br \/>\n2143 kbps<\/p>\n<p>1414 and 1429 kbps are clearly insufficient for transmitting uncompressed audio in real-world conditions, with the noisy 2.4 GHz band and the need to transmit auxiliary data. EDR 3 Mbps is demanding in terms of transmission power and noise in the air, so even in 3-DH5 mode, comfortable PCM transmission is impossible; there will be constant brief interruptions, and everything will only work at a distance of a couple of meters.<br \/>\nIn practice, even a 990 kbps audio stream (LDAC 990 kbit\/s) is transmitted with difficulty.<\/p>\n<p>Let's get back to codecs.<\/p>\n<h2>SBC<\/h2>\n<p>A codec that is mandatory for all devices supporting the A2DP standard. The best and worst codec at the same time.<\/p>\n<p>Sampling frequency<br \/>\nBit width<br \/>\nBitrate<br \/>\nEncoding support<br \/>\nDecoding support<\/p>\n<p>16, 32, 44.1, 48 kHz<br \/>\n16 bits<br \/>\n10-1500 kbps<br \/>\nBy all devices<br \/>\nBy all devices<\/p>\n<p>SBC is a simple and computationally fast codec with a primitive psychoacoustic model (only masking quiet sounds is used), employing adaptive pulse code modulation (APCM).<br \/>\nThe A2DP specification recommends the use of two profiles: Middle Quality and High Quality.<br \/>\n<img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/8939e552a23374228289a9686f4d1048.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nThe codec has many settings that allow managing algorithmic delay, the number of samples in a block, and the bit allocation algorithm, but almost universally the same recommended parameters are used as in the specification: Joint Stereo, 8 frequency bands, 16 blocks in an audio frame, Loudness bit allocation method.<br \/>\nSBC supports dynamic adjustment of the Bitpool parameter, which directly affects the bitrate. If the radio broadcast is congested, packets are lost, or devices are far apart, the audio source may reduce the Bitpool until the connection stabilizes.<\/p>\n<p>Most headphone manufacturers set the maximum value of the Bitpool parameter at 53, which limits the bitrate to 328 kilobits per second when using the recommended profile.<br \/>\nEven if a headphone manufacturer has set the maximum Bitpool value above 53 (such models include, for example: Beats Solo\u00b3, JBL Everest Elite 750NC, Apple AirPods, and some receivers and car head units), most operating systems will not allow the use of higher bitrates due to internal limitations in Bluetooth stacks.<br \/>\nAdditionally, some manufacturers set a low maximum Bitpool value for certain devices. For example, for Bluedio T it is 39, and for Samsung Gear IconX \u2014 37, which results in poor sound quality.<\/p>\n<p>Artificial limitations imposed by Bluetooth stack developers likely arose due to incompatibility of certain devices with high Bitpool values or atypical profiles, even if they claimed support, and insufficient testing during certification. It was easier for Bluetooth stack authors to stick to the recommended profile rather than create a database of incorrectly functioning devices (though they are now doing this for other malfunctioning features).<\/p>\n<p>SBC dynamically allocates bits of quantization for frequency bands, working from low to high frequencies, with different weighting coefficients. If the entire bitrate is used for low and mid frequencies, high frequencies will be 'cut off' (resulting in silence instead).<\/p>\n<p>Example SBC 328 kbps. At the top is the original, and at the bottom is SBC, with periodic switching between tracks. For audio in the video file, a lossless compression codec FLAC is used. Using FLAC in an mp4 container is not officially standardized, so it\u2019s uncertain whether your browser will play it, but it should work in the latest desktop versions of Chrome and Firefox. If you do not hear sound, you can download the file and open it in a full-featured media player.<br \/>\n<video controls style=\"top: 0; left: 0; width: 100%; height: 100%; position: absolute;\">Your browser does not support HTML5 video.<source src=\"https:\/\/files.catbox.moe\/8yrssu.mp4\" type=\"video\/mp4\"><\/source><\/video><i>ZZ Top \u2014 Sharp Dressed Man<\/i><\/p>\n<p>The spectrogram shows the moment of switching: SBC periodically cuts quiet sounds above 17.5 kHz and does not allocate any bits for the range above 20 kHz. The full spectrogram is available by clicking (1.7 MB).<br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/habrastorage.org\/webt\/qj\/i7\/4w\/qji74wrphaigw3qtza6nepvur50.png\"><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/c59aa3f6eff4c4d966a4c96868dd7e00.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<p>I don't hear a difference between the original and SBC on this track.<\/p>\n<p>Let's take something newer and simulate the audio that would result from using Samsung Gear IconX headphones with Bitpool 37 (above \u2014 original signal, below \u2014 SBC 239 kbps, sound in FLAC).<br \/>\n<video controls style=\"top: 0; left: 0; width: 100%; height: 100%; position: absolute;\">Your browser does not support HTML5 video.<source src=\"https:\/\/files.catbox.moe\/r561g5.mp4\" type=\"video\/mp4\"><\/source><\/video><i>Mindless Self Indulgence \u2014 Witness<\/i><\/p>\n<p>I hear crackling, reduced stereo effect, and an unpleasant 'clicking' of the vocals in the high frequencies.<\/p>\n<p>Although SBC is a very flexible codec that can be tuned for low latency, it offers excellent audio quality at high bitrates (452+ kbps) and is quite good for most people at the standard High Quality (328 kbps). Since the A2DP standard does not set fixed profiles (but only gives recommendations), stack developers impose artificial limitations on Bitpool, audio parameters are not displayed in the user interface, and headphone manufacturers are free to set their own settings and never specify the Bitpool value in the product specifications. The codec has gained a reputation for low sound quality, although this is not a problem with the codec itself.<br \/>\nThe Bitpool parameter directly affects the bitrate only within a single profile. The same Bitpool value of 53 can yield a bitrate of 328 kbps under the recommended High Quality profile, as well as 1212 kbps with Dual Channel and 4 frequency bands. This is why OS authors, in addition to the Bitpool limitations, also impose a limit on Bitrate. In my view, this situation arose from the shortcomings of the A2DP standard: it should have been necessary to agree on the bitrate rather than Bitpool.<\/p>\n<p>Table of SBC capability support in different operating systems:<\/p>\n<p>OS<br \/>\nSupported sampling frequencies<br \/>\nMax Bitpool limit<br \/>\nMax Bitrate limit<br \/>\nTypical Bitrate<br \/>\nDynamic Bitpool adjustment<\/p>\n<p><b>Windows 10<\/b><br \/>\n44.1 kHz<br \/>\n53<br \/>\n512 kbps<br \/>\n328 kbps<br \/>\n\u2713*<\/p>\n<p><b>Linux (BlueZ + PulseAudio)<\/b><br \/>\n16, 32, 44.1, 48 kHz<br \/>\n64 (for incoming connection), 53 (for outgoing)<br \/>\nNo limit<br \/>\n328 kbps<br \/>\n\u2713*<\/p>\n<p><b>macOS High Sierra<\/b><br \/>\n44.1 kHz<br \/>\n64, default 53***<br \/>\nUnknown<br \/>\n328 kbps<br \/>\n\u2717<\/p>\n<p><b>Android 4.4-9<\/b><br \/>\n44.1\/48 kHz**<br \/>\n53<br \/>\n328 kbps<br \/>\n328 kbps<br \/>\n\u2717<\/p>\n<p><b>Android 4.1-4.3.1<\/b><br \/>\n44.1, 48 kHz**<br \/>\n53<br \/>\n229 kbps<br \/>\n229 kbps<br \/>\n\u2717<\/p>\n<p><b>Blackberry OS 10<\/b><br \/>\n48 kHz<br \/>\n53<br \/>\nNo limit<br \/>\n328 kbps<br \/>\n\u2717<\/p>\n<p><i><b>*<\/b> The Bitpool only decreases, but does not increase automatically when transmission conditions improve. To restore the Bitpool, you need to stop playback, wait a couple of seconds, and restart the audio.<br \/>\n<b>**<\/b> The default value depends on the stack settings specified during firmware compilation. In Android 8\/8.1, the frequency is either 44.1 kHz or 48 kHz, depending on the compilation settings, while in other versions, both 44.1 kHz and 48 kHz are supported simultaneously.<br \/>\n<b>***<\/b> The Bitpool value can be raised in the Bluetooth Explorer application.<\/i><\/p>\n<h2>aptX and aptX HD<\/h2>\n<p>aptX is a simple and computationally fast codec, without psychoacoustics, using adaptive differential pulse-code modulation (<noindex><a rel=\"nofollow\" href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%90%D0%B4%D0%B0%D0%BF%D1%82%D0%B8%D0%B2%D0%BD%D0%B0%D1%8F_%D0%B4%D0%B8%D1%84%D1%84%D0%B5%D1%80%D0%B5%D0%BD%D1%86%D0%B8%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F_%D0%B8%D0%BC%D0%BF%D1%83%D0%BB%D1%8C%D1%81%D0%BD%D0%BE-%D0%BA%D0%BE%D0%B4%D0%BE%D0%B2%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B4%D1%83%D0%BB%D1%8F%D1%86%D0%B8%D1%8F\">ADPCM<\/a><\/noindex>). It appeared around 1988 (the patent submission date <noindex><a rel=\"nofollow\" href=\"https:\/\/patents.google.com\/patent\/EP0398973B1\/en\">is dated February 1988), and before Bluetooth, it was primarily used in professional wireless audio equipment. Currently, it is owned by Qualcomm, requiring licensing and royalty payments. As of 2014: a one-time fee of $6000 and approximately $1 for each device, for batches of up to 10,000 devices (<\/a><\/noindex> , p. 16).<noindex><a rel=\"nofollow\" href=\"https:\/\/www.silabs.com\/documents\/login\/presentations\/Developing-Bluetooth-Audio.pdf\">source<\/a><\/noindex>aptX and aptX HD are the same codec, with different encoding profiles.<br \/>\nThe codec has only one parameter\u2014the choice of sampling frequency. There is also the option to select the number\/mode of channels, but in all the devices I am aware of (over 70), only Stereo is supported.<\/p>\n<p>Codec<\/p>\n<p>128 \/ 256 \/ 352 \/ 384 kbps (depending on the sampling frequency)<br \/>\nSampling frequency<br \/>\nBit width<br \/>\nBitrate<br \/>\nEncoding support<br \/>\nDecoding support<\/p>\n<p><b>aptX<\/b><br \/>\n16, 32, 44.1, 48 kHz<br \/>\n16 bits<br \/>\nWindows 10 (desktop and mobile), macOS, Android 4.4+\/7*, Blackberry OS 10<br \/>\nA wide range of audio devices (hardware)<br \/>\nVersions prior to 7 require modification of the Bluetooth stack. The codec is supported only if the Android device manufacturer has licensed the codec from Qualcomm (if the OS has encoding libraries).<\/p>\n<p><i><b>*<\/b> aptX divides audio into 4 frequency bands and quantizes them with the same number of bits constantly: 8 bits for 0-5.5 kHz, 4 bits for 5.5-11 kHz, 2 bits for 11-16.5 kHz, 2 bits for 16.5-22 kHz (numbers for a sampling frequency of 44.1 kHz).<\/i><\/p>\n<p>An example of aptX audio (above is the original signal, below is aptX, spectrograms of only the left channels, sound in FLAC):<\/p>\n<p>The higher frequencies became slightly redder, but the difference is not audible.<br \/>\n<video controls style=\"top: 0; left: 0; width: 100%; height: 100%; position: absolute;\">Your browser does not support HTML5 video.<source src=\"https:\/\/files.catbox.moe\/06eohy.mp4\" type=\"video\/mp4\"><\/source><\/video><br \/>\nThe upper frequencies became a bit redder, but the difference is not noticeable.<\/p>\n<p>Due to the fixed distribution of quantization bits, the codec cannot 'shift bits' to the frequencies that need them the most. Unlike SBC, aptX does not 'cut' frequencies but adds quantization noise, reducing the dynamic range of the audio.<\/p>\n<p>It should not be assumed that using, for example, 2 bits for the band reduces the dynamic range to 12 dB: ADPCM allows for a dynamic range of up to 96 dB even when using 2-bit quantization, but only under certain signals.<br \/>\nADPCM stores the difference in numerical representation between the current and the next sample instead of recording the absolute value, as in PCM. This reduces the number of bits required to store the same (lossless) or virtually the same (with relatively small rounding error) information. Coefficient tables are applied to reduce rounding errors.<br \/>\nWhen creating the codec, the authors calculated the ADPCM coefficients based on a set of musical audio files. The closer the audio signal is to the set of music on which the tables were built, the fewer quantization errors (noise) aptX creates.<\/p>\n<p>As a result, synthetic tests will always yield worse results than music. I made a special synthetic example where aptX shows poor results \u2014 a sine wave at a frequency of 12.4 kHz (top \u2014 original signal, bottom \u2014 aptX. Sound in FLAC. Lower the volume!):<br \/>\n<video controls style=\"top: 0; left: 0; width: 100%; height: 100%; position: absolute;\">Your browser does not support HTML5 video.<source src=\"https:\/\/files.catbox.moe\/kterhd.mp4\" type=\"video\/mp4\"><\/source><\/video><br \/>\nSpectrum chart:<br \/>\n<img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/94ecbf4a6f93b6ca85ca997e2be453ad.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nNoise is distinctly audible.<\/p>\n<p>However, if a sine wave is generated with a lower amplitude to make it quieter, the noise will also become quieter, indicating a wide dynamic range:<\/p>\n<p><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/64d0a3f41c152f5f4d01230722fc197a.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nTo hear the difference between the original music track and the compressed one, one can invert one of the signals and mix the tracks channel by channel. This approach, in general, is incorrect and would not yield reasonable results with more complex codecs, but is quite suitable for ADPCM.<br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/files.catbox.moe\/leq24q.flac\">Difference between original and aptX<\/a><\/noindex><br \/>\nThe root mean square difference of the signals is at -37.4 dB, which is not much for such compressed music.<\/p>\n<h3>aptX HD<\/h3>\n<p>aptX HD is not a standalone codec \u2014 it is an enhanced encoding profile of the aptX codec. Changes relate to the number of bits allocated for encoding frequency ranges: 10 bits for 0-5.5 kHz, 6 bits for 5.5-11 kHz, 4 bits for 11-16.5 kHz, 4 bits for 16.5-22 kHz (numbers for 44.1 kHz).<\/p>\n<p>128 \/ 256 \/ 352 \/ 384 kbps (depending on the sampling frequency)<br \/>\nSampling frequency<br \/>\nBit width<br \/>\nBitrate<br \/>\nEncoding support<br \/>\nDecoding support<\/p>\n<p><b>aptX HD<\/b><br \/>\n16, 32, 44.1, 48 kHz<br \/>\n24 bits<br \/>\n192 \/ 384 \/ 529 \/ 576 kbps (depending on the sampling rate)<br \/>\nAndroid 8+*<br \/>\nBy some audio devices (hardware)<\/p>\n<p><i><b>*<\/b> aptX divides audio into 4 frequency bands and quantizes them with the same number of bits constantly: 8 bits for 0-5.5 kHz, 4 bits for 5.5-11 kHz, 2 bits for 11-16.5 kHz, 2 bits for 16.5-22 kHz (numbers for a sampling frequency of 44.1 kHz).<\/i><\/p>\n<p>Less common than aptX: apparently requires separate licensing from Qualcomm, and separate royalty payments.<\/p>\n<p>Let's repeat the example with a sine wave at 12.4 kHz:<br \/>\n<img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/fe4f8d91dcbc39af881129a9c78ca453.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nMuch better than with aptX, but still noisy.<\/p>\n<h2>aptX Low Latency<\/h2>\n<p>A codec from Qualcomm, unrelated to the standard aptX and aptX HD, according to limited information from those involved in its development. Designed for interactive audio transmission with low latency (movies, games), where sound delay cannot be adjusted programmatically. Known software implementations of encoders and decoders are absent, supported exclusively by transmitters, receivers, headphones, and speakers, but not smartphones and computers.<\/p>\n<p>Sampling frequency<br \/>\nBitrate<br \/>\nEncoding support<br \/>\nDecoding support<\/p>\n<p>44.1 kHz<br \/>\n276\/420 kbps<br \/>\nBy some transmitters (hardware)<br \/>\nBy some audio devices (hardware)<\/p>\n<h2>AAC<\/h2>\n<p>AAC, or Advanced Audio Coding \u2014 a computationally intensive codec with a serious psychoacoustic model. It has become widely adopted for audio on the internet, second in popularity only to MP3. Requires licensing and royalty payments: $15,000 one-time payment (or $1,000 for companies with fewer than 15 employees) + $0.98 for the first 500,000 devices (<noindex><a rel=\"nofollow\" href=\"http:\/\/www.via-corp.com\/us\/en\/licensing\/aac\/licensefees.html\">source<\/a><\/noindex>).<br \/>\nThe codec is standardized under MPEG-2 and MPEG-4 specifications, and contrary to a common misconception, it does not belong to Apple.<\/p>\n<p>Sampling frequency<br \/>\nBitrate<br \/>\nEncoding support<br \/>\nDecoding support<\/p>\n<p>8 \u2014 96 kHz<br \/>\n8 \u2014 576 kbps (for stereo), 256 \u2014 320 kbps (typical for Bluetooth)<br \/>\nmacOS, Android 7+*, iOS<br \/>\nVersions prior to 7 require modification of the Bluetooth stack. The codec is supported only if the Android device manufacturer has licensed the codec from Qualcomm (if the OS has encoding libraries).<\/p>\n<p><i><b>*<\/b> only on devices whose manufacturers have paid royalty fees<\/i><\/p>\n<p>In iOS and macOS, the best codec available today, Apple's AAC, is used, providing the highest possible audio quality. In Android, the second-best quality encoder, Fraunhofer FDK AAC, is used, but various hardware encoders built into the platform (SoC) may be employed, with unknown encoding quality. <noindex><a rel=\"nofollow\" href=\"https:\/\/www.soundguys.com\/the-ultimate-guide-to-bluetooth-headphones-aac-20296\/\">According to recent tests on the SoundGuys website<\/a><\/noindex>, the encoding quality of AAC varies significantly among different Android phones:<br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/www.soundguys.com\/wp-content\/uploads\/2018\/10\/aac-enhanced-view-fr-1200x788.jpg\"><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/7ae72554564f215dc765272065f5c97c.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<p>Most wireless audio devices set a maximum bitrate of 320 kbps for AAC, while some only support 256 kbps. Other bitrates are extremely rare.<br \/>\nAAC delivers excellent quality at bitrates of 320 and 256 kbps, but is prone to <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Generation_loss\">losses from successive encoding of already compressed content,<\/a><\/noindex>however, it\u2019s difficult to hear any differences from the original on iOS at a bitrate of 256 kbps, even after several successive encodings; in a single encoding, for example, MP3 at 320 kbps to AAC at 256 kbps, the losses can be neglected.<br \/>\nAs with other Bluetooth codecs, any music is first decoded and then re-encoded by the codec. When listening to music in AAC format, it is first decoded by the OS, then re-encoded to AAC for transmission over Bluetooth. This is necessary for mixing multiple audio streams, such as music and new message notifications. iOS is no exception. There are many claims online that music in AAC format is not transcoded on iOS during Bluetooth transmission, which is incorrect.<\/p>\n<p><\/p>\n<h2>MP1\/2\/3<\/h2>\n<p>The MPEG-1\/2 Part 3 codecs include the well-known and widely used MP3, the less common MP2 (primarily used in digital TV and radio), and the completely unknown MP1.<\/p>\n<p>Older MP1 and MP2 codecs are not supported at all: I couldn't find any headphones or any Bluetooth stack that could encode or decode them.<br \/>\nMP3 decoding is supported by some headphones, but encoding is not supported by any current operating system stacks. It seems that the third-party BlueSoleil stack for Windows can encode to MP3 if the configuration file is manually altered, but installing it leads to a BSOD on Windows 10. The conclusion is that the codec is effectively unusable for Bluetooth audio.<br \/>\nPreviously, in 2006-2008, before the A2DP standard was widely adopted in devices, people listened to MP3 music on the Nokia BH-501 headset through the MSI BluePlayer app, which was available on Symbian and Windows Mobile. At that time, the smartphone OS architecture allowed access to many low-level functions, and on Windows Mobile, it was even possible to install third-party Bluetooth stacks.<\/p>\n<p>The last patent for the MP3 codec expired, and using the codec does not require any licensing fees since April 23, 2017.<\/p>\n<blockquote><p>If the longest-running patent mentioned in the aforementioned references is taken as a measure, then the MP3 technology became patent-free in the United States on April 16, 2017, when U.S. Patent 6,009,399, held by and administered by Technicolor, expired.<\/p><\/blockquote>\n<p><i>Source: <noindex><a rel=\"nofollow\" href=\"https:\/\/www.iis.fraunhofer.de\/en\/ff\/amm\/prod\/audiocodec\/audiocodecs\/mp3.html\">www.iis.fraunhofer.de\/en\/ff\/amm\/prod\/audiocodec\/audiocodecs\/mp3.html<\/a><\/noindex><\/i><\/p>\n<p>Sampling frequency<br \/>\nBitrate<br \/>\nEncoding support<br \/>\nDecoding support<\/p>\n<p>16 \u2014 48 kHz<br \/>\n8 \u2014 320 kbps<br \/>\nNot supported anywhere<br \/>\nBy some audio devices (hardware)<\/p>\n<h2>LDAC<\/h2>\n<p>A new and actively promoted 'Hi-Res' codec from Sony that supports sampling rates up to 96 kHz and 24-bit depth, with a bitrate of up to 990 kbps. It is marketed as an audiophile codec, designed to replace existing Bluetooth codecs. It features adaptive bitrate adjustment depending on radio conditions.<\/p>\n<p>The LDAC encoder (<noindex><a rel=\"nofollow\" href=\"https:\/\/android.googlesource.com\/platform\/external\/libldac\/\">libldac<\/a><\/noindex>) is included in the standard Android installation, so encoding is supported on any Android smartphone starting from version 8. Software decoders are not available for free, the codec specification is not public, however, a first glance at the encoder shows that the internal structure of the codec is similar to <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Adaptive_Transform_Acoustic_Coding#ATRAC9\">ATRAC9<\/a><\/noindex> , a codec from Sony used in PlayStation 4 and Vita: both operate in the frequency range, use modified discrete cosine transformation (MDCT), and compress using Huffman coding.<\/p>\n<p>LDAC support is primarily found on Sony headphones. Decoding capability is sometimes found on headphones and DACs from other manufacturers, but very rarely.<\/p>\n<p>Sampling frequency<br \/>\nBitrate<br \/>\nEncoding support<br \/>\nDecoding support<\/p>\n<p>44.1 \u2014 96 kHz<br \/>\n303\/606\/909 kbps (for 44.1 and 88.2 kHz), 330\/660\/990 kbps (for 48 and 96 kHz)<br \/>\nAndroid 8+<br \/>\nBy some Sony headphones and a few devices from other manufacturers (hardware-wise)<\/p>\n<p>Marketing LDAC as a Hi-Res codec undermines its technical aspects: it is foolish to waste bitrate on transmitting frequencies inaudible to the human ear and increased depth when it is not sufficient for lossless CD-quality (44.1\/16) transmission. Fortunately, the codec has two operating modes: CD audio transmission and Hi-Res audio transmission. In the first case, only 44.1 kHz\/16 bits is transmitted wirelessly.<\/p>\n<p>Since there is no software decoder for LDAC available for free, it is impossible to test the codec without additional devices that decode LDAC. According to tests of LDAC on a DAC with its support, which engineers from SoundGuys.com connected via digital output and recorded the output sound on test signals, LDAC at 660 and 990 kbps in CD-quality mode provides a signal-to-noise ratio slightly better than aptX HD.<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/www.soundguys.com\/wp-content\/uploads\/2018\/10\/LDAC-990-CD-Noise-Floor.jpg\"><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/819853ab9d92e9631454082ade245628.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><br \/>\n<i>Source: <noindex><a rel=\"nofollow\" href=\"https:\/\/www.soundguys.com\/ldac-ultimate-bluetooth-guide-20026\/\">www.soundguys.com\/ldac-ultimate-bluetooth-guide-20026<\/a><\/noindex><\/i><\/p>\n<p>LDAC also supports a dynamic bitrate outside the established profiles \u2014 from 138 kbps to 990 kbps, but as far as I can tell, Android only uses standardized profiles of 303\/606\/909 and 330\/660\/990 kbps.<\/p>\n<h2>Other Codecs<\/h2>\n<p>Other A2DP codecs have not gained widespread adoption. Their support is either virtually nonexistent, or available only on specific models of headphones and smartphones.<br \/>\nThe standardized A2DP codec ATRAC has never been used as a Bluetooth codec even by Sony itself, while Samsung HD, Samsung Scalable, and Samsung UHQ-BT codecs have very limited support from transmitting and receiving devices, and HWA LHDC is too new and only supported by three (?) devices.<\/p>\n<p><\/p>\n<h1>Codec Support by Audio Devices<\/h1>\n<p>Not all manufacturers provide accurate information about the codecs supported by specific wireless headphones, speakers, receivers, or transmitters. Sometimes, the support for a particular codec exists only for transmission but not for reception (this is relevant for combined transmitter-receiver devices), even though the manufacturer claims simply \"support,\" without any notes (I suspect this is due to the separate licensing of encoders and decoders for some codecs). The cheapest devices may not even exhibit the claimed support for aptX.<\/p>\n<p>Unfortunately, in the interfaces of most operating systems, the used codec is not displayed anywhere. This information is only available on Android, starting from version 8, and macOS. However, even in these OS, only those codecs will be displayed that are supported by both the phone\/computer and the headphones.<\/p>\n<p>So how do you find out which codecs a device supports? Record and analyze the A2DP negotiation traffic dump!<br \/>\nThis can be done in Linux, macOS, and Android. In Linux, you can use Wireshark or hcidump, in macOS \u2014 Bluetooth Explorer, and in Android \u2014 the built-in Bluetooth HCI dump saving function available in developer tools. You will get a dump in btsnoop format, which can be uploaded to the Wireshark analyzer.<br \/>\n<b>Note that<\/b>A correct dump can only be obtained by connecting your phone\/computer to the headphones\/speaker (as absurd as it may sound)! The headphones can connect to the phone on their own, and in this case, they will request the list of codecs from the phone, not vice versa. To ensure a proper dump, first disconnect from the device, and then, during the dump recording, pair the phone with the headphones.<\/p>\n<p>Use the following display filter to filter out irrelevant traffic:<\/p>\n<pre><code class=\"plaintext\">btavdtp.signal_id<\/code><\/pre>\n<p>As a result, you should see something similar:<br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/habrastorage.org\/webt\/fv\/ku\/xs\/fvkuxsqcdwtxznupploqmldv9qm.png\"><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/b598f3282b36d7761c5f4fa63802d57e.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<p>You can click on each item in the GetCapabilities command to view detailed codec specifications.<br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/habrastorage.org\/webt\/7s\/9a\/xa\/7s9axaeztya_dr2irptfi68ejxs.png\"><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/e5037fe18ae95ed7f047f4b8b8fcb2c8.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<p>Wireshark does not know all codec identifiers, so some codecs will need to be decrypted manually by looking at the table of identifiers below:<\/p>\n<pre><code class=\"plaintext\">Mandatory:\n0x00 - SBC\n\nOptional:\n0x01 - MPEG-1,2 (aka MP3)\n0x02 - MPEG-2,4 (aka AAC)\n0x04 - ATRAC\n\nVendor specific:\n0xFF 0x004F 0x01   - aptX\n0xFF 0x00D7 0x24   - aptX HD\n0xFF 0x000A 0x02   - aptX Low Latency\n0xFF 0x00D7 0x02   - aptX Low Latency\n0xFF 0x000A 0x01   - FastStream\n0xFF 0x012D 0xAA   - LDAC\n0xFF 0x0075 0x0102 - Samsung HD\n0xFF 0x0075 0x0103 - Samsung Scalable Codec\n0xFF 0x053A 0x484C - Savitech LHDC\n\n0xFF 0x000A 0x0104 - The CSR True Wireless Stereo v3 Codec ID for AAC\n0xFF 0x000A 0x0105 - The CSR True Wireless Stereo v3 Codec ID for MP3\n0xFF 0x000A 0x0106 - The CSR True Wireless Stereo v3 Codec ID for aptX<\/code><\/pre>\n<p>To avoid analyzing dumps manually, I created a service that analyzes everything automatically: <noindex><a rel=\"nofollow\" href=\"https:\/\/btcodecs.valdikss.org.ru\">btcodecs.valdikss.org.ru<\/a><\/noindex><\/p>\n<p><\/p>\n<h1>Codec Comparison. Which codec is better?<\/h1>\n<p>Each codec has its own advantages and disadvantages.<br \/>\naptX and aptX HD use fixed profiles that cannot be changed without modifying the encoder and decoder. Neither the phone manufacturer nor the headphone manufacturer can alter the bitrate or encoding parameters of aptX. The codec owner, Qualcomm, provides a reference encoder in the form of a library. These facts are a strong point for aptX \u2014 you already know what quality of sound you will get, without any \"buts.\"<\/p>\n<p>SBC, on the other hand, has many customizable parameters, a dynamic bitrate (the encoder can reduce the bitpool parameter if the radio airwaves are congested), and does not have hard-set profiles, only recommended 'medium quality' and 'high quality' profiles added to the A2DP specification in 2003. 'High quality' is already not considered high by modern standards, and most Bluetooth stacks do not allow using parameters better than those in the 'high quality' profile, although there are no technical limitations to do so.<br \/>\nBluetooth SIG does not have a reference SBC encoder in the form of a library, and manufacturers implement it on their own.<br \/>\nThese are the weaknesses of SBC \u2014 it's never clear in advance what sound quality to expect from a specific device. SBC can deliver both low and very high sound quality, but the latter is unattainable without disabling or bypassing the artificial limitations of Bluetooth stacks.<\/p>\n<p>The situation with AAC is ambiguous: on one hand, theoretically the codec should deliver quality indistinguishable from the original, but practice, as per SoundGuys laboratory tests on various Android devices, does not confirm this. Most likely, it is the fault of low-quality hardware audio encoders integrated into various phone chipsets. It makes sense to use AAC only on Apple devices, while on Android, stick to aptX and LDAC.<\/p>\n<p>Equipment that supports alternative codecs is generally of higher quality, simply because it does not make sense for very cheap low-quality devices to pay licensing fees to use these codecs. In my tests, SBC sounds very good on quality equipment.<\/p>\n<p>I created a web service that encodes audio in SBC, aptX, and aptX HD in real-time, directly in the browser. With it, you can test these audio codecs without actually transmitting audio over Bluetooth, using any wired headphones, speakers, and your favorite music, as well as change encoding parameters while audio is being played:<br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/btcodecs.valdikss.org.ru\/sbc-encoder\/\">btcodecs.valdikss.org.ru\/sbc-encoder<\/a><\/noindex><br \/>\nThe service uses SBC encoding libraries from the BlueZ project and libopenaptx from ffmpeg, which have been compiled to WebAssembly and JavaScript from C, using emscripten, for execution in the browser. Who could have dreamed of such a future!<\/p>\n<p>Here\u2019s what it looks like:<br \/>\n<video controls style=\"top: 0; left: 0; width: 100%; height: 100%; position: absolute;\">Your browser does not support HTML5 video.<source src=\"https:\/\/files.catbox.moe\/9e9q8f.mp4\" type=\"video\/mp4\"><\/source><\/video><br \/>\nNote how the noise level changes after 20 kHz with different codecs. In the original MP3 file, frequencies above 20 kHz are absent.<\/p>\n<p>Try switching between codecs and see if you can hear a difference between the original, SBC 53 Joint Stereo (the standard and most common profile), and aptX\/aptX HD.<\/p>\n<p><\/p>\n<h2>I can hear the difference between codecs <i>in headphones.<\/i>!<\/h2>\n<p>People who cannot hear differences between codecs when testing through the web service claim they can hear it when listening to music on wireless headphones. Unfortunately, this is not a joke or a placebo effect: the difference is indeed audible, but it is not caused by the differences <i>of the codecs.<\/i>.<\/p>\n<p>The overwhelming majority of Bluetooth audio chipsets used in receiving wireless devices are equipped with a digital signal processor (DSP) that implements an equalizer, compander, stereo widener, and other features designed to enhance (or alter) the sound. Manufacturers of Bluetooth equipment can configure the DSP <i>for each codec separately,<\/i>, and when switching between codecs, the listener will feel that they are hearing differences in codec performance, when in fact they are listening to different DSP settings.<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/habrastorage.org\/webt\/0j\/75\/rv\/0j75rvrbutguojyxx9yu0s-uang.png\"><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/6a8f7ab3ef52753cd32f398c023cd601.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><br \/>\n<i>The DSP audio processing pipeline Kalimba in chips produced by CSR\/Qualcomm.<\/i><\/p>\n<p><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/5dd07986d55d2e7e65697ab7114a942b.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Activating various DSP functions for each codec and output separately.<\/i><\/p>\n<p>Some premium segment devices come with software that allows users to adjust DSP settings, but most cheaper headphones lack this capability, and users cannot disable sound post-processing via standard means.<\/p>\n<p><\/p>\n<h2>Functional features of devices.<\/h2>\n<p>The modern version of the A2DP standard has <b>the 'absolute volume control' feature.<\/b> \u2014 control the device volume using special AVRCP protocol commands, which adjusts the output stage amplification instead of reducing the audio stream volume programmatically. If adjusting the volume on the headphones does not sync with the volume on the phone, it means your headphones or phone do not support this feature. In this case, it makes sense to always listen to music at maximum volume on the phone, adjusting the actual volume with the headphone buttons \u2014 this way, the signal-to-noise ratio will be better, and the audio quality will improve. <i>should be<\/i> higher.<br \/>\nIn reality, there are unfortunate situations. On my RealForce OverDrive D1 headphones, a strong compander is enabled for SBC, and increasing the volume raises the level of quiet sounds, while the volume of loud sounds remains unchanged (signal compression occurs). Because of this, I have to set the computer volume to about half, and in this case, the compression effect is practically non-existent.<br \/>\nFrom my observations, all headphones with additional codecs support the function of absolute volume control; apparently, this is one of the requirements for codec certification.<\/p>\n<p>Some headphones support <b>connecting two devices simultaneously<\/b>. This allows, for example, to listen to music from a computer and take calls from a phone. However, it should be noted that in this mode alternative codecs are disabled, and only SBC is used.<\/p>\n<p><b>The AVDTP 1.3 Delay Reporting function<\/b> allows headphones to inform the transmitting device of the delay with which the sound is actually played. This helps to adjust the synchronization of audio with video when watching video files: in case of radio transmission issues, the audio will not lag behind the video; rather, the video will be delayed by the video player until the audio and video synchronize again.<br \/>\nThe function is supported by many headphones, Android 9+, and Linux with PulseAudio 12.0+. I'm not aware of support for this function on other platforms.<\/p>\n<p><\/p>\n<h1>Bidirectional communication via Bluetooth. Voice transmission.<\/h1>\n<p>To transmit voice over Bluetooth, Synchronous Connection Oriented (SCO) is used\u2014a synchronous transmission with pre-established connection agreement. This mode allows for sound and voice to be transmitted strictly in order, with symmetrical send and receive rates, without waiting for acknowledgment of transmission or retransmission of packets. This reduces the overall delay of audio transmission over the radio channel, but imposes serious limitations on the amount of data transmitted per unit of time and negatively impacts quality.<br \/>\nWhen this mode is used, both voice and audio are transmitted with the same quality.<br \/>\nUnfortunately, as of 2019, the quality of voice transmission over Bluetooth is still low, and it's unclear why Bluetooth SIG is not addressing this issue.<\/p>\n<h5>CVSD<\/h5>\n<p>The basic speech transmission codec CVSD was standardized in 2002 and is supported by all bidirectional communication devices over Bluetooth. It provides audio transmission at a sampling rate of 8 kHz, which corresponds to the quality of standard wired telephony. <\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/files.catbox.moe\/c4h77s.flac\">Example recording in this codec<\/a><\/noindex>.<\/p>\n<h5>mSBC<\/h5>\n<p>The additional codec mSBC was standardized in 2009, and by 2010, chips utilizing it for voice transmission began to appear. mSBC is widely supported by various devices.<br \/>\nThis is not a standalone codec, but rather a standard SBC from the A2DP specification, with a fixed encoding profile: 16 kHz, mono, bitpool 26.<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/files.catbox.moe\/b09joy.flac\">Example recording in this codec<\/a><\/noindex>.<\/p>\n<p>Not outstanding, but much better than CVSD; however, it is still unpleasant to use for communication over the internet, especially when using headphones for gaming chat\u2014the game's sound will also be transmitted at a sampling rate of 16 kHz.<\/p>\n<p>FastStream CSR decided to enhance the idea of reusing SBC. To bypass the limitations of the SCO protocol and utilize higher bitrates, CSR took a different approach\u2014they introduced support for bidirectional SBC audio in the one-way audio transfer standard A2DP, standardized encoding profiles, and named it 'FastStream.'<\/p>\n<p>FastStream transmits stereo sound to speakers at 44.1 or 48 kHz with a bitrate of 212 kbps, and for microphone audio is used mono, 16 kHz, with a bitrate of 72 kbps (slightly better than mSBC). These parameters are much better suited for communication in online games\u2014game sounds and conversations will be of high quality.<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/files.catbox.moe\/4gazzt.flac\">Example recording in this codec<\/a><\/noindex> (+ <noindex><a rel=\"nofollow\" href=\"https:\/\/files.catbox.moe\/b09joy.flac\">audio from the microphone, identical to mSBC<\/a><\/noindex>).<\/p>\n<p>The company devised an interesting workaround, but because it contradicts the A2DP standard, support exists only in some of the company\u2019s transmitters (which operate as USB sound cards rather than Bluetooth devices), and it has not been supported in Bluetooth stacks, although the number of headphones with FastStream support is not insignificant.<\/p>\n<p>Currently, FastStream support in operating systems is available only <noindex><a rel=\"nofollow\" href=\"https:\/\/lists.freedesktop.org\/archives\/pulseaudio-discuss\/2019-June\/031175.html\">as a patch for Linux's PulseAudio<\/a><\/noindex> by developer Pali Roh\u00e1r, which is not included in the main branch of the program.<\/p>\n<h5>aptX Low Latency<\/h5>\n<p>To great surprise, aptX Low Latency also supports bidirectional audio, implementing the same principle as FastStream.<br \/>\nThis codec feature cannot be used anywhere \u2014 there is no decoding support for Low Latency in any operating system or any Bluetooth stack known to me.<\/p>\n<p><\/p>\n<h1>Bluetooth 5, Classic and Low Energy<\/h1>\n<p>There has been significant confusion surrounding Bluetooth specifications and versions due to the presence of two incompatible standards under the same brand, both of which are widely used for different purposes.<\/p>\n<p>There are two different, incompatible Bluetooth protocols: Bluetooth Classic and Bluetooth Low Energy (LE, also known as Bluetooth Smart). There is also a third protocol, Bluetooth High Speed, but it is not widespread and is not used in consumer devices.<\/p>\n<p>Starting with Bluetooth 4.0, changes in the specification primarily focused on Bluetooth Low Energy, while the Classic version received only minor improvements.<\/p>\n<p>List of changes between Bluetooth 4.2 and Bluetooth 5:<\/p>\n<blockquote><p>9 CHANGES FROM v4.2 TO 5.0<\/p>\n<p>9.1 NEW FEATURES<\/p>\n<p>Several new features are introduced in the Bluetooth Core Specification 5.0 Release. The major areas of improvement are:<br \/>\n\u2022 Slot Availability Mask (SAM)<br \/>\n\u2022 2 Msym\/s PHY for LE<br \/>\n\u2022 LE Long Range<br \/>\n\u2022 High Duty Cycle Non-Connectable Advertising<br \/>\n\u2022 LE Advertising Extensions<br \/>\n\u2022 LE Channel Selection Algorithm #2<br \/>\n9.1.1 Features Added in CSA5 \u2014 Integrated in v5.0<br \/>\n\u2022 Higher Output Power<\/p><\/blockquote>\n<p><i>Source: <noindex><a rel=\"nofollow\" href=\"https:\/\/www.bluetooth.org\/docman\/handlers\/DownloadDoc.ashx?doc_id=421043\">www.bluetooth.org\/docman\/handlers\/DownloadDoc.ashx?doc_id=421043<\/a><\/noindex> (page 291)<\/i><\/p>\n<p>Only one change affected the Classic version within the Bluetooth 5 specification: support for the Slot Availability Mask (SAM) technology, intended to improve radio spectrum division, was added. All other changes concern only Bluetooth LE (and Higher Output Power as well).<\/p>\n<p><b>All<\/b> audio devices only use Bluetooth Classic. Headphones and speakers cannot connect via Bluetooth Low Energy: there is no audio transmission standard using LE. The A2DP standard, used for transmitting high-quality audio, only works through Bluetooth Classic, and there is no equivalent in LE.<\/p>\n<p>It is pointless to purchase audio devices with Bluetooth 5 solely due to the new version of the protocol. Bluetooth 4.0\/4.1\/4.2 will work exactly the same in terms of audio transmission.<br \/>\nIf the announcement of new headphones mentions a doubled operational range and reduced power consumption thanks to Bluetooth 5, know that they either don\u2019t understand it themselves or are misleading you. It's no surprise, as even Bluetooth chip manufacturers often confuse the differences in the new version of the standard in their announcements, and some Bluetooth 5 chips support the fifth version only for LE, while using 4.2 for Classic.<\/p>\n<h1>Audio transmission delay<\/h1>\n<p>The magnitude of audio delay (latency) depends on many factors: the size of the buffers in the audio stack, the Bluetooth stack, and in the playback wireless device itself, as well as the algorithmic delay of the codec.<\/p>\n<p>The delay of simple codecs, such as SBC, aptX, and aptX HD, is very small, ranging from 3 to 6 ms, which can be neglected. However, complex codecs, such as AAC and LDAC, can introduce noticeable delay. The algorithmic delay for AAC at 44.1 kHz is around 60 ms. LDAC has about 30 ms (according to a rough analysis of the source code; I might be mistaken, but not by much).<\/p>\n<p>The final delay heavily depends on the playback device, its chipset, and buffer. During testing, I recorded a range from 150 to 250 ms on different devices (using the SBC codec). Assuming that devices supporting additional codecs like aptX, AAC, and LDAC use high-quality components and a small buffer size, we get the following typical delays:<\/p>\n<p>SBC: 150-250 ms<br \/>\naptX: 130-180 ms<br \/>\nAAC: 190-240 ms<br \/>\nLDAC: 160-210 ms<\/p>\n<p>I remind you: aptX Low Latency is not supported in operating systems, which means that lower latency can only be achieved with a transmitter+receiver or transmitter+headphones\/speaker combo, with all devices needing to support this codec.<\/p>\n<p><\/p>\n<h1>Device issues, certification, and Bluetooth logos<\/h1>\n<p>How to distinguish a quality audio device from a cheap knockoff? Primarily by its appearance!<\/p>\n<p>Cheap Chinese headphones, speakers, and receivers tend to have:<\/p>\n<ol>\n<li>No \"Bluetooth\" wording on the packaging or device; more often, \"Wireless\" or \"BT\" is used.<\/li>\n<li>No Bluetooth logo <img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/bde65e4674a5d573c0482e64ea6ff2d3.png\" style=\"display:block;margin: 0 auto;\" \/> on the packaging or device<\/li>\n<li>No blinking blue LED<\/li>\n<\/ol>\n<p>\nThe absence of these elements indicates that the device has not gone through certification, meaning it is potentially of low quality and problematic. For example, Bluedio headphones are not Bluetooth certified and do not fully comply with the A2DP specification. They would not pass certification.<\/p>\n<p>Let's consider a few devices and their boxes:<br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/habrastorage.org\/webt\/e4\/qa\/rr\/e4qarrce8fcjv8wwu46aiyib3oa.jpeg\"><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/12b3b234a522eaef783b480e8f003ffc.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/habrastorage.org\/webt\/ba\/06\/vb\/ba06vbcolhpvuie2xlbgnvsycd0.jpeg\"><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/da56314dd65a1000cd3b545d9925d08b.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/habrastorage.org\/webt\/mw\/1b\/t1\/mw1bt1hp0cz11xuilzyz0a70dca.jpeg\"><img decoding=\"async\" alt=\"Audio over Bluetooth: a detailed look at profiles, codecs, and devices\" src=\"\/wp-content\/uploads\/2bb0356a92d8aee2a84c3123aa8d7e09.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<p>All of these are uncertified devices. The instructions may feature a logo and the name of the Bluetooth technology, but the most important thing is that they are on the box and\/or the device itself.<\/p>\n<p>If your headphones or speaker say, \"Ze bluetooth dewise is connecteda successfulle,\" this also does not indicate their quality:<br \/>\n<center><div class=\"youtube-placeholder\" data-id=\"TOFbsbGpIWk\" onclick=\"loadVideo(this)\">\r\n        <img decoding=\"async\" src=\"https:\/\/img.youtube.com\/vi\/TOFbsbGpIWk\/hqdefault.jpg\" alt=\"Play video\" loading=\"lazy\" width=\"480\" height=\"360\" style=\"width:100%;height:auto;\">\r\n        <div class=\"play-button\"><\/div>\r\n    <\/div><\/center><\/p>\n<p><\/p>\n<h1>Conclusion<\/h1>\n<p>Can Bluetooth completely replace wired headphones and headsets? It can, but at the cost of low quality during calls, increased audio transmission delay that can be annoying in games, and a plethora of proprietary codecs that require licensing fees, thus increasing the final cost of both smartphones and headphones.<\/p>\n<p>The marketing of alternative codecs is very strong: aptX and LDAC are presented as a long-awaited replacement for the \"outdated and poor\" SBC, which is not as bad as it is often made out to be.<\/p>\n<p>It turns out that the artificial limitations of Bluetooth stacks on the bitrate of SBC can be bypassed, so that SBC is on par with aptX HD. I took the initiative and created a patch for the LineageOS firmware: <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/455316\/\">Modifying the Bluetooth stack to enhance sound quality on headphones without AAC, aptX, and LDAC codecs<\/a><\/noindex><\/p>\n<p>More information can be found on the websites <noindex><a rel=\"nofollow\" href=\"https:\/\/www.soundguys.com\/\">SoundGuys<\/a><\/noindex> and <noindex><a rel=\"nofollow\" href=\"http:\/\/soundexpert.org\/\">SoundExpert<\/a><\/noindex>.<\/p>\n<p><b>Bonus:<\/b> <noindex><a rel=\"nofollow\" href=\"https:\/\/files.catbox.moe\/29l4kd.zip\">reference SBC encoder, information on A2DP bitstream and test files<\/a><\/noindex>. This file was previously published on the Bluetooth website publicly, but is now only available for members of Bluetooth SIG.<\/p>\n<p>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/427997\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0418\u0437-\u0437\u0430 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u043e\u0432 \u0431\u0435\u0437 \u0430\u0443\u0434\u0438\u043e\u0440\u0430\u0437\u044a\u0435\u043c\u0430 3.5 \u043c\u043c \u0431\u0435\u0441\u043f\u0440\u043e\u0432\u043e\u0434\u043d\u044b\u0435 Bluetooth-\u043d\u0430\u0443\u0448\u043d\u0438\u043a\u0438 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u0442\u0430\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u0443\u0437\u044b\u043a\u0438 \u0438 \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u044b. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0438 \u0431\u0435\u0441\u043f\u0440\u043e\u0432\u043e\u0434\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0438\u0448\u0443\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0442\u043e\u0432\u0430\u0440\u0430, \u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e Bluetooth-\u0430\u0443\u0434\u0438\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0432\u044b, \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b, \u043d\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445, \u0438 \u0447\u0430\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-35145","post","type-post","status-publish","format-standard","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0418\u0437-\u0437\u0430 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/audio-cherez-bluetooth-maksimalno-podrobno-o-profilyah-kodekah-i-ustrojstvah\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0410\u0443\u0434\u0438\u043e \u0447\u0435\u0440\u0435\u0437 Bluetooth: \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044f\u0445, \u043a\u043e\u0434\u0435\u043a\u0430\u0445 \u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0418\u0437-\u0437\u0430 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/audio-cherez-bluetooth-maksimalno-podrobno-o-profilyah-kodekah-i-ustrojstvah\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T19:02:32+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T19:02:32+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Audio over Bluetooth: all about profiles, codecs, and devices | ProHoster","description":"Due to mass production.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/audio-cherez-bluetooth-maksimalno-podrobno-o-profilyah-kodekah-i-ustrojstvah","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0410\u0443\u0434\u0438\u043e \u0447\u0435\u0440\u0435\u0437 Bluetooth: \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044f\u0445, \u043a\u043e\u0434\u0435\u043a\u0430\u0445 \u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 | ProHoster","og:description":"\u0418\u0437-\u0437\u0430 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/audio-cherez-bluetooth-maksimalno-podrobno-o-profilyah-kodekah-i-ustrojstvah","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T19:02:32+00:00","article:modified_time":"2019-10-31T19:02:32+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"35145","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 22:04:30","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 02:09:54","updated":"2026-01-21 22:04:30","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/35145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=35145"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/35145\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=35145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=35145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=35145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}