Bluetooth is a protocol allowing low power devices to communicate wireless.

As it is low power, range is 10m (33 feet) most of the time.

 

Bluetooth protocol stack


For audio, Bluetooth can be used to connect a media player and a headset wireless.

Mobile phones and Bluetooth headphones are a well know example.

 

Analog gear can be made wireless by adding a Bluetooth sender to the analog out and/or a Bluetooth receiver to the analog in.

You can turn any wired headphone into a wireless one using a portable receiver.

A2DP

High quality stereo audio is obtained using the A2DP ( Advanced Audio Distribution Profile) protocol. High quality means “high”  relative to the Headset Profile with its 64 kbps mono stream.

SBC

The SBC (sub-band codec) is the mandatory audio codec.

 

There are voices on the internet stating that Bluetooth audio has improved so much over the years.
This is probably the right observation but the wrong conclusion.
SBC is part of Bluetooth from 2003 on and hasn’t changed so no improvement here.
However you can specify the size of the bitpool and this affects the amount of compression.
In the past low values where used to guarantee a stable connection with a low bit rate  as a consequence.
Today 53 is a popular values allowing for 328 kb/s , pretty much like the highest bitrate available in MP3.
Some headphones use even higher values but most OS don’t support this.
If both source and sink would use the maximum values, 1500 kb/s is possible. Indeed this value allows for CD quality.

 

Want to know what paramaters like bitpool or subbands do?

You can try it here: Bluetooth A2DP SBC/aptX online encoder

Optional codecs

Codecs listed as optional are: MPEG 1 & 2 Audio , MPEG 3 & 4, AAC, and ATRAC(Sony).
Vendors can also implement their own protocols.

LC3

Bluetooth SIG is developing a new system for audio, LE Audio
As the name implies it operates on the Bluetooth Low Energy radio.
LE Audio will include a low-power audio codec, the Low Complexity Communications Codec (LC3).
It is supposed to be an improvement on SBC.

According to Bluetooth:
Extensive listening tests have shown that LC3 will provide improvements in audio quality over the SBC codec included with Classic Audio, even at a 50% lower bit rate.

2020 will see the first products using this codec.

aptX

A proprietary codec by CSR (Qualcomm today)
As it is not a mandatory part of the standard you need both a sender and a receiver (SouRCe and SiNK in Bluetooth lingo) supporting this protocol.

Although many think so, aptX is not lossless. It is an alternative for the standard SBC codec.

It has a fixed compression ration of 4:1 and a data rate of 352kbps

An overview of devices supporting aptX

aptX HD

In January 2016 Qualcomm announced aptX HD, it support 24 bits / 48 kHz LPCM audio over Bluetooth.

Compression remains at a ratio of 4:1, with a bit rate of 576kbps.

Although the data rate is substantially higher compared with aptX, it is and remain a lossy codec.

An overview of devices supporting aptX HD

LDAC

LDAC is Sony’s proprietary protocol.
It can transmit up to 990kbps over Bluetooth.

More about LDAC

Android 8 supports both aptX and LDAC.

LHCD

A proprietary codec by HWA (Hi-res Wireless Audio)
Only available on Huawei smartphones.
No headphones or speakers available at the present (march 2019)
It claims a 900 kbps throughput.

 

Overview

 

Codec kbps
SBC 328
APTX 352
APTX-HD 576
LDAC (Connection priority mode) 330
LDAC (Normal mode) 660
LDAC (Quality priority mode) 990
LHCD 900

 

As a reference:

The bit-rate of a CD = 2x16*41000= 1411 kbs

FLAC is roughly half of it.

High bitrate MP3: 320 kbs

Codec used

Most of the time it is unclear which codec is used.

You can check it yourself:
HOWTO find which codec is used between iOS device and bluetooth headphones

How to create btsnoop log on Android device

Lossless Codecs

There are lossless protocols like Kleernet and SKAA.
They support lossless audio but products supporting these protocols are a bit rare.

Skipping the conversion

SBC or aptX work like all codecs.
The audio is compressed (encoded) by the Bluetooth sender, send to the receiver and decompressed (decoded) there.

Regardless of the audio format there will always be this lossy conversion.

 

What if both also supports a codec like AAC.
Will the ACC file send directly to the receiver without this conversion?
Technically this might be possible but I don’t think it works that way.

 

Select a AAC file in a media player.
The media player invokes a codec (AAC of course) and expand the audio to raw PCM.
If we want to use any kind of DSP e.g. volume control, it has too.
If we use a mixer like DS in Win or Core Audio in OSX, it must be raw PCM.
As far as I know, it is pretty difficult if not impossible to do any kind of DSP on compressed formats unless one expands them to PCM.

 

Hence I expect a media player to decode any format to PCM and send this to the audio device including our Bluetooth radio regardless of the codec used by this device.

This makes the scenario of sending any compressed file e.g. AAC straight to a Bluetooth sender a bit unlikely.

However, this is written with a PC in mind.

Mobile phones might work different.
Bluetooth headphones have their own control like volume, next track, etc.
In this case it is possible that e.g. a AAC file is send unaltered to the headphone and all processing is handled there.

However, as soon as it is possible to hear multiple streams e.q. music and a ring tone, obvious the mixing is done by the OS of the sender (the mobile) so decoding/encoding is done before the autio stream is send to the headphone.

You can't mix without converting AAC to PCM first.

 

Just as with any other Bluetooth codec, any music is first decoded then encoded with a codec. When listening to music in AAC format, it is first decoded by the OS, then 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. You can find a lot of statements that iOS does not transcode music in AAC format for transmission via Bluetooth, which is incorrect.

Audio over Bluetooth: most detailed information about profiles, codecs, and devices

Choosing the codec

From Android 8 on, it is possibe to control the Bluetooth settings.

 

SBC-aptX

Rtings measured both frequency response and total harmonic distortion.
The differences between aptX and SBC are very small.

There is a small difference in latency between SBC and aptX.
In both cases still a bit too high for watching video (lip sync).
If you are in need for low latency, aptX LL is the best codec.

 

Plantronics BackBeat Pro 2 latency  
Wired 7 ms
SBC 173 ms
aptX 166 ms
aptX LL (Low Latency) 34 ms


Robert Triggs measured various codec's on various mobiles.

 The codec’s do differ a little in latency but the phones make a difference as well.

Note the fluctuation in latency, it can be quite high

 

 

References
  1. Bluetooth SIG
  2. Bluetooth - Wikipedia
  3. Optimally Using the Bluetooth Subband Codec - Christian Hoene and Mansoor Hyder
  4. Bluetooth - palowireless
  5. aptX - Qualcom
  6. aptX - Wikipedia
  7. aptX - Hydrogenaudio
  8. Bluetooth audio quality - A2DP - SoundExpert
  9. Bluetooth Can Reduce Audio Quality, But It Doesn't Have To. Here's Why. - Brent Butterworth
  10. SBC vs AptX: Which Bluetooth Codec is the best? - Rtings.com
  11. Andoid Dev options - Cityle
  12. How good is Bluetooth audio at its best? - Behzad Haki
  13. Audio over Bluetooth: most detailed information about profiles, codecs, and devices
  14. Android's Bluetooth latency needs a serious overhaul - Rober Triggs
  15. HOWTO find which codec is used between iOS device and bluetooth headphones - Valdikss
  16. Bluetooth A2DP Codec Dissection - Valdikss