All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-users] Play received A2DP data
@ 2006-08-31 10:19 Frank Heimbaecher
  2006-08-31 11:37 ` Manuel Bernhardt
  2006-12-15 13:28 ` [Bluez-users] How to use sbc.c of btsco? Frank Heimbächer
  0 siblings, 2 replies; 16+ messages in thread
From: Frank Heimbaecher @ 2006-08-31 10:19 UTC (permalink / raw)
  To: bluez-users

Dear community

I have a bit of experience with Bluetooth, but almost none with Audio
streaming. Maybe somebody could give me some useful hints, URLs or
HowTos to help me to get on.

My programming task: Receive audio stream from A2DP, decode it and play
it. Reception of A2DP stream is ok for me, decoding should work with
sbc, but there is still the problem how to get the data to the sound
card. So far I thought I need a sound driver for A2DP, as a kernel
module and call open, ioctl and write via snd_hwdep routines. Is that right?

Thanks for help
Frank

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-users] Play received A2DP data
  2006-08-31 10:19 [Bluez-users] Play received A2DP data Frank Heimbaecher
@ 2006-08-31 11:37 ` Manuel Bernhardt
  2006-08-31 13:05   ` Brad Midgley
  2006-12-15 13:28 ` [Bluez-users] How to use sbc.c of btsco? Frank Heimbächer
  1 sibling, 1 reply; 16+ messages in thread
From: Manuel Bernhardt @ 2006-08-31 11:37 UTC (permalink / raw)
  To: bluez-users

Hi Frank,

> My programming task: Receive audio stream from A2DP, decode it and play
> it. Reception of A2DP stream is ok for me, decoding should work with
> sbc, but there is still the problem how to get the data to the sound
> card. So far I thought I need a sound driver for A2DP, as a kernel
> module and call open, ioctl and write via snd_hwdep routines. Is that
> right?

maybe http://bluetooth-alsa.sourceforge.net/ is that what are you looking
for?

Manuel



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-users] Play received A2DP data
  2006-08-31 11:37 ` Manuel Bernhardt
@ 2006-08-31 13:05   ` Brad Midgley
  0 siblings, 0 replies; 16+ messages in thread
From: Brad Midgley @ 2006-08-31 13:05 UTC (permalink / raw)
  To: BlueZ users

Guys

>> My programming task: Receive audio stream from A2DP, decode it and play
>> it.
> 
> maybe http://bluetooth-alsa.sourceforge.net/ is that what are you looking
> for?

right... see the a2recv app in btsco

brad

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bluez-users] How to use sbc.c of btsco?
  2006-08-31 10:19 [Bluez-users] Play received A2DP data Frank Heimbaecher
  2006-08-31 11:37 ` Manuel Bernhardt
@ 2006-12-15 13:28 ` Frank Heimbächer
  2006-12-16  7:28   ` [Bluez-devel] " Brad Midgley
  1 sibling, 1 reply; 16+ messages in thread
From: Frank Heimbächer @ 2006-12-15 13:28 UTC (permalink / raw)
  To: bluez-users

Dear community

I want to use the codec implemented in sbc.c in btsco. Is there a chance
to get a documentation of the code? I understand so much that you call
sbc_init() first, sbc_finish() at the end, and use sbc_decode() and
sbc_encode() for converting.

sbc_encode: It seems like you put pcm data on 'data' and get sbc data in
 'sbc.data'. 'count' is not used in the function. How often must I call
it? How do I know how much of 'data' is converted already?

sbc_decode: Put sbc data on 'data' and you get pcm data in 'sbc.m.data'.
Is that right? Must I always change the byte order like it is done in
a2recv.c?

Are there special things to do if I have a .wav file or do I just have
to call the functions? I am just talking of the payload and not the headers.

It would help me a lot if somebody could put me on the right track.

Thanks a lot
Frank


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-devel] [Bluez-users] How to use sbc.c of btsco?
  2006-12-15 13:28 ` [Bluez-users] How to use sbc.c of btsco? Frank Heimbächer
@ 2006-12-16  7:28   ` Brad Midgley
  2006-12-19 11:43     ` [Bluez-devel] How to use sbc.c ? Frank Heimbächer
  0 siblings, 1 reply; 16+ messages in thread
From: Brad Midgley @ 2006-12-16  7:28 UTC (permalink / raw)
  To: BlueZ development; +Cc: frank.heimbaecher

Frank

fyi, I moved the reply to bluez-devel.

> sbc_encode: It seems like you put pcm data on 'data' and get sbc data in
>  'sbc.data'. 'count' is not used in the function. How often must I call
> it? How do I know how much of 'data' is converted already?

the return value from sbc_encode is the number of bytes consumed. It's 
true that count is not used properly. In fact we assume there is enough 
data there to fill one sbc frame.

> sbc_decode: Put sbc data on 'data' and you get pcm data in 'sbc.m.data'.
> Is that right? Must I always change the byte order like it is done in
> a2recv.c?

The swapping was to accommodate bugs in the audio driver's endian 
processing on gumstix. You can ignore it.

> Are there special things to do if I have a .wav file or do I just have
> to call the functions? I am just talking of the payload and not the headers.

be sure you init the encoder with the correct channels (1 or 2) and 
sample rate. after that just be sure to pass enough data to sbc_encode 
in each pass so it doesn't underrun.

> It would help me a lot if somebody could put me on the right track.

Be sure you are using the separate sbc sourceforge project since that's 
the version of the codec we are maintaining. Finally, we'd appreciate 
any patches you come up with to improve the code documentation or even 
more if you address any of the limitations. Documentation of course is a 
problem, but there's also a todo list at the top of sbc.c.

Brad

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bluez-devel] How to use sbc.c ?
  2006-12-16  7:28   ` [Bluez-devel] " Brad Midgley
@ 2006-12-19 11:43     ` Frank Heimbächer
  2006-12-19 22:17       ` Brad Midgley
  2006-12-22 12:07       ` [Bluez-devel] " Frank Heimbaecher
  0 siblings, 2 replies; 16+ messages in thread
From: Frank Heimbächer @ 2006-12-19 11:43 UTC (permalink / raw)
  To: BlueZ development

Thanks a lot, Brad.

What succeeded: With an older version of sbc.c I managed to encode a wav
file, send it over the air and receive it, decode it and write it in a
file. Well, it looks different than the original. In the original there
is some information in the first bytes like: "WAVEfmt", a long area with
zero bytes, then the characters "data" and then the data seems to begin.
I do not find this in my received file. Is there something else I have
to care about? Should I run sbcinfo and change sbc_init() according to
the results?

The newest download of sbc.c from http://sbc.cvs.sourceforge.net/sbc/
under menu "CVS Browse" contains a simple bug, which lets the file
compile, but crash on runtime: In function _sbc_analyze_eight() the
array 't[8]' is referenced from t[1] to t[8], instead of t[0] to t[7].

Thanks a lot
Frank

Brad Midgley schrieb:
> Frank
> 
> fyi, I moved the reply to bluez-devel.
> 
>> sbc_encode: It seems like you put pcm data on 'data' and get sbc data in
>>  'sbc.data'. 'count' is not used in the function. How often must I call
>> it? How do I know how much of 'data' is converted already?
> 
> the return value from sbc_encode is the number of bytes consumed. It's
> true that count is not used properly. In fact we assume there is enough
> data there to fill one sbc frame.
> 
>> sbc_decode: Put sbc data on 'data' and you get pcm data in 'sbc.m.data'.
>> Is that right? Must I always change the byte order like it is done in
>> a2recv.c?
> 
> The swapping was to accommodate bugs in the audio driver's endian
> processing on gumstix. You can ignore it.
> 
>> Are there special things to do if I have a .wav file or do I just have
>> to call the functions? I am just talking of the payload and not the
>> headers.
> 
> be sure you init the encoder with the correct channels (1 or 2) and
> sample rate. after that just be sure to pass enough data to sbc_encode
> in each pass so it doesn't underrun.
> 
>> It would help me a lot if somebody could put me on the right track.
> 
> Be sure you are using the separate sbc sourceforge project since that's
> the version of the codec we are maintaining. Finally, we'd appreciate
> any patches you come up with to improve the code documentation or even
> more if you address any of the limitations. Documentation of course is a
> problem, but there's also a todo list at the top of sbc.c.
> 
> Brad

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-devel] How to use sbc.c ?
  2006-12-19 11:43     ` [Bluez-devel] How to use sbc.c ? Frank Heimbächer
@ 2006-12-19 22:17       ` Brad Midgley
  2006-12-20 13:14         ` Frédéric DALLEAU
  2006-12-22 12:07       ` [Bluez-devel] " Frank Heimbaecher
  1 sibling, 1 reply; 16+ messages in thread
From: Brad Midgley @ 2006-12-19 22:17 UTC (permalink / raw)
  To: BlueZ development

Frank

> What succeeded: With an older version of sbc.c I managed to encode a wav
> file, send it over the air and receive it, decode it and write it in a
> file. Well, it looks different than the original. In the original there
> is some information in the first bytes like: "WAVEfmt", a long area with
> zero bytes, then the characters "data" and then the data seems to begin.
> I do not find this in my received file. Is there something else I have
> to care about? Should I run sbcinfo and change sbc_init() according to
> the results?

there is not a way to send metadata about the original wav over the a2dp
stream. It sounds like you want a way to create a wav from the pcm
received on the other side. You will have to use a conversion utility.

> The newest download of sbc.c from http://sbc.cvs.sourceforge.net/sbc/
> under menu "CVS Browse" contains a simple bug, which lets the file
> compile, but crash on runtime: In function _sbc_analyze_eight() the
> array 't[8]' is referenced from t[1] to t[8], instead of t[0] to t[7].

fixed. thanks.

Brad

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-devel] How to use sbc.c ?
  2006-12-19 22:17       ` Brad Midgley
@ 2006-12-20 13:14         ` Frédéric DALLEAU
  2007-01-10 20:32           ` Brad Midgley
  0 siblings, 1 reply; 16+ messages in thread
From: Frédéric DALLEAU @ 2006-12-20 13:14 UTC (permalink / raw)
  To: BlueZ development

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

Brad,
>   
>> The newest download of sbc.c from http://sbc.cvs.sourceforge.net/sbc/
>> under menu "CVS Browse" contains a simple bug, which lets the file
>> compile, but crash on runtime: In function _sbc_analyze_eight() the
>> array 't[8]' is referenced from t[1] to t[8], instead of t[0] to t[7].
>>     
>
> fixed. thanks.
>   
some values were missed so the sound is now larsenized ;)
patch attached.

BTW, I was looking for the tables specially Proto_4_40 and Proto_8_80 
from a2dp specifications.
I suspect they are stored in sbc_proto_8_80m0 and sbc_proto_8_80m1.
The values are not the same that in the spec. Do you know why?

-- 
Frederic

Without the wind, the grass does not move.


[-- Attachment #2: sbc.patch --]
[-- Type: text/x-patch, Size: 5623 bytes --]

? Doxyfile
? Makefile
? Makefile.in
? aclocal.m4
? autom4te.cache
? config.guess
? config.h
? config.h.in
? config.log
? config.status
? config.sub
? configure
? debug
? depcomp
? install-sh
? libtool
? ltmain.sh
? missing
? sbc.kdevelop
? sbc.kdevelop.pcs
? sbc.kdevses
? sbc.pc
? stamp-h1
? include/Makefile
? include/Makefile.in
? lib/.deps
? lib/.libs
? lib/Makefile
? lib/Makefile.in
? lib/libsbc.la
? lib/sbc.lo
? src/.deps
? src/.libs
? src/Makefile
? src/Makefile.in
? src/sbcinfo
Index: lib/sbc.c
===================================================================
RCS file: /cvsroot/sbc/sbc/lib/sbc.c,v
retrieving revision 1.8
diff -u -r1.8 sbc.c
--- lib/sbc.c	19 Dec 2006 22:13:41 -0000	1.8
+++ lib/sbc.c	20 Dec 2006 12:58:09 -0000
@@ -892,84 +892,84 @@
 	MULA(res, -_sbc_proto_8[21], in[75]);
 	t[7] = SCALE8_STAGE1(res);
 
-	MUL(res, _anamatrix8[0], t[1]);
-	MULA(res, _anamatrix8[7], t[2]);
-	MULA(res, _anamatrix8[2], t[3]);
-	MULA(res, _anamatrix8[3], t[4]);
-	MULA(res, _anamatrix8[6], t[5]);
-	MULA(res, _anamatrix8[4], t[6]);
-	MULA(res, _anamatrix8[1], t[7]);
-	MULA(res, _anamatrix8[5], t[8]);
+	MUL(res, _anamatrix8[0], t[0]);
+	MULA(res, _anamatrix8[7], t[1]);
+	MULA(res, _anamatrix8[2], t[2]);
+	MULA(res, _anamatrix8[3], t[3]);
+	MULA(res, _anamatrix8[6], t[4]);
+	MULA(res, _anamatrix8[4], t[5]);
+	MULA(res, _anamatrix8[1], t[6]);
+	MULA(res, _anamatrix8[5], t[7]);
 	out[0] = SCALE8_STAGE2(res);
 
-	MUL(res, _anamatrix8[1], t[1]);
-	MULA(res, _anamatrix8[7], t[2]);
-	MULA(res, _anamatrix8[3], t[3]);
-	MULA(res, -_anamatrix8[5], t[4]);
-	MULA(res, -_anamatrix8[6], t[5]);
-	MULA(res, -_anamatrix8[2], t[6]);
-	MULA(res, -_anamatrix8[0], t[7]);
-	MULA(res, -_anamatrix8[4], t[8]);
+	MUL(res, _anamatrix8[1], t[0]);
+	MULA(res, _anamatrix8[7], t[1]);
+	MULA(res, _anamatrix8[3], t[2]);
+	MULA(res, -_anamatrix8[5], t[3]);
+	MULA(res, -_anamatrix8[6], t[4]);
+	MULA(res, -_anamatrix8[2], t[5]);
+	MULA(res, -_anamatrix8[0], t[6]);
+	MULA(res, -_anamatrix8[4], t[7]);
 	out[1] = SCALE8_STAGE2(res);
 
-	MUL(res, -_anamatrix8[1], t[1]);
-	MULA(res, _anamatrix8[7], t[2]);
-	MULA(res, _anamatrix8[4], t[3]);
-	MULA(res, -_anamatrix8[2], t[4]);
-	MULA(res, -_anamatrix8[6], t[5]);
-	MULA(res, _anamatrix8[5], t[6]);
-	MULA(res, _anamatrix8[0], t[7]);
-	MULA(res, _anamatrix8[3], t[8]);
+	MUL(res, -_anamatrix8[1], t[0]);
+	MULA(res, _anamatrix8[7], t[1]);
+	MULA(res, _anamatrix8[4], t[2]);
+	MULA(res, -_anamatrix8[2], t[3]);
+	MULA(res, -_anamatrix8[6], t[4]);
+	MULA(res, _anamatrix8[5], t[5]);
+	MULA(res, _anamatrix8[0], t[6]);
+	MULA(res, _anamatrix8[3], t[7]);
 	out[2] = SCALE8_STAGE2(res);
 
-	MUL(res, -_anamatrix8[0], t[1]);
-	MULA(res, _anamatrix8[7], t[2]);
-	MULA(res, _anamatrix8[5], t[3]);
-	MULA(res, -_anamatrix8[4], t[4]);
-	MULA(res, _anamatrix8[6], t[5]);
-	MULA(res, _anamatrix8[3], t[6]);
-	MULA(res, -_anamatrix8[1], t[7]);
-	MULA(res, -_anamatrix8[2], t[8]);
+	MUL(res, -_anamatrix8[0], t[0]);
+	MULA(res, _anamatrix8[7], t[1]);
+	MULA(res, _anamatrix8[5], t[2]);
+	MULA(res, -_anamatrix8[4], t[3]);
+	MULA(res, _anamatrix8[6], t[4]);
+	MULA(res, _anamatrix8[3], t[5]);
+	MULA(res, -_anamatrix8[1], t[6]);
+	MULA(res, -_anamatrix8[2], t[7]);
 	out[3] = SCALE8_STAGE2(res);
 
-	MUL(res, -_anamatrix8[0], t[1]);
-	MULA(res, _anamatrix8[7], t[2]);
-	MULA(res, -_anamatrix8[5], t[3]);
-	MULA(res, _anamatrix8[4], t[4]);
-	MULA(res, _anamatrix8[6], t[5]);
-	MULA(res, -_anamatrix8[3], t[6]);
-	MULA(res, -_anamatrix8[1], t[7]);
-	MULA(res, _anamatrix8[2], t[8]);
+	MUL(res, -_anamatrix8[0], t[0]);
+	MULA(res, _anamatrix8[7], t[1]);
+	MULA(res, -_anamatrix8[5], t[2]);
+	MULA(res, _anamatrix8[4], t[3]);
+	MULA(res, _anamatrix8[6], t[4]);
+	MULA(res, -_anamatrix8[3], t[5]);
+	MULA(res, -_anamatrix8[1], t[6]);
+	MULA(res, _anamatrix8[2], t[7]);
 	out[4] = SCALE8_STAGE2(res);
 
-	MUL(res, -_anamatrix8[1], t[1]);
-	MULA(res, _anamatrix8[7], t[2]);
-	MULA(res, -_anamatrix8[4], t[3]);
-	MULA(res, _anamatrix8[2], t[4]);
-	MULA(res, -_anamatrix8[6], t[5]);
-	MULA(res, -_anamatrix8[5], t[6]);
-	MULA(res, _anamatrix8[0], t[7]);
-	MULA(res, -_anamatrix8[3], t[8]);
+	MUL(res, -_anamatrix8[1], t[0]);
+	MULA(res, _anamatrix8[7], t[1]);
+	MULA(res, -_anamatrix8[4], t[2]);
+	MULA(res, _anamatrix8[2], t[3]);
+	MULA(res, -_anamatrix8[6], t[4]);
+	MULA(res, -_anamatrix8[5], t[5]);
+	MULA(res, _anamatrix8[0], t[6]);
+	MULA(res, -_anamatrix8[3], t[7]);
 	out[5] = SCALE8_STAGE2(res);
 
-	MUL(res, _anamatrix8[1], t[1]);
-	MULA(res, _anamatrix8[7], t[2]);
-	MULA(res, -_anamatrix8[3], t[3]);
-	MULA(res, _anamatrix8[5], t[4]);
-	MULA(res, -_anamatrix8[6], t[5]);
-	MULA(res, _anamatrix8[2], t[6]);
-	MULA(res, -_anamatrix8[0], t[7]);
-	MULA(res, _anamatrix8[4], t[8]);
+	MUL(res, _anamatrix8[1], t[0]);
+	MULA(res, _anamatrix8[7], t[1]);
+	MULA(res, -_anamatrix8[3], t[2]);
+	MULA(res, _anamatrix8[5], t[3]);
+	MULA(res, -_anamatrix8[6], t[4]);
+	MULA(res, _anamatrix8[2], t[5]);
+	MULA(res, -_anamatrix8[0], t[6]);
+	MULA(res, _anamatrix8[4], t[7]);
 	out[6] = SCALE8_STAGE2(res);
 
-	MUL(res, _anamatrix8[0], t[1]);
-	MULA(res, _anamatrix8[7], t[2]);
-	MULA(res, -_anamatrix8[2], t[3]);
-	MULA(res, -_anamatrix8[3], t[4]);
-	MULA(res, _anamatrix8[6], t[5]);
-	MULA(res, -_anamatrix8[4], t[6]);
-	MULA(res, _anamatrix8[1], t[7]);
-	MULA(res, -_anamatrix8[5], t[8]);
+	MUL(res, _anamatrix8[0], t[0]);
+	MULA(res, _anamatrix8[7], t[1]);
+	MULA(res, -_anamatrix8[2], t[2]);
+	MULA(res, -_anamatrix8[3], t[3]);
+	MULA(res, _anamatrix8[6], t[4]);
+	MULA(res, -_anamatrix8[4], t[5]);
+	MULA(res, _anamatrix8[1], t[6]);
+	MULA(res, -_anamatrix8[5], t[7]);
 	out[7] = SCALE8_STAGE2(res);
 }
 

[-- Attachment #3: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-devel] How to use sbc.c ?
  2006-12-19 11:43     ` [Bluez-devel] How to use sbc.c ? Frank Heimbächer
  2006-12-19 22:17       ` Brad Midgley
@ 2006-12-22 12:07       ` Frank Heimbaecher
  1 sibling, 0 replies; 16+ messages in thread
From: Frank Heimbaecher @ 2006-12-22 12:07 UTC (permalink / raw)
  To: BlueZ development

Hello

I found out that sbc.c, as it is, works for big endian. On little endian
machines you cannot recognize an audio file after encoding and decoding.
So I changed the code a bit:

sbc_decode():
// fh 20.12.06: original source code assumes big endian
// so we have to change the order of the following 2 statements
*ptr++ = (s & 0x00ff);
*ptr++ = (s & 0xff00) >> 8;

sbc_encode():
// fh 20.12.06: original source code assumes big endian
// so we have to exchange [0] and [1] here
int16_t s = (ptr[1] & 0xff) << 8 | (ptr[0] & 0xff);

Would it be a suggestion to work with a macro LITTLE_ENDIAN here?

And very interesting for me: Are there other places in the code that
need to be adapted to little endian? Because the result after decoding
is still poor: volume is too low, speed is too high (probably data
missing) and sound is quite shallow. When I write the resulting data to
a file, it is smaller than the original.

Thanks for help
Frank

-- 
Dipl.-Inform. Frank Heimbaecher, Senior Software Architect

jambit Software Development & Management GmbH
Nymphenburger Strasse 13-15, D-80335 Muenchen

http://www.jambit.com    where innovation works

Tel.: +49.89.45 2347-42
Fax:  +49.89.45 2347-70


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-devel] How to use sbc.c ?
  2006-12-20 13:14         ` Frédéric DALLEAU
@ 2007-01-10 20:32           ` Brad Midgley
  2007-01-11  8:24             ` Siegbert Baude
  2007-01-11  8:35             ` Frédéric DALLEAU
  0 siblings, 2 replies; 16+ messages in thread
From: Brad Midgley @ 2007-01-10 20:32 UTC (permalink / raw)
  To: BlueZ development

Fr=E9d=E9ric

Somehow this message went to my junk folder!

The tables we have are different because we have changed the algorithm
over time and adapted the tables to avoid some computation. We also
split the tables as a result of how they are used.

On top of that, we converted the values to integers which doesn't help
make it easy to follow.

I hope it's not impossible to follow :(

Brad

>>> The newest download of sbc.c from http://sbc.cvs.sourceforge.net/sbc/
>>> under menu "CVS Browse" contains a simple bug, which lets the file
>>> compile, but crash on runtime: In function _sbc_analyze_eight() the
>>> array 't[8]' is referenced from t[1] to t[8], instead of t[0] to t[7].
>>>     =

>>
>> fixed. thanks.
>>   =

> some values were missed so the sound is now larsenized ;)
> patch attached.
> =

> BTW, I was looking for the tables specially Proto_4_40 and Proto_8_80
> from a2dp specifications.
> I suspect they are stored in sbc_proto_8_80m0 and sbc_proto_8_80m1.
> The values are not the same that in the spec. Do you know why?
> =

> =

> ------------------------------------------------------------------------
> =

> ? Doxyfile
> ? Makefile
> ? Makefile.in
> ? aclocal.m4
> ? autom4te.cache
> ? config.guess
> ? config.h
> ? config.h.in
> ? config.log
> ? config.status
> ? config.sub
> ? configure
> ? debug
> ? depcomp
> ? install-sh
> ? libtool
> ? ltmain.sh
> ? missing
> ? sbc.kdevelop
> ? sbc.kdevelop.pcs
> ? sbc.kdevses
> ? sbc.pc
> ? stamp-h1
> ? include/Makefile
> ? include/Makefile.in
> ? lib/.deps
> ? lib/.libs
> ? lib/Makefile
> ? lib/Makefile.in
> ? lib/libsbc.la
> ? lib/sbc.lo
> ? src/.deps
> ? src/.libs
> ? src/Makefile
> ? src/Makefile.in
> ? src/sbcinfo
> Index: lib/sbc.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /cvsroot/sbc/sbc/lib/sbc.c,v
> retrieving revision 1.8
> diff -u -r1.8 sbc.c
> --- lib/sbc.c	19 Dec 2006 22:13:41 -0000	1.8
> +++ lib/sbc.c	20 Dec 2006 12:58:09 -0000
> @@ -892,84 +892,84 @@
>  	MULA(res, -_sbc_proto_8[21], in[75]);
>  	t[7] =3D SCALE8_STAGE1(res);
>  =

> -	MUL(res, _anamatrix8[0], t[1]);
> -	MULA(res, _anamatrix8[7], t[2]);
> -	MULA(res, _anamatrix8[2], t[3]);
> -	MULA(res, _anamatrix8[3], t[4]);
> -	MULA(res, _anamatrix8[6], t[5]);
> -	MULA(res, _anamatrix8[4], t[6]);
> -	MULA(res, _anamatrix8[1], t[7]);
> -	MULA(res, _anamatrix8[5], t[8]);
> +	MUL(res, _anamatrix8[0], t[0]);
> +	MULA(res, _anamatrix8[7], t[1]);
> +	MULA(res, _anamatrix8[2], t[2]);
> +	MULA(res, _anamatrix8[3], t[3]);
> +	MULA(res, _anamatrix8[6], t[4]);
> +	MULA(res, _anamatrix8[4], t[5]);
> +	MULA(res, _anamatrix8[1], t[6]);
> +	MULA(res, _anamatrix8[5], t[7]);
>  	out[0] =3D SCALE8_STAGE2(res);
>  =

> -	MUL(res, _anamatrix8[1], t[1]);
> -	MULA(res, _anamatrix8[7], t[2]);
> -	MULA(res, _anamatrix8[3], t[3]);
> -	MULA(res, -_anamatrix8[5], t[4]);
> -	MULA(res, -_anamatrix8[6], t[5]);
> -	MULA(res, -_anamatrix8[2], t[6]);
> -	MULA(res, -_anamatrix8[0], t[7]);
> -	MULA(res, -_anamatrix8[4], t[8]);
> +	MUL(res, _anamatrix8[1], t[0]);
> +	MULA(res, _anamatrix8[7], t[1]);
> +	MULA(res, _anamatrix8[3], t[2]);
> +	MULA(res, -_anamatrix8[5], t[3]);
> +	MULA(res, -_anamatrix8[6], t[4]);
> +	MULA(res, -_anamatrix8[2], t[5]);
> +	MULA(res, -_anamatrix8[0], t[6]);
> +	MULA(res, -_anamatrix8[4], t[7]);
>  	out[1] =3D SCALE8_STAGE2(res);
>  =

> -	MUL(res, -_anamatrix8[1], t[1]);
> -	MULA(res, _anamatrix8[7], t[2]);
> -	MULA(res, _anamatrix8[4], t[3]);
> -	MULA(res, -_anamatrix8[2], t[4]);
> -	MULA(res, -_anamatrix8[6], t[5]);
> -	MULA(res, _anamatrix8[5], t[6]);
> -	MULA(res, _anamatrix8[0], t[7]);
> -	MULA(res, _anamatrix8[3], t[8]);
> +	MUL(res, -_anamatrix8[1], t[0]);
> +	MULA(res, _anamatrix8[7], t[1]);
> +	MULA(res, _anamatrix8[4], t[2]);
> +	MULA(res, -_anamatrix8[2], t[3]);
> +	MULA(res, -_anamatrix8[6], t[4]);
> +	MULA(res, _anamatrix8[5], t[5]);
> +	MULA(res, _anamatrix8[0], t[6]);
> +	MULA(res, _anamatrix8[3], t[7]);
>  	out[2] =3D SCALE8_STAGE2(res);
>  =

> -	MUL(res, -_anamatrix8[0], t[1]);
> -	MULA(res, _anamatrix8[7], t[2]);
> -	MULA(res, _anamatrix8[5], t[3]);
> -	MULA(res, -_anamatrix8[4], t[4]);
> -	MULA(res, _anamatrix8[6], t[5]);
> -	MULA(res, _anamatrix8[3], t[6]);
> -	MULA(res, -_anamatrix8[1], t[7]);
> -	MULA(res, -_anamatrix8[2], t[8]);
> +	MUL(res, -_anamatrix8[0], t[0]);
> +	MULA(res, _anamatrix8[7], t[1]);
> +	MULA(res, _anamatrix8[5], t[2]);
> +	MULA(res, -_anamatrix8[4], t[3]);
> +	MULA(res, _anamatrix8[6], t[4]);
> +	MULA(res, _anamatrix8[3], t[5]);
> +	MULA(res, -_anamatrix8[1], t[6]);
> +	MULA(res, -_anamatrix8[2], t[7]);
>  	out[3] =3D SCALE8_STAGE2(res);
>  =

> -	MUL(res, -_anamatrix8[0], t[1]);
> -	MULA(res, _anamatrix8[7], t[2]);
> -	MULA(res, -_anamatrix8[5], t[3]);
> -	MULA(res, _anamatrix8[4], t[4]);
> -	MULA(res, _anamatrix8[6], t[5]);
> -	MULA(res, -_anamatrix8[3], t[6]);
> -	MULA(res, -_anamatrix8[1], t[7]);
> -	MULA(res, _anamatrix8[2], t[8]);
> +	MUL(res, -_anamatrix8[0], t[0]);
> +	MULA(res, _anamatrix8[7], t[1]);
> +	MULA(res, -_anamatrix8[5], t[2]);
> +	MULA(res, _anamatrix8[4], t[3]);
> +	MULA(res, _anamatrix8[6], t[4]);
> +	MULA(res, -_anamatrix8[3], t[5]);
> +	MULA(res, -_anamatrix8[1], t[6]);
> +	MULA(res, _anamatrix8[2], t[7]);
>  	out[4] =3D SCALE8_STAGE2(res);
>  =

> -	MUL(res, -_anamatrix8[1], t[1]);
> -	MULA(res, _anamatrix8[7], t[2]);
> -	MULA(res, -_anamatrix8[4], t[3]);
> -	MULA(res, _anamatrix8[2], t[4]);
> -	MULA(res, -_anamatrix8[6], t[5]);
> -	MULA(res, -_anamatrix8[5], t[6]);
> -	MULA(res, _anamatrix8[0], t[7]);
> -	MULA(res, -_anamatrix8[3], t[8]);
> +	MUL(res, -_anamatrix8[1], t[0]);
> +	MULA(res, _anamatrix8[7], t[1]);
> +	MULA(res, -_anamatrix8[4], t[2]);
> +	MULA(res, _anamatrix8[2], t[3]);
> +	MULA(res, -_anamatrix8[6], t[4]);
> +	MULA(res, -_anamatrix8[5], t[5]);
> +	MULA(res, _anamatrix8[0], t[6]);
> +	MULA(res, -_anamatrix8[3], t[7]);
>  	out[5] =3D SCALE8_STAGE2(res);
>  =

> -	MUL(res, _anamatrix8[1], t[1]);
> -	MULA(res, _anamatrix8[7], t[2]);
> -	MULA(res, -_anamatrix8[3], t[3]);
> -	MULA(res, _anamatrix8[5], t[4]);
> -	MULA(res, -_anamatrix8[6], t[5]);
> -	MULA(res, _anamatrix8[2], t[6]);
> -	MULA(res, -_anamatrix8[0], t[7]);
> -	MULA(res, _anamatrix8[4], t[8]);
> +	MUL(res, _anamatrix8[1], t[0]);
> +	MULA(res, _anamatrix8[7], t[1]);
> +	MULA(res, -_anamatrix8[3], t[2]);
> +	MULA(res, _anamatrix8[5], t[3]);
> +	MULA(res, -_anamatrix8[6], t[4]);
> +	MULA(res, _anamatrix8[2], t[5]);
> +	MULA(res, -_anamatrix8[0], t[6]);
> +	MULA(res, _anamatrix8[4], t[7]);
>  	out[6] =3D SCALE8_STAGE2(res);
>  =

> -	MUL(res, _anamatrix8[0], t[1]);
> -	MULA(res, _anamatrix8[7], t[2]);
> -	MULA(res, -_anamatrix8[2], t[3]);
> -	MULA(res, -_anamatrix8[3], t[4]);
> -	MULA(res, _anamatrix8[6], t[5]);
> -	MULA(res, -_anamatrix8[4], t[6]);
> -	MULA(res, _anamatrix8[1], t[7]);
> -	MULA(res, -_anamatrix8[5], t[8]);
> +	MUL(res, _anamatrix8[0], t[0]);
> +	MULA(res, _anamatrix8[7], t[1]);
> +	MULA(res, -_anamatrix8[2], t[2]);
> +	MULA(res, -_anamatrix8[3], t[3]);
> +	MULA(res, _anamatrix8[6], t[4]);
> +	MULA(res, -_anamatrix8[4], t[5]);
> +	MULA(res, _anamatrix8[1], t[6]);
> +	MULA(res, -_anamatrix8[5], t[7]);
>  	out[7] =3D SCALE8_STAGE2(res);
>  }
>  =

> =

> =

> ------------------------------------------------------------------------
> =

> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share y=
our
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
> =

> =

> ------------------------------------------------------------------------
> =

> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-devel] How to use sbc.c ?
  2007-01-10 20:32           ` Brad Midgley
@ 2007-01-11  8:24             ` Siegbert Baude
  2007-01-16  4:33               ` Brad Midgley
  2007-01-11  8:35             ` Frédéric DALLEAU
  1 sibling, 1 reply; 16+ messages in thread
From: Siegbert Baude @ 2007-01-11  8:24 UTC (permalink / raw)
  To: BlueZ development

Hello Brad,

Brad Midgley wrote:
> The tables we have are different because we have changed the algorithm
> over time and adapted the tables to avoid some computation. We also
> split the tables as a result of how they are used.
> 
> On top of that, we converted the values to integers which doesn't help
> make it easy to follow.
> 
> I hope it's not impossible to follow :(

At least it's difficult. ;-)
Maybe a short comment line would be nice which describes the steps from
the original tables to the ones found in the code. The perfect solution
would be the original matrix in the code and some pre-processor magic to
calculate the derived ones during compile time. If you describe the
necessary steps I could have a look at it, because I need to optimize
the synthesize methods for our project on a fixed-point DSP anyways.

Best regards
Siegbert

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-devel] How to use sbc.c ?
  2007-01-10 20:32           ` Brad Midgley
  2007-01-11  8:24             ` Siegbert Baude
@ 2007-01-11  8:35             ` Frédéric DALLEAU
  2007-01-12 18:52               ` Brad Midgley
  1 sibling, 1 reply; 16+ messages in thread
From: Frédéric DALLEAU @ 2007-01-11  8:35 UTC (permalink / raw)
  To: BlueZ development

Brad,

Thank you for answering, I was hesitating between precalculation or =

custom tables.

I've not been really deep into the codec now. It's not easy to follow as =

the spec itself could be more clear.

In my investigations, I got over a 64 bits version of the codec. I =

tested it on pc and arm. It gave better results than the 32 bits : the =

gain is better, the overflow do not occurs, there is still a bit of =

background noise, but not more than the 32 bits and it may be the sample =

file. It will probably consume a little bit more cpu, but I found this =

was not really noticeable (at least on my hardware). But the library =

could be changed according to needs.

While this is not the best solution to the problem, I still think users =

are complaining mainly about gain. So it could be possible to provide it =

as default. What about you?

Regards,
Fr=E9d=E9ric.

Brad Midgley a =E9crit :
> Fr=E9d=E9ric
>
> Somehow this message went to my junk folder!
>
> The tables we have are different because we have changed the algorithm
> over time and adapted the tables to avoid some computation. We also
> split the tables as a result of how they are used.
>
> On top of that, we converted the values to integers which doesn't help
> make it easy to follow.
>
> I hope it's not impossible to follow :(
>
> Brad
>
>   =

>>>> The newest download of sbc.c from http://sbc.cvs.sourceforge.net/sbc/
>>>> under menu "CVS Browse" contains a simple bug, which lets the file
>>>> compile, but crash on runtime: In function _sbc_analyze_eight() the
>>>> array 't[8]' is referenced from t[1] to t[8], instead of t[0] to t[7].
>>>>     =

>>>>         =

>>> fixed. thanks.
>>>   =

>>>       =

>> some values were missed so the sound is now larsenized ;)
>> patch attached.
>>
>> BTW, I was looking for the tables specially Proto_4_40 and Proto_8_80
>> from a2dp specifications.
>> I suspect they are stored in sbc_proto_8_80m0 and sbc_proto_8_80m1.
>> The values are not the same that in the spec. Do you know why?
>>
>>
>> ------------------------------------------------------------------------
>>
>> ? Doxyfile
>> ? Makefile
>> ? Makefile.in
>> ? aclocal.m4
>> ? autom4te.cache
>> ? config.guess
>> ? config.h
>> ? config.h.in
>> ? config.log
>> ? config.status
>> ? config.sub
>> ? configure
>> ? debug
>> ? depcomp
>> ? install-sh
>> ? libtool
>> ? ltmain.sh
>> ? missing
>> ? sbc.kdevelop
>> ? sbc.kdevelop.pcs
>> ? sbc.kdevses
>> ? sbc.pc
>> ? stamp-h1
>> ? include/Makefile
>> ? include/Makefile.in
>> ? lib/.deps
>> ? lib/.libs
>> ? lib/Makefile
>> ? lib/Makefile.in
>> ? lib/libsbc.la
>> ? lib/sbc.lo
>> ? src/.deps
>> ? src/.libs
>> ? src/Makefile
>> ? src/Makefile.in
>> ? src/sbcinfo
>> Index: lib/sbc.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> RCS file: /cvsroot/sbc/sbc/lib/sbc.c,v
>> retrieving revision 1.8
>> diff -u -r1.8 sbc.c
>> --- lib/sbc.c	19 Dec 2006 22:13:41 -0000	1.8
>> +++ lib/sbc.c	20 Dec 2006 12:58:09 -0000
>> @@ -892,84 +892,84 @@
>>  	MULA(res, -_sbc_proto_8[21], in[75]);
>>  	t[7] =3D SCALE8_STAGE1(res);
>>  =

>> -	MUL(res, _anamatrix8[0], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, _anamatrix8[2], t[3]);
>> -	MULA(res, _anamatrix8[3], t[4]);
>> -	MULA(res, _anamatrix8[6], t[5]);
>> -	MULA(res, _anamatrix8[4], t[6]);
>> -	MULA(res, _anamatrix8[1], t[7]);
>> -	MULA(res, _anamatrix8[5], t[8]);
>> +	MUL(res, _anamatrix8[0], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, _anamatrix8[2], t[2]);
>> +	MULA(res, _anamatrix8[3], t[3]);
>> +	MULA(res, _anamatrix8[6], t[4]);
>> +	MULA(res, _anamatrix8[4], t[5]);
>> +	MULA(res, _anamatrix8[1], t[6]);
>> +	MULA(res, _anamatrix8[5], t[7]);
>>  	out[0] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, _anamatrix8[1], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, _anamatrix8[3], t[3]);
>> -	MULA(res, -_anamatrix8[5], t[4]);
>> -	MULA(res, -_anamatrix8[6], t[5]);
>> -	MULA(res, -_anamatrix8[2], t[6]);
>> -	MULA(res, -_anamatrix8[0], t[7]);
>> -	MULA(res, -_anamatrix8[4], t[8]);
>> +	MUL(res, _anamatrix8[1], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, _anamatrix8[3], t[2]);
>> +	MULA(res, -_anamatrix8[5], t[3]);
>> +	MULA(res, -_anamatrix8[6], t[4]);
>> +	MULA(res, -_anamatrix8[2], t[5]);
>> +	MULA(res, -_anamatrix8[0], t[6]);
>> +	MULA(res, -_anamatrix8[4], t[7]);
>>  	out[1] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, -_anamatrix8[1], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, _anamatrix8[4], t[3]);
>> -	MULA(res, -_anamatrix8[2], t[4]);
>> -	MULA(res, -_anamatrix8[6], t[5]);
>> -	MULA(res, _anamatrix8[5], t[6]);
>> -	MULA(res, _anamatrix8[0], t[7]);
>> -	MULA(res, _anamatrix8[3], t[8]);
>> +	MUL(res, -_anamatrix8[1], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, _anamatrix8[4], t[2]);
>> +	MULA(res, -_anamatrix8[2], t[3]);
>> +	MULA(res, -_anamatrix8[6], t[4]);
>> +	MULA(res, _anamatrix8[5], t[5]);
>> +	MULA(res, _anamatrix8[0], t[6]);
>> +	MULA(res, _anamatrix8[3], t[7]);
>>  	out[2] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, -_anamatrix8[0], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, _anamatrix8[5], t[3]);
>> -	MULA(res, -_anamatrix8[4], t[4]);
>> -	MULA(res, _anamatrix8[6], t[5]);
>> -	MULA(res, _anamatrix8[3], t[6]);
>> -	MULA(res, -_anamatrix8[1], t[7]);
>> -	MULA(res, -_anamatrix8[2], t[8]);
>> +	MUL(res, -_anamatrix8[0], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, _anamatrix8[5], t[2]);
>> +	MULA(res, -_anamatrix8[4], t[3]);
>> +	MULA(res, _anamatrix8[6], t[4]);
>> +	MULA(res, _anamatrix8[3], t[5]);
>> +	MULA(res, -_anamatrix8[1], t[6]);
>> +	MULA(res, -_anamatrix8[2], t[7]);
>>  	out[3] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, -_anamatrix8[0], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, -_anamatrix8[5], t[3]);
>> -	MULA(res, _anamatrix8[4], t[4]);
>> -	MULA(res, _anamatrix8[6], t[5]);
>> -	MULA(res, -_anamatrix8[3], t[6]);
>> -	MULA(res, -_anamatrix8[1], t[7]);
>> -	MULA(res, _anamatrix8[2], t[8]);
>> +	MUL(res, -_anamatrix8[0], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, -_anamatrix8[5], t[2]);
>> +	MULA(res, _anamatrix8[4], t[3]);
>> +	MULA(res, _anamatrix8[6], t[4]);
>> +	MULA(res, -_anamatrix8[3], t[5]);
>> +	MULA(res, -_anamatrix8[1], t[6]);
>> +	MULA(res, _anamatrix8[2], t[7]);
>>  	out[4] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, -_anamatrix8[1], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, -_anamatrix8[4], t[3]);
>> -	MULA(res, _anamatrix8[2], t[4]);
>> -	MULA(res, -_anamatrix8[6], t[5]);
>> -	MULA(res, -_anamatrix8[5], t[6]);
>> -	MULA(res, _anamatrix8[0], t[7]);
>> -	MULA(res, -_anamatrix8[3], t[8]);
>> +	MUL(res, -_anamatrix8[1], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, -_anamatrix8[4], t[2]);
>> +	MULA(res, _anamatrix8[2], t[3]);
>> +	MULA(res, -_anamatrix8[6], t[4]);
>> +	MULA(res, -_anamatrix8[5], t[5]);
>> +	MULA(res, _anamatrix8[0], t[6]);
>> +	MULA(res, -_anamatrix8[3], t[7]);
>>  	out[5] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, _anamatrix8[1], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, -_anamatrix8[3], t[3]);
>> -	MULA(res, _anamatrix8[5], t[4]);
>> -	MULA(res, -_anamatrix8[6], t[5]);
>> -	MULA(res, _anamatrix8[2], t[6]);
>> -	MULA(res, -_anamatrix8[0], t[7]);
>> -	MULA(res, _anamatrix8[4], t[8]);
>> +	MUL(res, _anamatrix8[1], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, -_anamatrix8[3], t[2]);
>> +	MULA(res, _anamatrix8[5], t[3]);
>> +	MULA(res, -_anamatrix8[6], t[4]);
>> +	MULA(res, _anamatrix8[2], t[5]);
>> +	MULA(res, -_anamatrix8[0], t[6]);
>> +	MULA(res, _anamatrix8[4], t[7]);
>>  	out[6] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, _anamatrix8[0], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, -_anamatrix8[2], t[3]);
>> -	MULA(res, -_anamatrix8[3], t[4]);
>> -	MULA(res, _anamatrix8[6], t[5]);
>> -	MULA(res, -_anamatrix8[4], t[6]);
>> -	MULA(res, _anamatrix8[1], t[7]);
>> -	MULA(res, -_anamatrix8[5], t[8]);
>> +	MUL(res, _anamatrix8[0], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, -_anamatrix8[2], t[2]);
>> +	MULA(res, -_anamatrix8[3], t[3]);
>> +	MULA(res, _anamatrix8[6], t[4]);
>> +	MULA(res, -_anamatrix8[4], t[5]);
>> +	MULA(res, _anamatrix8[1], t[6]);
>> +	MULA(res, -_anamatrix8[5], t[7]);
>>  	out[7] =3D SCALE8_STAGE2(res);
>>  }
>>  =

>>
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share =
your
>> opinions on IT & business topics through brief surveys - and earn cash
>> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=
=3DDEVDEV
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Bluez-devel mailing list
>> Bluez-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>>     =

>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share y=
our
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>   =



-- =

Frederic

Without the wind, the grass does not move.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-devel] How to use sbc.c ?
  2007-01-11  8:35             ` Frédéric DALLEAU
@ 2007-01-12 18:52               ` Brad Midgley
  2007-01-13 17:32                 ` [Bluez-devel] RE : " Frederic Dalleau
  0 siblings, 1 reply; 16+ messages in thread
From: Brad Midgley @ 2007-01-12 18:52 UTC (permalink / raw)
  To: BlueZ development

Fr=E9d=E9ric

> In my investigations, I got over a 64 bits version of the codec. I =

> tested it on pc and arm. It gave better results than the 32 bits : the =

> gain is better, the overflow do not occurs, there is still a bit of =

> background noise, but not more than the 32 bits and it may be the sample =

> file. It will probably consume a little bit more cpu, but I found this =

> was not really noticeable (at least on my hardware). But the library =

> could be changed according to needs.
> =

> While this is not the best solution to the problem, I still think users =

> are complaining mainly about gain. So it could be possible to provide it =

> as default. What about you?

We have confirmation that this stuff can be done in 32 bits but it is
more work to get it right. I thought I was getting close back when I was
working on it last but couldn't get over those volume/overflow problems.
I do think the decoder was working ok in 32 bits at least.

We used to run everything in 64 bits. btsco/sbc would have the cvs
history showing the older stuff.

How about if we create a separate cvs module like "sbc64" that contains
libsbc with a 64-bit encoder? I don't like having the implementations
together with a bunch of conditional code choosing one over the other.
That was really ugly and too easy to break.

Brad

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bluez-devel] RE :  How to use sbc.c ?
  2007-01-12 18:52               ` Brad Midgley
@ 2007-01-13 17:32                 ` Frederic Dalleau
  2007-01-16  4:25                   ` Brad Midgley
  0 siblings, 1 reply; 16+ messages in thread
From: Frederic Dalleau @ 2007-01-13 17:32 UTC (permalink / raw)
  To: BlueZ development, BlueZ development


[-- Attachment #1.1: Type: text/plain, Size: 179 bytes --]

Brad

> How about if we create a separate cvs module like "sbc64" that contains
> libsbc with a 64-bit encoder?

I fully agree!
Should the two library coexist?

Frédéric

[-- Attachment #1.2: Type: text/html, Size: 610 bytes --]

[-- Attachment #2: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-devel] RE :  How to use sbc.c ?
  2007-01-13 17:32                 ` [Bluez-devel] RE : " Frederic Dalleau
@ 2007-01-16  4:25                   ` Brad Midgley
  0 siblings, 0 replies; 16+ messages in thread
From: Brad Midgley @ 2007-01-16  4:25 UTC (permalink / raw)
  To: BlueZ development

Frederic

I don't think they should need to coexist. We'll choose one or the other
and it'll create the same shared objects. They do need to stay
binary/api compatible to pull that off though.

>> How about if we create a separate cvs module like "sbc64" that contains
>> libsbc with a 64-bit encoder?
> 
> I fully agree!
> Should the two library coexist?

Brad

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Bluez-devel] How to use sbc.c ?
  2007-01-11  8:24             ` Siegbert Baude
@ 2007-01-16  4:33               ` Brad Midgley
  0 siblings, 0 replies; 16+ messages in thread
From: Brad Midgley @ 2007-01-16  4:33 UTC (permalink / raw)
  To: BlueZ development

Siegbert

> At least it's difficult. ;-)
> Maybe a short comment line would be nice which describes the steps from
> the original tables to the ones found in the code. The perfect solution
> would be the original matrix in the code and some pre-processor magic to
> calculate the derived ones during compile time. If you describe the
> necessary steps I could have a look at it, because I need to optimize
> the synthesize methods for our project on a fixed-point DSP anyways.

I've been trying to fix some problems in there and I will reconstruct as
much as I can from memory and comment it.

Brad

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2007-01-16  4:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-31 10:19 [Bluez-users] Play received A2DP data Frank Heimbaecher
2006-08-31 11:37 ` Manuel Bernhardt
2006-08-31 13:05   ` Brad Midgley
2006-12-15 13:28 ` [Bluez-users] How to use sbc.c of btsco? Frank Heimbächer
2006-12-16  7:28   ` [Bluez-devel] " Brad Midgley
2006-12-19 11:43     ` [Bluez-devel] How to use sbc.c ? Frank Heimbächer
2006-12-19 22:17       ` Brad Midgley
2006-12-20 13:14         ` Frédéric DALLEAU
2007-01-10 20:32           ` Brad Midgley
2007-01-11  8:24             ` Siegbert Baude
2007-01-16  4:33               ` Brad Midgley
2007-01-11  8:35             ` Frédéric DALLEAU
2007-01-12 18:52               ` Brad Midgley
2007-01-13 17:32                 ` [Bluez-devel] RE : " Frederic Dalleau
2007-01-16  4:25                   ` Brad Midgley
2006-12-22 12:07       ` [Bluez-devel] " Frank Heimbaecher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.