Audio over Bluetooth


Free Download Mp4Gain
picture

Audio over Bluetooth: as detailed as possible about profiles, codecs and devices
Audio  over bluetooth

Due to the massive launch of smartphones without 3.5mm audio jack, Bluetooth wireless headphones have become the main way to listen to music and communicate in headphone mode for many.

Audio over bluetooth
Manufacturers of wireless devices do not always write detailed product specifications, and articles on Bluetooth audio on the Internet are contradictory, in some places incorrect, do not count all functions, and often copy the same information that does not correspond to reality.
Let’s try to understand the protocol, the capabilities of the Bluetooth operating system stacks, headphones and speakers, Bluetooth codecs for music and voice, find out what affects transmitted sound quality and latency, learn how to collect and decode information about supported codecs and other capabilities. Of the device.

Bluetooth music

The functional component of Bluetooth is defined by profiles: specific function specifications. Bluetooth music streaming is done using the A2DP high-quality one-way audio streaming profile. The A2DP standard was adopted in 2003 and has not changed dramatically since then.
Within the profile, 1 mandatory SBC codec of low computational complexity, created specifically for Bluetooth, and 3 additional ones are standardized. It is also allowed to use undocumented codecs of your own implementation.

Why do you need codecs at all, you wonder, when Bluetooth has EDR, which allows data transfer rates at 2 and 3 Mbps, and 1.4 Mbps is sufficient for uncompressed 2-channel 16-bit PCM?

Bluetooth data transmission

In Bluetooth, there are two types of data transfer: Asynchronous Connection Less (ACL) for asynchronous transfer without establishing a connection, and Synchronous Connection Oriented (SCO), for synchronous transfer with prior agreement of the connection.
Transmission is carried out using a time division scheme and the selection of the transmission channel for each packet separately (Frequency Hopping / Time Division-Duplex, FH / TDD), for which time is divided into slots of 625 microseconds called slots. One of the devices transmits in even slot numbers, the other in odd slots. The transmitted packet can occupy 1, 3 or 5 slots, depending on the size of the data and the type of transmission configured, in this case the transmission by a device is carried out in even and odd slots until the end of the transmission. In just one second, you can receive and send up to 1600 packets, if each of them occupies 1 slot, and both devices transmit and receive something without stopping.

2 and 3 Mbps for EDR, which can be found in the advertisements and on the Bluetooth website, are the maximum channel transmission rate of all data in total (including technical headers for all protocols in which they must be encapsulate the data) in two directions simultaneously. Actual data transfer rates will vary greatly.

To transfer music, an asynchronous method is used, almost always with the help of packets of the type 2-DH5 and 3-DH5, which carry the maximum amount of data in EDR mode of 2 Mbps and 3 Mbps, respectively, and occupy 5 time division slots.

Schematic representation of a transmission with 5 slots for one device and 1 slot for another (DH5 / DH1):
5 слотов на передачу, каждый из которых передаётся 625 микросекунд, и один слот на приём, тоже 625 микукро. В сумме – 3.75 миллисекунды.

Due to the principle of division of air in time, we have to wait a time interval of 625 microseconds after transmitting a packet if the second device does not transmit anything or a small packet, and a longer amount of time if the second device is transmitting in large packets. If more than one device is connected to the phone (for example, headphones, watches, and a fitness bracelet), the transfer time is shared among all.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Bluetooth playback on desktop computer.

Bluetooth playback on desktop computer.

Bluetooth

Recently, more and more wireless headsets and smartphones have been released without a 3.5mm jack, and the latter are getting more and more sophisticated Bluetooth codecs.

Bluetooth audio

However, desktop systems are much more conservative in this regard: here almost all devices are still equipped with a headphone jack, and the cable rarely interferes, therefore, with the transmission of sound via Bluethtooth, here everything is sadder.

However, the customization of a PC is much greater than that of smartphones, so if you bought great wireless headphones, don’t worry, you can also enjoy high-quality sound on the desktop operating system.

What are Bluetooth codecs?

First, a brief introduction to the theory. With wireless sound transmission, everything is more complicated than with a wired one: here you cannot just connect the cable and immediately get high-quality sound; this requires that both the headphones and the device support the desired codec.

Their complete list is quite impressive:
SBC is the basic codec included in the A2DP standard, which is compatible with 99% of all BT devices released in the last 10 years, and absolutely all wireless headphones. Consequently, if you don’t want to understand, you can just buy any BT headset and connect it to your device; the music will be broadcast. It would seem, what is the problem then? And is that SBC is comparable in sound quality to mp3 with a bit rate of 128 kbps: that is, you can listen to podcasts or YouTube videos without any problem, but you can hardly enjoy the music. Therefore, in the last 10 years, more “cooler” codecs have been developed, which transmit sound better.

AptX is perhaps the most qualitative leap after SBC. And while its bit rates are comparable (~ 300 kbps), AptX squeezes sound less harshly, so music in plugs or inexpensive headphones will often sound even better than when the same headphones are connected with a cable to a smartphone. Unfortunately, on a PC, even with a built-in audio card, the sound through the cable can still be better, although you do need some pretty expensive headphones to tell the difference. Therefore, this codec can be considered a basic level – a sufficient number of users listening to music on streaming services in mp3 with bit rates of 250-320 kbps, such BT sound will suit.

AptX LL – Same AptX, but with low latency (low latency). If conventional wireless codecs have a delay of 100-200 ms, here it is below 40 ms, which is important in games. However, in reality, it all largely depends on both your device and the headphones: for example, personally, I do not feel the audio lag in AptX HD in games.
AptX HD is an improved version of AptX with a bit rate almost double (576 kbps). But this is still a lossy transmission of sound, although much less than in the case of previous codecs. As a result, if you listen to music on Spotify, Apple Music, and other services, the sound quality will be indistinguishable from cable or even better if you have high-quality headphones with a good DAC inside. But if you prefer lossless and, most likely, have special equipment to listen to it, unfortunately the cable here will still be noticeably better.

LDAC is Sony’s highest quality codec (available for free on Android 8.0 and above). It has three levels of bitrate: 330, 660 and 990 kbps. The former is similar in quality to AptX, so there is no point in considering it. The second works roughly at the level of Aptx HD. But the third, perhaps the most interesting: it is obvious that for music from streaming services this is excessive, but this is almost the only codec that allows you to transfer without loss with almost no loss of quality. However, problems are already emerging with the stability of transferring music with such a high bit rate; in other words, already behind a wall of the fountain, you will be haunted by the constant stuttering of sound.

LHDC is an analog of Huawei’s LDAC, it has a bit rate of 900 kbps, while only this company’s smartphones and some headphones support it. As a result, in terms of quality, it should work at the LDAC level, but in practice you most likely won’t find it anywhere.
AAC is the only high-quality codec supported by iPhone. Not having the highest bit rate of 256 kbit / s allows you to get quality sound somewhere between AptX and AptX HD due to this being the only psychoacoustic codec between them.

Reasons why Bluetooth can reduce sound quality

Reasons why Bluetooth can reduce sound quality

Bluetooth audio

While Bluetooth technology offers an easy way to listen to wireless audio through speakers and headphones, some people are opposed to Bluetooth because in terms of audio fidelity it is better to choose one of the Wi-Fi based wireless technologies such as AirPlay, DLNA , Play-Fi or Sonos. … While this understanding is generally correct, there is more to using Bluetooth than meets the eye.

audio Bluetooth

A little about Bluetooth technology

Bluetooth was not originally created for audio entertainment, but rather to connect speakerphone and phone headsets. It has also been designed with a very narrow bandwidth, which forces data compression to be applied to the audio signal. While this format may be ideal for phone calls, it is not ideal for playing music. Additionally, Bluetooth can apply this compression over existing data compression, such as digital audio files or sources streamed over the Internet.

Bluetooth 5.0 standard – a new level of wireless communication

But one important thing to keep in mind is that the Bluetooth system should not apply this additional compression. That’s why:

All Bluetooth devices must support low complexity subband encoding. However, Bluetooth devices can also support additional codecs, which can be found in the Bluetooth Advanced Audio Distribution Profile specification. Additional codecs listed: MPEG 1 and 2 Audio, MPEG 3 and 4, ATRAC and aptX.

In fact, the familiar MP3 format is MPEG-1 Layer 3, so MP3 is included in the specification as an additional codec.

Additional Bluetooth codecs

The official Bluetooth standard in section 4.2.2 states: “The device can also support additional codecs to maximize usability. When both SRC and SNK support the same subcode, that codec can be used instead of the required codec. ”

In this document, SRC refers to the source device and SNK refers to the destination (or receiver) device. So the source would be your smartphone, tablet, or computer, and the receiver would be your bluetooth speaker, headset, or receiver.

By design, Bluetooth does not necessarily add additional data compression to material that is already compressed. If both the source and receiver devices support the codec used to encode the original audio signal, the audio can be transmitted and received without change. So if you are listening to MP3 or AAC files that you have saved on your smartphone, tablet, or computer, Bluetooth should not degrade the sound quality if both devices support this format.

This rule also applies to Internet radio and music streaming services that are encoded in MP3 or AAC format, which covers most of what is available today. However, some music services are experimenting with other formats, for example Spotify uses the Ogg Vorbis codec.

According to the Bluetooth SIG, the organization that licenses Bluetooth, compression remains the norm for now. This is mainly due to the fact that the phone has to transmit not only music, but also calls and other notifications related to calls. However, there is no reason why a manufacturer cannot switch from SBC compression to MP3 or AAC if it supports the Bluetooth receiver. This will apply compression to the notifications, but the original MP3 or AAC files will be transmitted without modification.

What about aptX

The quality of stereo sound transmitted via Bluetooth has improved over time. The current aptX codec, which is marketed as an upgrade to the mandatory SBC codec, provides CD-like audio quality via Bluetooth wireless technology.

Just remember that both your Bluetooth source and receiver need to support the aptX codec in order to benefit. However, if you are playing MP3 or AAC material, it is best if the manufacturer uses the proprietary format of the original audio file without additional transcoding via aptX or SBC.

Bluetooth 5.0: new power saving mode

Most Bluetooth audio devices are not made by companies whose employees wear their brand on their chest, but by an original design that you have never heard of. And the Bluetooth receiver used in the audio product was probably not made by ODM, but by another manufacturer. The more complex a digital product is and the more engineers work on it, the more likely it is that no one knows everything about what is actually going on inside the device. One format can easily be transcoded to another and you will never know, because hardly any Bluetooth receiver will tell you what the incoming format is.

WHAT IMPACT DOES BLUETOOTH HAVE ON THE AUDIO QUALITY?

Bluetooth Audio

A must-have brief on Bluetooth, from the basics to daily practice in audio land, was posted on HiFi.nl this summer. That raised a number of questions for readers, which, in short, are almost the same: “Great, that wireless connection, but what is left of the quality of the source file when you send audio over Bluetooth?”

Bluetooth Audio

We know that since the introduction of the current standard in the field of wireless connection, things have evolved considerably. While Bluetooth was never primarily intended to send or receive audio signals, but rather to allow hardware like the mouse and keyboard to communicate with each other, quite a few steps have been taken to exploit and enhance those capabilities. Consider Bluetooth version 4.0 and the arrival of the now-familiar aptX codec. However, the transfer is not (yet) loss-free. Is the quality of the source file sufficiently preserved with a wireless connection via Bluetooth? In other words, does it make sense to play FLAC instead of MP3, for example if you use Bluetooth to send the music to your speaker?

Codecs

The wired versus wireless discussion will likely always persist. After all, there are numerous hi-fi manufacturers that specialize in audio cables and tell a very good story about it (and besides, of course, there’s the good digital cable twist). When talking specifically about wireless audio over Bluetooth, there is always the element of compression. Due to the limited bandwidth of the connection, by definition there will be data compression and therefore loss of quality. (Not to mention, Bluetooth operates within the 2.4Ghz frequency that many other equipment in the house are also ‘connected’ to.)

aptX

The algorithm used also depends on the codecs supported by both the sender and the receiver. The only one that always works is low complexity subband encoding, or SBC. SBC is still used if, for example, the smartphone supports aptX, but the headphones do not; is the backup option. aptX, which has already done a lot to limit compromise, is certainly not the official standard and is still quite rare, regardless of the fact that there are so many different variants of su. What aptX also does exactly to ensure the ‘lossless CD quality’ of the connection is known only to the creator CSR and owner Qualcomm (you know, the American telecom giant), and their interpretation is, at best of the cases, vague. to name. In any case, the transport of audio data is still dependent on the bandwidth of the connection, which does not have the lossless qualities of transmission over optical cables, for example. The essence: With Bluetooth audio streaming, the audio stream is encoded with a lossy algorithm. After all, Bluetooth has insufficient bandwidth for lossless, let alone high resolution.

“It is always recommended to work with lossless FLAC or ALAC files”

Now what?

Well then there is loss of audio quality. And it’s no secret that hi-fi enthusiasts aren’t fans of compression. However, is the commitment so present that there is as much to horrify as with MP3? No, because thanks to innovations in the quality and bandwidth of a Bluetooth connection, much is being done to minimize the audible effect of compression, as this study shows between SBC, the younger aptX, and 320 mp3 Kbps. So the question is whether it can still be heard in an a / b test with, for example, optical cabling as an alternative. However, the main question is whether an a / b test with different source files via Bluetooth has any effect. The answer is really simple: do you prefer the loss of a good file or a less good file? After all: the better the source, given the (for the moment) inevitable but increasingly marginal loss of quality via Bluetooth, the better the end result. So it is always wise to work with lossless FLAC or ALAC files, because no matter what happens behind the scenes with Bluetooth streaming, you certainly won’t have to deal with double lossy compression, which is always a downside.

Finally, you have to put the Bluetooth app in perspective. After all, for many seasoned audiophiles, the above won’t be a discussion at all, for the simple reason that the listening room isn’t set up for an audio connection via Bluetooth (“Wired! Wired! “). Therefore, the use depends on the circumstances.

Compressed audio with loss

Compressed audio with loss

Today we will analyze the audio files that have a loss of quality. Because digital audio files can be divided into two classes, those that are compressed suffer a loss of quality and those that have not had any loss.
The difference We will see later but for now we will be clear that each of the formats offers a different quality according to the algorithm that has been used to compress the music in order to save space on the hard disk.
Some definitely discard information which is normally sought to be inaudible information for the human ear or to be repetitive information, so even when information is discarded, quality is not lost.

Compressed digital sound files fall into two categories: those that have suffered lossy compression and those that have not.

Loss compression means that an algorithm that uses a smaller amount of information has been used. The resulting file differs from the original.

MP3 or MPEG1 Audio Layer 3

It is the most widespread and used compression format, in its various variants. The loss of information that involves the mp3 format passes (almost) unnoticed to the human ear.

An mp3 file can occupy up to 15 times less than its original while retaining high quality. This is why the standard for streaming is considered and is the most suitable type of file for use on the internet and for portable media.

WMA or Windows Media Audio

WMA is the Microsoft audio compression format. It was designed for playback with the Windows Media Player program.

WMA is the direct competitor in mp3 quality and compression with the difference that it adds author information. Its extension is * .wma.

Recently, Microsoft has developed a variant of the WMA format with compression, but without loss.

OGG Vorbis

Ogg Vorbis is a container format developed in open source, freely distributed and without a patent. This is the biggest difference with the rest of compressed audio files.

Files in this format have a high quality and can be played on almost any device. Its use is much less widespread than the previous ones, although, in some cases, it gives better results.

Its use is patent free. Therefore, many media players, such as the popular VLC, include Ogg codecs that, on the other hand, can be freely downloaded from the Xiph.org website. Its extension is * .ogg.