Skip to contentSkip to conversation

REALLY Bad encoding performance of Linux SBC audio codec

Bluez-devel Christian Hoene 5 participants 10 messages Oct 30, 2008 – Oct 31, 2008 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hello Frans,

thank you for the patch!!

Christian

From: Frans de Bont [mailto:[email protected]]
Sent: Thursday, October 30, 2008 2:34 PM
To: Christian Hoene
Subject: RE: [Bluez-devel] REALLY Bad encoding performance of Linux SBC audio codec

Hello Christian,

I had a quick look into the bluez sbc decoder test application. I discovered that the buffering was not correct. Attached a modified version.

Please note that the output level of the decoder is still 6 dB too low. This wouldn't be too difficult to fix for the bluez developers.

Best regards,
Frans

"Christian Hoene" <[email protected]>

2008-10-29 04:30 PM

To

"'BlueZ development'" <[email protected]>

cc

Frans de Bont/EHV/APPTECH/PHILIPS@PHILIPS

Subject

RE: [Bluez-devel] REALLY Bad encoding performance of Linux SBC audio
codec

Classification

Hello,

Sorry Bad news.
the encoding and decodng performance of bluez's SBC is really bad. I just used the latest sbcenc program from bluez-4.17 and compared it to the reference

Attached you will find wav-files encoded with the Bluetooth reference implementation and bluez

Filelist
========
compare.sh is the scrip that I use to compare both
codec
versions

refsop01.wav        the original sample
tmp.ref.sbc         with reference encoded
tmp.bluez.sbc       with bluez encoded
tmp.ref.sw.wav      with reference encoded and decoded (has good quality)
tmp.bluez.sw.wav    with bluez encoded and decoded (has bad quality ODG=)

tmp.refbluez.sw.wav with reference encoded and with bluez decoded (has bad quality)
tmp.bluezref.sw.wav with bluez encoded and with reference decoded (has medium quality)

Both the bluez encoder and decoder do not work as good as the reference implementation.

I also conducted some perceptual audio tests with ITU BS.1387 (PEAQ), which confirm these results.

With best regards,

Christian

PS:
Attached also an enhanced version for sbc/sbcenc.c, which considers more command line options.

Quoted 28 lines

-----Original Message-----
From: Marcel Holtmann [mailto:[email protected]]
Sent: Monday, October 27, 2008 8:42 PM
To: BlueZ development
Subject: Re: [Bluez-devel] Bad encoding performance of Linux SBC audio codec

Hi Brad,

Quoted 1 line
Quoted 1 line

I am sorry to say that the audio quality of the open source version

of SBC

Quoted 3 lines
Quoted 1 line

is far worse than the reference implementation.

If you are using the standalone "sbc" project at sourceforge, then

you

Quoted 3 lines

should try the version inside bluez. The standalone used to simply be slower, but we identified & fixed some quality issues too that should be backported.

the standalone version should not be used at all at the moment. All efforts should go into the version included in bluez-4.x.tar.gz.

Regards

Marcel

Quoted 13 lines

-----------------------------------------------------------------------
--
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

[attachment "sbcenc.c" deleted by Frans de Bont/EHV/APPTECH/PHILIPS] [attachment "compare.tar.gz" deleted by Frans de Bont/EHV/APPTECH/PHILIPS]

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw

Hello,

the sound quality got better. Still, both encoder and decoder are not as good as the reference.

For example, not the audio quality measured with ODB(BV) is

Algorithm
ODG(BV)
In0Filename
In1Filename
PEAQBasic

             -1.99
ref.wav
tmp.bluez.wav
PEAQBasic
              -1.5
ref.wav
tmp.bluezref.wav
PEAQBasic
             -0.82
ref.wav
tmp.refbluez.wav
PEAQBasic
             -0.44

ref.wav
tmp.ref.wav

If I use the simple perceptual model of the reference implementation (option -p), the encoding quality get even better.

Algorithm
ODG(BV)
In0Filename
In1Filename
PEAQBasic

             -1.99
ref.wav
tmp.bluez.wav
PEAQBasic
              -1.5
ref.wav
tmp.bluezref.wav
PEAQBasic
             -0.55
ref.wav
tmp.refbluez.wav
PEAQBasic
             -0.17

ref.wav
tmp.ref.wav

Here the old values before Frans's patch

Algorithm
ODG(BV)
In0Filename
In1Filename
PEAQBasic

              -1.5
ref.wav
tmp.bluezref.sw.wav
PEAQBasic
             -3.89
ref.wav
tmp.bluez.sw.wav
PEAQBasic
             -3.88
ref.wav
tmp.refbluez.sw.wav
PEAQBasic
             -0.44

ref.wav
tmp.ref.sw.wav

Greetings

Christian

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Could you please send it as a real patch, I mean in diff format, or even better if you could configure a git repository so we could pull from.

Thank you for the contribution.

-- =

Luiz Augusto von Dentz
Engenheiro de Computa=E7=E3o

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great priz= es
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw
Quoted 5 lines · Luiz Augusto von Dentz

Could you please send it as a real patch, I mean in diff format, or even better if you could configure a git repository so we could pull from.

Thank you for the contribution.

patch is attached.

sbc/sbcdec.c +4 -4
index 555ace5..2464c42 100644
@@ -157,7 +157,7 @@ static void decode(char *filename, char *output, int tofile)
 		}
 	}
 
-	count = 0;
+	count = len;
 	while (framelen > 0) {
 		/* we have completed an sbc_decode at this point sbc.len is the
 		 * length of the frame we just decoded count is the number of
@@ -179,15 +179,15 @@ static void decode(char *filename, char *output, int tofile)
 			exit(1);
 		}
 
-		/* increase the count */
-		count += len;
-
 		/* push the pointer in the file forward to the next bit to be
 		 * decoded tell the decoder to decode up to the remaining
 		 * length of the file (!) */
 		pos += framelen;
 		framelen = sbc_decode(&sbc, stream + pos, streamlen - pos,
 					buf + count, sizeof(buf) - count, &len);
+
+		/* increase the count */
+		count += len;
 	}
 
 	if (count > 0) {

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#4 lore raw

Hi Christian,

Quoted 7 lines
Quoted 5 lines

Could you please send it as a real patch, I mean in diff format, or even better if you could configure a git repository so we could pull from.

Thank you for the contribution.

patch is attached.

patch has been applied. Thanks.

Regards

Marcel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#5 lore raw
In reply to Christian Hoene

Hi Christian,

Quoted 3 lines

the sound quality got better. Still, both encoder and decoder are not as
good as the reference.

so we do have the sbctester utility in the source code that should be able to be used for the SBC conformance testing according to the A2DP qualification.

Regards

Marcel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#6 lore raw
In reply to Christian Hoene

Christian

Quoted 2 lines

the sound quality got better. Still, both encoder and decoder are not as good as the reference.

It would be ideal to have automated tests for codec quality that don't require windows and that we could run before commits to track our progress. We could prepare some encoding/decoding samples with the reference codec and store them in the project or somewhere online. The one test we couldn't do this way is to encode with our codec and decode with the reference.

Are there free tools for checking the quality and for comparing signal/noise and overall volume? If you can detail the process you use that would help.

thanks
Brad

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#7 lore raw

Hello Brad,

Quoted 3 lines

It would be ideal to have automated tests for codec quality that don't require windows and that we could run before commits to track our progress.

Wine will be needed for the reference implementation, which is only available for Windows.

Quoted 8 lines

We could prepare some encoding/decoding samples with the reference codec and store them in the project or somewhere online. The one test we couldn't do this way is to encode with our codec and decode with the reference.

Are there free tools for checking the quality and for comparing signal/noise and overall volume? If you can detail the process you use that would help.

Currently, I use PEAQ, which is quite expensive (6000 EUR). It provides you will a couple of parameters regarding the audio quality. I am not aware of a good open source implementation of PEAQ.

Christian

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#8 lore raw

Christian Hoene wrote:
..deleted

Quoted 3 lines
Quoted 3 lines

Are there free tools for checking the quality and for comparing signal/noise and overall volume? If you can detail the process you use that would help.

The Open Source NetPBM tool pnmpsnr contains some simple code for =

calculating the SNR between two graphic images. Doing the same for audio =

should be quite simple.

Craig
-- =

-----------------------------------------------------------------------
Craig Southeren Post Increment =96 VoIP Consulting and Software
[email protected] www.postincrement.com.au

  Phone:  +61 243654666      ICQ: #86852844
  Fax:    +61 243656905      MSN: [email protected]
  Mobile: +61 417231046      Jabber: [email protected]

"Science is the poetry of reality." Richard Dawkins

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great priz= es
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#9 lore raw
In reply to Christian Hoene

Hi Christian,

Quoted 7 lines
Quoted 4 lines

It would be ideal to have automated tests for codec quality that don't
require windows and that we could run before commits to track our progress.

Wine will be needed for the reference implementation, which is only available for Windows.

with the exception that the reference encoder will run into a busy loop for the first two test samples of the encoding conformance testing.

Quoted 11 lines
Quoted 10 lines

We could prepare some encoding/decoding samples with the reference codec and store them in the project or somewhere online. The
one test we couldn't do this way is to encode with our codec and decode with the reference.

Are there free tools for checking the quality and for comparing signal/noise and overall volume? If you can detail the process you use
that would help.

Quoted 5 lines

Currently, I use PEAQ, which is quite expensive (6000 EUR). It provides you
will a couple of parameters regarding the audio quality. I am not aware of a
good open source implementation of PEAQ.

Please look at our sbctester tool. It should do the right thing.

Regards

Marcel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel