_____ Are Conducted Media That Can Be Used for Both Data and Voice Transmissions.

Audio over Bluetooth: most detailed data virtually profiles, codecs, and devices

XKCD comic. How standards proliferate. SITUATION: there are 14 competing standards. Geek: 14?! Ridiculous! We need to develop one universal standard that covery everyone's use cases. Geek's girlfriend: yeah! SOON: Situation: there are 15 competing standards.

This commodity is as well available in Russian / Эта статья также доступна на русском языке

The mass market of smartphones without the 3.v mm audio jack changed headphones manufacture, wireless Bluetooth headphones take become the main fashion to listen to music and communicate in headset way for many users.
Bluetooth device manufacturers rarely disembalm detailed product specifications, and Bluetooth sound articles on the Internet are contradictory and sometimes wrong. They practise non tell about all the features, and often publish the same false data.
Allow's try to understand the protocol, the capabilities of Bluetooth stacks, headphones and speakers, Bluetooth codecs for music and speech, notice out what affects the quality of the transmitted sound and the delay, learn how to capture and decode information about supported codecs and other device features.

TL;DR:

  • SBC codec is OK
  • Headphones have their own per-codec equalizer and post processing configuration
  • aptX is not equally skillful every bit the advertisements say
  • LDAC is a marketing fluff
  • Voice audio quality is still low
  • Browsers are able to execute audio encoders compiled to WebAssembly from C using emscripten, and they won't even lag.

Music via Bluetooth

The functional components of Bluetooth are defined past profiles—documented features formalized in specifications. Bluetooth music is transmitted using a high-quality audio A2DP transmission contour. The A2DP standard was adopted in 2003, and has non inverse drastically since then.
The profile standardize 1 mandatory codec—SBC, a low computational complexity codec created specifically for Bluetooth, and 3 boosted codecs. One tin also apply vendor-specific codecs of your ain implementation, non included into A2DP.

Every bit of June 2019, nosotros live in XKCD comic with 14 A2DP codecs:

  • SBC ← included into A2DP, supported by all devices
  • MPEG-i/two Layer one/ii/three ← included into A2DP: widely-known MP3, common in digital TV MP2, and obsolete MP1
  • MPEG-2/four AAC ← included into A2DP
  • ATRAC ← Sony'southward old codec, included into A2DP
  • LDAC ← Sony'due south new codec
  • aptX ← codec from 1988
  • aptX Hd ← the same as aptX but with unlike encoding profile
  • aptX Low Latencytotally different codec, no software implementation aptX with lower buffer
  • aptX Adaptive ← another Qualcomm codec
  • FastStream ← pseudo-codec, SBC bidirectional modification
  • HWA LHDC ← Huawei's New Codec
  • Samsung HD ← supported by 2 devices
  • Samsung Scalable ← supported past 2 devices
  • Samsung UHQ-BT ← supported by three devices

You may wonder why nosotros demand a codec in the get-go place, if Bluetooth has EDR, which allows y'all to transfer data at 2 or iii Mb/s while uncompressed two-channel 16-bit PCM requires just ane.4 Mb/southward?

Bluetooth Data Transfer

There are ii types of information transfer in Bluetooth: Asynchronous Connexion Less (ACL) for asynchronous transfer without establishing a connexion, and Synchronous Connectedness Oriented (SCO), for synchronous transfer with connection establishment.
Data manual uses time-division scheme and changes frequency channel for each transmitted data packet (Frequency-Hop/Fourth dimension-Division-Duplex, FH/TDD). The time is divided into 625 microsecond intervals, called slots. Ane of the devices transmits in fifty-fifty numbers of slots, the other—in odd numbers. A transmitted packet can occupy 1, three or 5 slots, depending on the size of the data and the transmission fashion. If the package is big plenty and more i slot transmission fashion is used, the data is carried out in even and odd slots until the terminate of the transmission. In one second you can receive and send upwards to 1600 packets if each of them occupies 1 slot and both devices continuously transmit and receive data.

Transfer rates of 2 or 3 Mbps for EDR establish in announcements and on Bluetooth website are the maximum aqueduct data transfer charge per unit of all data in total (including the technical headers of all protocols for data to be encapsulated into) in ii directions simultaneously. The bodily data transfer charge per unit volition vary profoundly.

Asynchronous method is used for music streaming, most e'er using two-DH5 and iii-DH5 type packets, which comport the maximum amount of data in 2 Mb/s and 3 Mb/s EDR modes respectively and occupy v time division slots.

Schematic representation of manual using five slots by one device and ane slot by another (DH5/DH1):
5 transmission slots, each of which is transmitted for 625 microseconds, and one receiving slot, also 625 microseconds. 3.75 milliseconds in total.

Due to time sharing principle, we have to look for a 625 microsecond time slot after transmitting a parcel if the 2d device does not transmit anything to us or transmits a small parcel, and more fourth dimension if the second device performs manual in large packets. If more one device is connected to the telephone (e. g. headphones, smart watch and a fitness bracelet), then the transmission time is shared between them all.

A2DP sound streaming requires encapsulation in a special transport protocols L2CAP and AVDTP which deduct xvi bytes from the maximum possible amount of audio payload in the packet.

1414 and 1429 kbps are just not enough to transmit uncompressed audio in existent-world conditions, with a noisy two.iv GHz band and occasional service data. EDR 3 Mbps is demanding of transmit power and signal/dissonance ratio, and then even in 3-DH5 style no comfortable PCM transmission is possible, every bit there will always be short-term interruptions and everything will work more or less reliable only at a distance of a couple of meters.
In practice, even 990 kb/s sound stream (LDAC 990 kb/due south) is not fiddling to transmit reliably.

Permit's go back to the codecs.

SBC

This codec is mandatory for all devices supporting A2DP standard. The best and the worst codec at the same time.

SBC is a simple and computationally fast codec with a primitive psychoacoustic model (with elementary auditory masking) using adaptive pulse lawmaking modulation (APCM).
A2DP specification recommends using two profiles: Middle Quality and High Quality.
Table with Middle Quality and High Quality profiles. The specified values are bitpool, frame length and bitrate. For 44.1 kHz joint stereo. Middle Quality: bitpool = 35, frame length = 83, bitrate = 229. High Quality: bitpool = 53, frame length = 119, bitrate = 328.

The codec has many settings that allow you to command the algorithmic filibuster, number of samples in the cake and bit resource allotment algorithm, simply almost always the parameters used in the specification are used everywhere: Joint Stereo, viii frequency bands, xvi blocks in the sound frame, Loudness bit resource allotment method.
SBC tin can adjust bitpool parameter dynamically, which direct affects the bitrate. If the radio is clogged, packets are lost, or devices are far away, the audio source can reduce bitpool to foreclose sound disruptions until the connectedness is stable once more.

Manufacturers of most headphones fix the maximum value of bitpool parameter to 53, which limits the bitrate to 328 kilobits per second when using the recommended profile.
Fifty-fifty if the headphone manufacturer has set the maximum bitpool value above 53 (which is true, for example, for Beats Solo³, JBL Everest Elite 750NC, Apple tree AirPods, and also for some receivers and automobile head units), most Bone volition non let using higher bit rates due to internal limits ​​in Bluetooth stacks.
In addition, some manufacturers prepare depression maximum bitpool value for some devices. For example, in Bluedio T information technology equals to 39, in Samsung Gear IconX it is 37, which gives poor sound quality.

The artificial limitations were introduced in Bluetooth stacks probably due to insufficient amount of certification tests and incompatibility of some devices with large Bitpool values or atypical profiles, fifty-fifty if they study to support them. Information technology was easier for the developers to restrict the options to known-good values of a recommended profile, rather than creating database of incompatible devices. Though now they practice this for other incorrectly working functions.

SBC dynamically allocates quantization bits for frequency bands, interim from bottom to top, with different weights. If the entire bit rate was used for low and center frequencies, the upper frequencies volition be cutting off (replaced by silence).

Instance of SBC 328 kbps. Original audio is on the meridian, SBC-encoded sound is on the bottom. The tracks are switched for comparison. Audio stream in the video file is compressed using FLAC lossless codec. Using FLAC in the mp4 container is not officially standardized, that's why the audio may not play in your browser (should work in the latest versions of desktop Chrome and Firefox). If y'all do not accept sound, you can download the file and open it in any video histrion.

ZZ Top — Sharp Dressed Human being

The moment of switching is visible on the spectrogram: SBC periodically cuts quiet sounds above 17.5 kHz, and does non allocate bits at all for a band above 20 kHz. The spectrogram is clickable (ane.7 MB).
image

I can non hear the difference betwixt the original and the SBC on this track.

Let'due south take something newer and simulate audio quality of Samsung Gear IconX headphones with Bitpool 37 (top is the original stream, bottom is SBC 239 kbps, FLAC is used for sound).

Mindless Self Indulgence — Witness

I hear crackle, a smaller stereo effect and an unpleasant «clatter» of vocals at high frequencies.

To sum upwards, SBC is a very flexible codec: it can exist configured for low latency, gives fantabulous audio quality at loftier bitrates (452+ kb/s) and is quite good for most people on standard High Quality (328 kb/s). Nevertheless, in that location are a few reasons why the codec is infamous for its depression sound quality: A2DP standard does not define fixed profiles (it merely gives recommendations), Bluetooth stack developers gear up bogus limits on Bitpool, the parameters of the transmitted sound are non displayed in the user interface, and headphone manufacturers are free to set their settings and never specify the Bitpool value in technical characteristics of the product.
The bitpool parameter directly affects the bitrate simply within ane profile. The same bitpool value of 53 tin produce both the 328 kbps bitrate with the recommended Loftier Quality profile, and 1212 kbps in Dual Aqueduct mode and 4 frequency bands, which is why the Bone authors as well ready limits on bitrate in addition to bitpool. I assume the situation arose due to the flaw in the A2DP standard: it was necessary to negotiate the bitrate, not bitpool.

Table of SBC features supported in unlike Os:

* Bitpool decreases, but does not increment automatically in instance of varying transmission conditions. To restore bitpool, y'all need to stop playback, wait a couple of seconds and restart the audio.
** The default value depends on the stack settings specified when compiling the firmware. In Android viii/8.ane the frequency is only either 44.1 kHz or 48 kHz, depending on the settings when compiling, other versions support 44.i kHz and 48 kHz simultaneously.
*** Bitpool value tin can be adjusted using Bluetooth Explorer software.

aptX and aptX Hd

aptX is a simple and computationally fast codec, without psychoacoustics, which uses adaptive differential pulse code modulation (ADPCM). It appeared around 1988 (patent filing date is February 1988). Before Bluetooth, information technology was used mostly for professional person wireless audio equipment. Currently endemic by Qualcomm, it requires licensing and license fees. As of 2014: $6,000 one-fourth dimension payment and ≈ $i per-device, for batches of up to 10,000 devices (source, page 16).

The codec has only one parameter—sampling charge per unit. Although there's besides aqueduct number/mode configuration choice, all devices I know only back up stereo (70+ models).

* Versions up to vii require modification of Bluetooth stack. The codec is supported only if the manufacturer of Android device has licensed the codec usage from Qualcomm (if the OS has encoding libraries included).

aptX splits audio into iv frequency bands and quantizes them with the same number of bits continuously: viii bits for 0-v.5 kHz, iv $.25 for v.5-11 kHz, 2 bits for 11-sixteen.5 kHz, 2 bits for 16.5-22 kHz (values for 44.1 kHz sample rate).

aptX sound example (top—original audio, bottom—aptX-encoded sound, spectrograms of left channels only, sound in FLAC):

The upper frequencies are a footling redder, but the divergence is not audible.

Due to the fixed distribution of quantization bits, the codec cannot "transfer the bits" to frequencies that need them most. Different SBC, aptX will not "cut off" frequencies, but will add quantization dissonance to them, reducing the dynamic range of the audio.

We should not assume that using, for example, 2 $.25 for a band reduces the dynamic range to 12 dB: ADPCM allows up to 96 dB of dynamic range to be used, even with two quantization bits, but but with a certain type of signal.
ADPCM stores the difference betwixt the current and the adjacent value in numerical representation, instead of using the accented value, as in PCM. This reduces the requirements for the number of bits needed to store the same (without loss) or near the same (with relatively minor rounding error) information. To reduce rounding errors, gene tables are applied.
When creating the codec, the authors calculated ADPCM coefficients on a set up of music sound files. The closer audio signal is to the set of music on which the tables were built, the less quantization errors (noise) are generated by aptX.

Because of this, synthetic tests will always produce worse results than music. I made a special synthetic example in which aptX performs desperately—a 12.4 kHz sine wave (top—original signal, bottom—aptX. Sound in FLAC. Ear rape, subtract the volume!):

Spectrum Graph:
Spectrum graph, maximum noise level - -55 dB

Racket is clearly audible.

Nevertheless, if you generate a sine wave with a smaller aamplitude so that information technology is quieter, the noise will also become quieter, which indicates a wide dynamic range:
Spectrum graph, maximum noise level - -75 dB

To hear the difference between an original music rail and a compressed 1, y'all tin invert 1 of the signals and add tracks to respective channels. This approach is wrong in full general and would not give proper results with more than complex codecs, only for ADPCM-class codec usage of this method is reasonable.
The deviation betwixt original and aptX-encoded audio
The root mean square difference of the signals is at the level of -37.4 dB, which is not much for such compressed music.

aptX HD

aptX HD is not a standalone codec—it is an improved aptX encoding contour. The changes affect the number of bits allocated for frequency bands encoding: 10 bits for 0-5.5 kHz, 6 bits for five.5-xi kHz, 4 bits for 11-16.five kHz, 4 $.25 for 16.5-22 kHz (values for 44.ane kHz).

* Versions up to vii crave modification of Bluetooth stack. The codec is supported just if the manufacturer of Android device has licensed the codec usage from Qualcomm (if the Os has encoding libraries included).

This codec is less mutual than aptX: it seems to require split licensing from Qualcomm, and separate licensing fees.

Let'southward repeat the example with a 12.iv kHz sine moving ridge:
Spectrum graph, maximum noise level - -72 dB

Much better than with aptX, just however noisy.

aptX Low Latency

Depression latency version of aptX is not a stand-alone codec. It differs only in the latency and buffers settings that are applied on the audio unit side. Beside of that, that'south a usual aptX.
Information technology was designed for interactive audio transmission with low latency (movies, games), where the sound delay can not be adapted programmatically. At that place'due south Dell driver software implementation available for Intel Bluetooth chips. It is also supported by transmitters, receivers, headphones and speakers, but not smartphones.

AAC

AAC, or Advanced Audio Coding, is a computationally sophisticated codec with a complex psychoacoustic model. It is widely used for audio on the Cyberspace, the second nigh popular codec afterward MP3. Requires licensing and license fees: $15,000 ane-fourth dimension payment (or $grand for companies with less than xv employees) + $0.98 for the offset 500,000 devices (source).
The codec is standardized within MPEG-2 and MPEG-iv specifications, and, despite frequent misbelief, does not belong to Apple.

* only on devices whose manufacturers paid royalties

iOS and macOS contain the best Apple tree AAC encoder available to appointment, producing the highest possible audio quality. Android uses the second-best Fraunhofer FDK AAC encoder, but also can use diverse hardware encoders embedded in the platform (SoC) with an unknown encoding quality. Co-ordinate to recent tests published on SoundGuys website, the quality of AAC encoding on dissimilar Android phones varies greatly:
Plot of AAC coding spectrum of various mobile devices. The Huawei P20 Pro has a sharp decline in the region of 14 kHz, in LG V30 - in the region of 16 kHz, in Samsung Note 8 - 17 kHz, in Apple iPhone 7 - 19 kHz.

Most wireless sound devices have a maximum bitrate of 320 kbps for AAC, some support only 256 kbps. Other bitrates are extremely rare.
AAC provides fantabulous quality at 320 and 256 kb/s fleck rates, merely is decumbent to generation loss on already compressed content, however it'south difficult to hear any differences betwixt the original and AAC 256 kb/south on iOS, fifty-fifty with several consecutive encodings. For MP3 320 kbps encoded into AAC 256 kbps the loss can exist neglected.
But as with whatsoever other Bluetooth codec, any music is first decoded then encoded with a codec. When listening to music in AAC format, it is beginning decoded by the Os, and so encoded into AAC again, for transmission over Bluetooth. This is necessary to mix several audio streams such as music and new message notifications. iOS is no exception. Y'all tin notice a lot of statements that iOS does not transcode music in AAC format for transmission via Bluetooth, which is wrong.

AAC has many extensions to the standard encoding method. One of them—Scalable To Lossless (SLS)—is standardized for Bluetooth and allows you to transfer lossless audio. Unfortunately, no SLS support could exist constitute on existing devices. An extension to reduce manual delay AAC-LD (Depression Filibuster) is non standardized for Bluetooth.

MP1/two/3

MPEG-1/ii Role three codecs consist of well-known and widely used MP3, the less common MP2 (used primarily in digital TV and radio), and the completely unknown MP1.

The old MP1 and MP2 codecs are not supported at all, I could not find any headphones or any Bluetooth stack that would encode or decode them.
MP3 decoding is supported by some headphones, just encoding is not supported on any mod operating system stack. It seems that the third-party BlueSoleil stack for Windows can encode MP3 if you manually edit the configuration file, but on my installation it leads to BSoD on Windows ten. The result: you can't actually use a codec for Bluetooth sound.
Previously, in 2006-2008, before the A2DP standard was widely used in devices, people listened to MP3 music on the Nokia BH-501 headset through the MSI BluePlayer program, which was available on Symbian and Windows Mobile. At that fourth dimension, the OS architecture of smartphones allowed access to many depression-level functions, it was even possible to install 3rd-political party Bluetooth stack on Windows Mobile.

The latest patent of the MP3 codec has expired, the use of the codec does not crave license fees since April 23, 2017.

If the longest-running patent mentioned in the aforementioned references is taken as a measure, then the MP3 technology became patent-free in the Us on 16 April 2022 when U.S. Patent six,009,399, held by and administered by Technicolor, expired.

Source: www.iis.fraunhofer.de/en/ff/amm/prod/audiocodec/audiocodecs/mp3.html

LDAC

New and actively promoted «Hello-Res» codec from Sony that supports sampling rates up to 96 kHz and 24-chip depth, with a bitrate upwardly to 990 kbps. It is advertised equally an audiophile codec, as a replacement for existing Bluetooth codecs. It has an adaptive bitrate role which tunes bitrate depending on the radio transmission weather.

The LDAC encoder (libldac) is included in the standard Android distribution, encoding is supported on whatsoever Android smartphone starting with OS version 8. Software decoders are not freely available and the codec specification is non bachelor to the general public, yet, at first glance at the encoder, the internals are similar to Sony'due south ATRAC9 codec used in PlayStation 4 and Vita: both work in the frequency domain, use a modified discrete cosine transform (MDCT) and Huffman pinch.
LDAC split audio into 12 or 16 frequency bands: 12 is used for 44.1 and 48 kHz, 16 for 88.2 and 96 kHz.

LDAC is supported almost exclusively only by Sony headphones. LDAC decoding is sometimes found on headphones and DACs from other manufacturers, but very rarely.

LDAC «Hi-Res codec» marketing harms its technical properties: it'due south non wise to spend the bitrate to encode and transmit frequencies that are not audible to the human being ear and a higher chip depth when it'southward still not possible to losslessly shrink CD quality audio. Fortunately, the codec has 2 modes of operation: CD sound transmission and Howdy-Res audio manual. In the commencement example, but 44.1 kHz / sixteen $.25 are transmitted over the air.

Since the LDAC software decoder is not freely available, it is not possible to test the codec without additional devices that decode LDAC. According to the results of the LDAC exam on the DAC with its back up, which SoundGuys.com engineers connected via the digital output and recorded the output audio of the test signals, the LDAC 660 and 990 kbit/s in CD quality mode provides a signal-to-racket ratio slightly amend than that of aptX HD. This is a good result.

LDAC CD 990 kbit/s noise profile
Source: www.soundguys.com/ldac-ultimate-bluetooth-guide-20026

LDAC also supports dynamic bitrate outside the established profiles — from 138 kbps to 990 kbps, but equally far equally I tin tell, Android only uses standardized profiles of 303/606/909 and 330/660/990 kbps.

Other codecs

Other A2DP codecs are non widely used. Their support is either almost completely absent, or is only bachelor on certain models of headphones and smartphones.
The A2DP-standardized ATRAC codec has never been used equally a Bluetooth codec even by Sony. Samsung Hd, Samsung Scalable and Samsung UHQ-BT codecs take very limited support from transmitting and receiving devices. HWA LHDC is too new and merely supported three (?) devices.

Audio devices' codec support

Not all manufacturers publish accurate information about codecs supported in certain wireless headphones, speakers, receivers or transmitters. Sometimes it happens that certain codec is supported only for transmission but not for reception (relevant for combined transmitter-receivers), although the manufacturer just declares "support", without any notes (I assume that separate licensing of encoders and decoders is to blame). In the cheapest devices, you tin never find the declared support for aptX.

Unfortunately, supported codecs are not displayed anywhere on near Os interfaces. Data near current used codec is but nowadays in Android, starting with version viii, and macOS. All the same, fifty-fifty in these operating systems, only those codecs that are supported by both the telephone / figurer and headphones will be displayed.

How to find out which codecs the device supports? By capturing and analyzing traffic dump with A2DP negotiation options!
This can be done in Linux, macOS and Android. In Linux yous tin can apply Wireshark or hcidump, in macOS Bluetooth Explorer could be used, and in Android apply Bluetooth HCI dump save feature bachelor in the developers tools. You will become a dump in btsnoop format, which could exist opened in Wireshark analyzer.
Notation: you lot'll demand to connect from the smartphone/computer to the headphones to capture correct dump, not vice versa (no thing how light-headed it sounds)! Headphones tin as well establish a connection to the smartphone or PC, in which case they will request a list of codecs from the phone, and non disembalm their own set of codecs. To ensure that you capture a correct dump, kickoff un-pair the device, so, while recording the dump, pair the telephone with the headphones.

Use the following brandish filter to hibernate irrelevant traffic:

          btavdtp.signal_id        

Every bit a result, you should see something similar:
Wireshark with a loaded dump and a filter to display the A2DP command GetCapabilities

By clicking on GetCapabilities control you tin get detailed information of the codec.
Characteristics of one of the selected items. The codec ID is visible.

Wireshark does not know all codec identifiers, and then some of the codecs will accept to be decrypted manually, depending on the table of identifiers beneath:

          Mandatory: 0x00 - SBC  Optional: 0x01 - MPEG-1,2 (aka MP3) 0x02 - MPEG-ii,4 (aka AAC) 0x04 - ATRAC  Vendor specific: 0xFF 0x004F 0x01   - aptX 0xFF 0x00D7 0x24   - aptX HD 0xFF 0x000A 0x02   - aptX Low Latency 0xFF 0x00D7 0x02   - aptX Low Latency 0xFF 0x000A 0x01   - FastStream 0xFF 0x012D 0xAA   - LDAC 0xFF 0x0075 0x0102 - Samsung HD 0xFF 0x0075 0x0103 - Samsung Scalable Codec 0xFF 0x053A 0x484C - Savitech LHDC  0xFF 0x000A 0x0104 - The CSR True Wireless Stereo v3 Codec ID for AAC 0xFF 0x000A 0x0105 - The CSR True Wireless Stereo v3 Codec ID for MP3 0xFF 0x000A 0x0106 - The CSR True Wireless Stereo v3 Codec ID for aptX        

You can discover out if your device supports EDR iii Mbps by using the following filter:

          bthci_evt.code==0x0b        

image

In order to not analyze the dumps manually, I made a service that will analyze everything automatically: btcodecs.valdikss.org.ru

Simple but useful Windows Bluetooth Tweaker software shows supported and currently used codecs aside from other functionality.
Linux users can also use avinfo utility from BlueZ package.

Codec comparing. Which codec is better?

Each codec has its advantages and disadvantages.
aptX and aptX HD use hard-coded profiles that cannot exist changed without modifying the encoder and decoder. Neither the smartphone nor the headphone manufacturer can change the bitrate or coding factors of aptX. Qualcomm, the possessor of the codec, distributes the reference encoder as a library to the licensees. These facts are aptX'south forte—y'all know in accelerate what quality of sound you will get, no buts.

SBC, on the contrary, has many adjustable parameters, dynamic bitrate (the encoder can reduce the bitpool parameter if the radio is congested), and does not accept hard-coded profiles, but but the recommended «medium quality» and «high quality» that take been added to the A2DP specification in 2003. "High quality" is no longer as high by mod standards, and most Bluetooth stacks do not permit using parameters that are better than in the "high quality" profile, although in that location are no technical limitations for this.
Bluetooth SIG does not provide SBC reference encoder in the form of a library, and the manufacturers implement it themselves.
These are SBC's weaknesses—it is never clear in advance what sound quality is to be expected from a particular device. SBC tin produce both low and very high audio quality, just the latter is unattainable without disabling or circumventing the artificial limitations of Bluetooth stacks.

The state of affairs with AAC is ambiguous: on i hand, theoretically, the codec should produce quality that is duplicate from the original, just exercise, judging by the tests of the SoundGuys laboratory on dissimilar Android devices, is non confirmed. Most probable, the fault is on depression-quality hardware audio encoders embedded in various phone chipsets. It makes sense to use AAC but on Apple devices; with Android you'd ameliorate stick with aptX/HD and LDAC.

Devices that supports culling codecs is ordinarily of higher quality, simply because it does not make sense to pay royalties for very cheap, low-quality devices to use these codecs. Co-ordinate to my tests, SBC sounds very good on high-quality hardware.

I fabricated a web service that encodes sound to SBC, aptX and aptX HD in existent time, right in your browser. You tin utilize information technology to test these audio codecs without actually transmitting audio via Bluetooth, on any wired headphones, speakers, and your favorite music, and too change the encoding parameters directly during audio playback:
btcodecs.valdikss.org.ru/sbc-encoder
The service uses SBC coding libraries from BlueZ project and libopenaptx from ffmpeg, which are compiled into WebAssembly and JavaScript from C via emscripten, for execution in a browser. Who could have dreamed of such a future!

Here'south what information technology looks like:

Notice how the dissonance level changes later xx kHz for unlike codecs. No frequences to a higher place xx kHz present in the original MP3 file.

Try switching codecs and see if you can hear the divergence between the original, SBC 53 Articulation Stereo (the standard and virtually common profile), and aptX / aptX HD.

But I can hear the difference between codecs in a headphones!

People who do not hear the difference betwixt codecs while testing via a web service claim they hear information technology when listening to music with Bluetooth headphones. Unfortunately, that is not a joke or a placebo effect: the deviation is really audible, but it is non caused by difference in codecs.

The vast bulk of Bluetooth sound chipsets used in receiving wireless devices are equipped with a digital betoken processor (DSP) that implements an equalizer, compander, stereo extender, and other things designed to amend (or modify) the sound. Bluetooth hardware manufacturers can configure the DSP for each codec separately, and when switching between codecs, the listener will feel that they can hear the difference in the performance of codecs when in reality they are listening to dissimilar DSP settings.

In the picture: DECODER - Parametric equalizer - stereo improvement - compander - post mastering - output gain
Kalimba DSP audio processing pipeline in CSR/Qualcomm SoCs

In the picture: checkboxes activate different DSP functions separately for each codec.
Activation of diverse DSP functions for each codec and output separately

Some premium segment devices are equipped with software that allows y'all to adjust the DSP parameters, just most of the cheaper headphones do not have this characteristic, and users cannot plow off the mail service-processing of sound using standard tools.

Devices' functional features

The current version of the A2DP standard has an accented volume control part allowing to control output gain with special commands past using AVRCP protocol, instead of programmatically reducing the volume of the sound stream itself. If you change the volume on the headphones and the change is non synchronized with the volume on the phone, this means that your headphones or telephone do not back up this role. 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—the indicate-to-noise ratio volition be better and the sound quality should be higher.
In reality, in that location are sad situations. By RealForce OverDrive D1 headphones use strong compander for SBC and an increase in volume leads to an increase in the level of quiet sounds, and the volume of loud sounds does not change (signal compression occurs). Because of this, it is necessary to set the volume on the figurer to about half, in this case there is practically no compression consequence.
According to my observations, all headphones with additional codecs support absolute volume command role, which is probably one of the requirements for codec certification.

Some headphones back up connecting ii devices at the aforementioned time. This allows, for example, to heed to music from a figurer and receive calls from a telephone. Withal, you should be aware that alternative codecs are disabled in this mode, and simply SBC is used.

The AVDTP 1.iii Delay Reporting feature allows headphones to written report a delay to a sending device that actually plays the audio. This helps to adjust the synchronization of sound with video while watching video files: if radio congestion occurs, the sound will not lag behind the video, only on the contrary, the video volition exist slowed down by the video actor until the audio and video are synchronized once more.
The feature is supported by many headphones, Android 9+ and Linux with PulseAudio 12.0+. I'm not aware about support in other Bone.

Duplex communication over Bluetooth. Vocalism transmisson.

Synchronous Connexion Oriented (SCO) and its enhanced version Enhanced Synchronous Connection Oriented (eSCO) are the modes used for Bluetooth phonation transmission. The mode allows you to transmit sound and voice strictly in order, with a symmetrical speed of sending and receiving, without waiting for confirmation of transmission and re-sending packets. This reduces the overall delay in the transmission of sound over the radio channel, but imposes serious restrictions on the amount of data transmitted per unit of time and adversely affects the quality of the audio.
When this mode is used, both the voice from the microphone and the audio are transmitted to the headphones with the same quality.
Transfer of the information itself is standardized by the HSP profile, which likewise describes additional functions, such equally operation of volume command buttons, the pick up of the handset and the hang up.
Unfortunately, as of 2019, the quality of voice transmission via Bluetooth is however poor, and it is not clear why Bluetooth SIG is not doing annihilation about information technology.

CVSD

The basic speech transfer codec CVSD was standardized in 2002, and is supported by all bidirectional Bluetooth devices. It provides audio transmission with a sampling frequency of 8 kHz, which corresponds to the quality of conventional wired telephony.

An example of recording in this codec.

mSBC

Boosted mSBC codec was standardized in 2009, and in 2010 at that place were chips that already used it for vocalization manual. mSBC is widely supported by various devices.
This is not a standalone codec, but the usual SBC from the A2DP standard, with a fixed encoding profile: 16 kHz, mono, bitpool 26.

An example of recording in this codec.

Not brilliant, but much ameliorate than CVSD, though it is still unpleasant to use it to communicate via the Internet, especially when you use headphones for communication in the game — the sound of the game will also exist transmitted at a sampling frequency of 16 kHz.

FastStream

CSR decided to farther develop the idea of ​​re-using SBC. To become around the limitations of the SCO protocol and use higher scrap rates, CSR went the other way—they've added support for two-way SBC audio into the one-fashion audio transmission A2DP standard, and called it «FastStream».

FastStream transmits 44.1 or 48 kHz stereo sound to speakers with a bitrate of 212 kbps. sixteen kHz with a bitrate of 72 kbps (slightly better than that of mSBC) is used to transmit sound from a microphone. Such parameters are much improve suited for communication in online games—the audio of the game and the teammates will exist of loftier quality.

An example of recording in this codec (+ audio from the mic, the same every bit in mSBC).

The company came up with an interesting hack, but due to the fact that information technology contradicts with A2DP standard, only some of the company's transmitters support it (which work every bit a USB sound card, and not a Bluetooth device), but it did not receive support in Bluetooth stack. The number of headphones with FastStream support is not so small though.

At the moment, FastStream support is bachelor simply in the form of a patch for Linux PulseAudio from Pali Rohár, which is non included in the main program branch.

aptX Low Latency

Much to the surprise, aptX Low Latency also supports bidirectional audio, implementing the same principle as FastStream.
There is no fashion to use this feature of the codec anywhere—at that place is no support for Low Latency decoding in whatsoever OS and in any Bluetooth stack which I'grand aware of.

Bluetooth 5, Archetype and Depression Energy

At that place is a lot of confusion around the specifications and versions of Bluetooth due to the presence of ii incompatible standards under one brand, both of which are widely used for unlike purposes.

There are two different, incompatible Bluetooth protocols: Bluetooth Classic and Bluetooth Low Energy (LE, also known as Bluetooth Smart). There is besides a third protocol, Bluetooth High Speed, only it is not common, and is non used in home appliances.

Beginning with Bluetooth iv.0, the changes in the specifications focused primarily on Bluetooth Depression Energy, while the Classic version received only minor improvements.

Listing of changes betwixt Bluetooth 4.ii and Bluetooth five:

9 CHANGES FROM v4.2 TO 5.0

9.1 NEW FEATURES

Several new features are introduced in Bluetooth Core Specification 5.0 Release. The major areas of improvement are:
• Slot Availability Mask (SAM)
• ii Msym/southward PHY for LE
• LE Long Range
• High Duty Cycle Non-Connectable Advertising
• LE Ad Extensions
• LE Channel Pick Algorithm #two
9.1.one Features Added in CSA5 — Integrated in v5.0
• Higher Output Power

Source: www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=421043 (folio 291)

Only 1 change affected the Classic version inside the specification of Bluetooth five: support for the Slot Availability Mask (SAM) applied science, designed to meliorate radio frequency sharing. All other changes affect just Bluetooth LE (the same applies to Higher Output Power also).

All audio devices use only Bluetooth Classic. Headphones and speakers cannot be connected via Bluetooth Low Energy. In that location is no standard for transmitting audio using LE. The A2DP standard, used to transmit high-quality audio, works only through Bluetooth Classic, and at that place is no equivalent in LE.

To sum up: ownership audio devices with Bluetooth 5 simply considering of the new version of the protocol is meaningless. Bluetooth iv.0/4.ane/4.2 in the context of audio transmission will work the aforementioned mode.
If the announcement of the new headphone mentions a doubled radius and reduced power consumption cheers to Bluetooth v, then you should know that they either do non empathize themselves or mislead you. No wonder, even the manufacturers of Bluetooth fries confuse the difference in both standards, and some Bluetooth 5 chips support the 5th version only for LE, and apply 4.2 for Classic.

Audio transmission latency

The amount of latency (lag) in the audio depends on many factors: the size of the buffer in the audio library, in Bluetooth stack and in the playback device itself, the algorithmic delay of the codec.

The delay of simple codecs, like SBC, aptX and aptX HD is quite small, about 3-6 ms, which tin can be neglected, merely circuitous codecs, such equally AAC and LDAC can give a noticeable delay. Algorithmic delay AAC for 44.1 kHz is 60 ms. LDAC—well-nigh 30 ms (by rough analysis of the source lawmaking. I tin can be wrong, but not much.)

The total filibuster is highly dependent on the playback device, its chipset and buffer. During the tests, I got a spread of 150 to 250 ms on different devices (with the SBC codec). If we assume that devices with support for aptX, AAC, and LDAC additional codecs use better quality components and a pocket-size buffer size, nosotros get the following typical latency values:

SBC: 150-250 ms
aptX: 130-180 ms
AAC: 190-240 ms
LDAC: 160-210 ms

Allow me remind yous: aptX Low Latency is non supported in operating systems, which is why a lower delay can be obtained only with a transmitter + receiver or transmitter + headphone/speaker bundle, and all devices must back up this codec.

The bug with certifications, logos and devices

How to distinguish loftier-quality audio device from cheap crafts? Past the appearance, in the first place!

Cheap Chinese headphones, speakers and receivers have:

  1. No «Bluetooth» give-and-take on the box and the device, nigh often replaced past «Wireless» and «BT»
  2. No Bluetooth logo Bluetooth logo on box or device
  3. No blue flashing LED

The absence of these elements indicates that the device has not been certified, which means that information technology is potentially problematic or of poor quality. For example, Bluedio headphones are not certified by Bluetooth, and do not fully comply with the A2DP specification. They would non have passed certification process.

Let's look at several devices and boxes from them:

These are all not-certified devices. The instructions may accept the logo and «Bluetooth» proper noun, just most importantly—these elements should exist present on the device or box itself.

If your headphones or speaker say «Ze bluetooth dewise is connecteda successfulle», this does not say good about quality besides:

Conclusion

Can Bluetooth completely replace wired headphones and headsets? Probably, but at the price of low quality voice, increased latency in audio transmission, which can be annoying in games, and a multitude of proprietary codecs that require license fees and increase the final cost of both smartphones and headphones.

The marketing of alternative codecs is very strong: aptX and LDAC are presented as a long-awaited replacement of the "outdated and bad" SBC, which is far from as bad as it is commonly thought of.

As it turned out, the artificial limitations of Bluetooth stacks on SBC tin exist bypassed, and then that the SBC volition be on par with aptX Hard disk. I took the initiative and made a patch for LineageOS firmware: Modifying Bluetooth stack to amend the sound on headphones without AAC, aptX and LDAC codecs

More information nearly codecs could be found on SoundGuys and SoundExpert websites.

Bonus: SBC reference encoder, A2DP bitstream information and test files. This file was previously posted on Bluetooth website publicly, but at present it is available only to those who take joined Bluetooth SIG.

Additional article: Bluetooth LC-SBC and SBC-HBR Explained by Ken Laberteaux.

vasquezvaid1965.blogspot.com

Source: https://habr.com/en/post/456182/

0 Response to "_____ Are Conducted Media That Can Be Used for Both Data and Voice Transmissions."

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel