Skip to main content

Topic: ABX testing lossy compressed audio over Bluetooth (Read 2743 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
ABX testing lossy compressed audio over Bluetooth
I had always been under the assumption, that recompressing lossy audio using another codec would cause noticeable artifacts that could be picked up in an ABX test.  This belief came from reading various forum posts over the years (as well as the big warning foobar2000 pops up about converting from one lossy format to another.

So, with the knowledge of lossy music transparency, I set out to ABX lossy vs lossles music over Bluetooth.

Here's how I set things up.

I bought one of these:  http://www.xmpow.com/car-accessories/car-stereo-receiver/mpow-streambot-mini-bluetooth-4-0-receiver-a2dp-wireless-adapter-mbr4.html

I charged it up, paired with my laptop, plugged my headphones into it and decided to ABX some tracks.

I took a FLAC, and converted it to MP3 and AAC.  In the middle of this ABX test, I realized that A2DP compresses audio, since Bluetooth bandwith is limited, and some Bluetooth chips have AAC and MP3 encoding/decoding in them.  So I was concerned that my adapter was passing through the AAC or MP3 file without recompressing it.  The specs for this device do not say what codecs it supports natively, so I didn't think I could do a valid test using either of these files.

So, I decided to make an ogg file, at 256K, since I don't know of any Bluetooth chip that natively supports Ogg Vorbis.

I then proceeded to ABX the original FLAC and the Ogg Vorbis file, under the belief that both files will get compressed using SBC or any other codec supported by the chip.

I did an ABX on one file and came up with this result:

Code: [Select]
foo_abx 2.0.2 report
foobar2000 v1.3.10
2016-11-20 00:12:52

File A: 01 Cracklin' Rosie.flac
SHA1: 02c014523ef42f869952be67b8c445abeaadbfc4
Gain adjustment: -2.18 dB
File B: 01 Cracklin' Rosie.ogg
SHA1: b3fdaa425e02a7fafaa6621ee47c9da406f74a7e
Gain adjustment: -2.17 dB

Output:
DS : Primary Sound Driver
Crossfading: NO

00:12:52 : Test started.
00:13:46 : 01/01
00:14:28 : 02/02
00:14:51 : 02/03
00:15:19 : 03/04
00:16:09 : 03/05
00:16:29 : 03/06
00:16:50 : 03/07
00:17:07 : 04/08
00:17:07 : Test finished.

 ----------
Total: 4/8
Probability that you were guessing: 63.7%

 -- signature --
4478484a14daa7e38bf82fe0c496ae0e8714fa5e

So, it appears compressing a lossy file once isn't nearly as big a deal as the Internet made it out to be.

Does anyone see any flaws with what I did here, other than not listening to every track all the way through?

If someone can recommend a song that would be more likely to produce artifacts when recompressed, I'd be more than willing to try it.


  • klaberte
  • [*]
Re: ABX testing lossy compressed audio over Bluetooth
Reply #1
One of two things are likely:

1. That you will find that ogg 256 is transparent to you, i.e. if you abx the ogg256 and flac file, you will not be able to differentiate, or
2. The reduction in quality due to the second bluetooth codec swamps any reduction in quality introduced by the first codec (ogg256).

In general, I do not think it is true that a chaining of two codecs always produces horrible results. 

  • gorman
  • [*][*]
Re: ABX testing lossy compressed audio over Bluetooth
Reply #2
From what I've read on HA in the past few years, I think transcoding is really bad when starting from a low bitrate already compressed file. If you start from a high bitrate one (in your case 256kbps Vorbis), results could be acceptable for casual listening.

Re: ABX testing lossy compressed audio over Bluetooth
Reply #3
From what I've read on HA in the past few years, I think transcoding is really bad when starting from a low bitrate already compressed file. If you start from a high bitrate one (in your case 256kbps Vorbis), results could be acceptable for casual listening.

I wonder if it may be a combination of codec and bitrate.  I have a pair of Bluetooth headphones I was given, and using them via Bluetooth is just horrendous.  Over a aux cable they are more acceptable.  The difference between bluetooth and cable is like the difference between AM and FM radio.

When the codec negotiation happens, I wonder if a bitrate is negotiated also, and my 256K Ogg file is being transcoded to a 128K SBC file or worse on these headphones.  I would think the codec needs to go lower than 128K in order to sound like AM radio.

  • 16 Hz
  • [*]
Re: ABX testing lossy compressed audio over Bluetooth
Reply #4
I think the situation is more complex, because there are many different codecs available for Bluetooth, and which one is actually used depends on both devices capabilities.
This is an article that explains briefly the different options (I wasn't able to find a better source):
https://www.lifewire.com/what-to-know-about-bluetooth-3134591

Re: ABX testing lossy compressed audio over Bluetooth
Reply #5
That's a pretty good link except for the BS about Apt-X.  Apt-X is a 4:1 lossy compression codec that should be no different than 256K AAC or MP3.  The only thing Apt-X has going for it over MP3 or AAC is lower latency, so audio and video stay in sync.

  • AiZ
  • [*][*]
Re: ABX testing lossy compressed audio over Bluetooth
Reply #6
AiZ stupid homepage - http://aiz.free.fr

  • AiZ
  • [*][*]
Re: ABX testing lossy compressed audio over Bluetooth
Reply #7
Hi,

You can now (try to) ABX aptX more easily:
https://github.com/FFmpeg/FFmpeg/commit/a337b36b8bd68cacd0e8903c0b26420cb30fbee8

Tested with latest Zeranoe builds, 44100 encoded content wrongly identified as 48000 when decoding, decoded WAV header fixed with Header Investigator.

    AiZ
AiZ stupid homepage - http://aiz.free.fr

Re: ABX testing lossy compressed audio over Bluetooth
Reply #8
Hi,

You can now (try to) ABX aptX more easily:
https://github.com/FFmpeg/FFmpeg/commit/a337b36b8bd68cacd0e8903c0b26420cb30fbee8

Tested with latest Zeranoe builds, 44100 encoded content wrongly identified as 48000 when decoding, decoded WAV header fixed with Header Investigator.

    AiZ

Is there even a need?  If 256K Ogg Vorbis and AAC is transparent to me, I don't see how I am going to get any improvement with AptX.

  • AiZ
  • [*][*]
Re: ABX testing lossy compressed audio over Bluetooth
Reply #9
Hello,

Sorry, I should have been more explicit. It was 2:00 AM when I posted my last message, so...

To me, anyone can now finely tune their lossy encodes for Bluetooth usage.

You take your original FLAC/WAV, encode to MP3/OGG/AAC/Opus/whatever, then encode to A2DP/SBC with the bitpool corresponding to your Bluetooth device or aptX if it supports it and eventually decode back to WAV, in order to ABX with the original. I suppose here that these ABX sessions will be done in a quiet environment, using "good/better" hardware, i.e. in conditions way more favourable to detect artefacts than a noisy, crowded, urban landscape which will help masking the defects.

After that, you know that residual problems will (almost) only came from the DAC and/or amplifier of your Bluetooth receiver.

Have a nice day,

    AiZ




AiZ stupid homepage - http://aiz.free.fr

Re: ABX testing lossy compressed audio over Bluetooth
Reply #10
Hello,

Sorry, I should have been more explicit. It was 2:00 AM when I posted my last message, so...

To me, anyone can now finely tune their lossy encodes for Bluetooth usage.

You take your original FLAC/WAV, encode to MP3/OGG/AAC/Opus/whatever, then encode to A2DP/SBC with the bitpool corresponding to your Bluetooth device or aptX if it supports it and eventually decode back to WAV, in order to ABX with the original. I suppose here that these ABX sessions will be done in a quiet environment, using "good/better" hardware, i.e. in conditions way more favourable to detect artefacts than a noisy, crowded, urban landscape which will help masking the defects.

After that, you know that residual problems will (almost) only came from the DAC and/or amplifier of your Bluetooth receiver.

Have a nice day,

    AiZ






Ok, now I get it.

  • 2Bdecided
  • [*][*][*][*][*]
  • Developer
Re: ABX testing lossy compressed audio over Bluetooth
Reply #11
You should remember that the sounds which cause problems for A2DP/SBC could be different from those which cause problems for mp3 or AAC encoders. Hence you'll have to look for different "problem samples" if you want to push A2DP/SBC to sound as bad as possible.

Cheers,
David.

  • krabapple
  • [*][*][*][*][*]
Re: ABX testing lossy compressed audio over Bluetooth
Reply #12
One of two things are likely:

1. That you will find that ogg 256 is transparent to you, i.e. if you abx the ogg256 and flac file, you will not be able to differentiate, or
2. The reduction in quality due to the second bluetooth codec swamps any reduction in quality introduced by the first codec (ogg256).

In general, I do not think it is true that a chaining of two codecs always produces horrible results.


I don't think anyone here has ever claimed it will necessarily produce 'horrible results'.  It is mainly a caution against starting from low/borderline 'transparent' bitrate encodes and transcoding to low/borderline bitrate. Or against multiple rounds of re-encoding.