linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-devel] Voice setting for U-law and A-law.
@ 2005-09-23 14:43 Ivy
  2005-09-23 14:48 ` Marcel Holtmann
  0 siblings, 1 reply; 8+ messages in thread
From: Ivy @ 2005-09-23 14:43 UTC (permalink / raw)
  To: bluez-devel

Hi,

            I am trying to change the input Encoding of Voice setting using hciconfig tool. Default voice setting 0x60, supports Linear pcm ( I guess i am newbie if any thing wrong please correct me) .. I would like to change setting to u-law or a-law. I have assigned voice setting value as 0x100 for u-law  i am not sure, it is correct or not ?.. Could any one help me to set it correctly...  


Thanks
Prakash 
__________________________
Free 3000MB email. Stops spam 100%. No banner ads. No popup ads. http://www.cashette.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Voice setting for U-law and A-law.
  2005-09-23 14:43 Ivy
@ 2005-09-23 14:48 ` Marcel Holtmann
  0 siblings, 0 replies; 8+ messages in thread
From: Marcel Holtmann @ 2005-09-23 14:48 UTC (permalink / raw)
  To: bluez-devel

Hi,

>             I am trying to change the input Encoding of Voice setting using hciconfig tool. Default voice setting 0x60, supports Linear pcm ( I guess i am newbie if any thing wrong please correct me) .. I would like to change setting to u-law or a-law. I have assigned voice setting value as 0x100 for u-law  i am not sure, it is correct or not ?.. Could any one help me to set it correctly...  

check the mailing list archive, because it was explained in detail some
time ago and of course the specification is a good information source.

Regards

Marcel




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Voice setting for U-law and A-law.
@ 2005-09-24 10:20 Ivy
  2005-09-24 11:03 ` Andreas Beck
  0 siblings, 1 reply; 8+ messages in thread
From: Ivy @ 2005-09-24 10:20 UTC (permalink / raw)
  To: bluez-devel

Hi Marcel,

            Thanks for your information. I wentthrought the Documentation and our Mailing list.. Please bare with me for asking this silly questions .... Still i m confused about INPUT Data Format,INput sample size and PCM BIT POSITION. Please correct me if i am wrong. I HAVE choosen in the following way.. (Right now my usb driver claimed 2nd alternate setting (isoc=2). i.e One voice connection with 16 Bit encoding & 2 Voice connection with 8 Bit encoding . 
              
          0101101000 = 0x168 

 Bitwise that"s:
 
   xxxxxx01xxxxxxxx Input Coding: u-law
   xxxxxxxx01xxxxxx Input Data Format: 2"s complement ( what is the advantage of 2's complement that 1's com ?). 
   xxxxxxxxxx1xxxxx Input Sample Size: 16 bit   ( Can i use 8 bit ?) (what does it  mean "ONly FOR Linear PCM in Documentation ?).
   xxxxxxxxxxx010xx # of bits padding at MSB: 2 (if i use 16 Bit, 2bit's of MSB is needed for padding, coz only 14bits are enough for u-law)
   xxxxxxxxxxxxxx00 Air Coding Format: CVSD


Expecting your valuable reply

Thanks
-ivy





--- Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi,
> 
> >             I am trying to change the input Encoding of Voice setting using hciconfig tool. Default voice setting 0x60, supports Linear pcm ( I guess i am newbie if any thing wrong please correct me) .. I would like to change setting to u-law or a-law. I have assigned voice setting value as 0x100 for u-law  i am not sure, it is correct or not ?.. Could any one help me to set it correctly...  
> 
> check the mailing list archive, because it was explained in detail some
> time ago and of course the specification is a good information source.
> 
> Regards
> 
> Marcel
> 
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. 
> Download it for free - -and be entered to win a 42" plasma tv or your very
> own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

__________________________
Free 3000MB email. Stops spam 100%. No banner ads. No popup ads. http://www.cashette.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Voice setting for U-law and A-law.
  2005-09-24 10:20 Ivy
@ 2005-09-24 11:03 ` Andreas Beck
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Beck @ 2005-09-24 11:03 UTC (permalink / raw)
  To: bluez-devel

Ivy <ivy@cashette.com> wrote:

>    xxxxxx01xxxxxxxx Input Coding: u-law 
>    xxxxxxxx01xxxxxx Input Data Format: 2"s complement 
> ( what is the advantage of 2's complement that 1's com ?).

Actually I don't think this makes sense for ulaw/alaw, as AFAIK these
are always 8 bit, as they were designed for telephony channels (ISDN)
that operate at 64kbit, thus giving 8kSamples/s at 8 bit.

The alaw/ulaw encoding gives a somewhat logarithmic scale which gives
better dynamic range at the expense of small details the human ear
doesn't recognize well anyway.

For linear, the difference is in the coding of negative numbers.
1s complement will code negative numbers as their positive equivalent 
XOR 0xffff (i.e. a word with all-one bits). This is a rater uncommon
coding scheme. It has the odditiy of having a +0 (0x0000) and a 
-0 (0xffff). 2s complement will add 1 after the above step, which 
has the advantage of simple handling of arithmetic operations with
common ALUs designed for unsigned numbers. It just works - only thing
you have to adjust is handling of overflow flags.
Another advantage is a slightly increased range of values (-32768 to
32767 at 16 bit as compared to -32767 to 32767 at 1s complement)
at the expense of an asymmetric value range.

>  xxxxxxxxxx1xxxxx Input Sample Size: 16 bit   (Can i use 8 bit ?) 

IMHO you should, if you want alaw/ulaw.

>  (what does it  mean "ONly FOR Linear PCM in Documentation ?).  

I suppose these bits get ignored for formats other than linear PCM, as
ulaw/alaw are inherently 8 bits.

> xxxxxxxxxxx010xx # of bits padding at MSB: 2 (if i use 16 Bit, 
> 2bit's of MSB is needed for padding, coz only 14bits are enough 
> for u-law) 

AFAIK 8 bits are enough - could you explain?


CU, Andy

-- 
= Andreas Beck                    |  Email :  <becka-sig@bedatec.de>         =


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Voice setting for U-law and A-law.
@ 2005-09-24 11:21 Ivy
  2005-09-24 11:32 ` Andreas Beck
  0 siblings, 1 reply; 8+ messages in thread
From: Ivy @ 2005-09-24 11:21 UTC (permalink / raw)
  To: bluez-devel, bluez-devel

--- Andreas Beck <becka-bzdvl@bedatec.de> wrote:
> Ivy <ivy@cashette.com> wrote:
> 
> >    xxxxxx01xxxxxxxx Input Coding: u-law 
> >    xxxxxxxx01xxxxxx Input Data Format: 2"s complement 
> > ( what is the advantage of 2's complement that 1's com ?).
> 
> Actually I don't think this makes sense for ulaw/alaw, as AFAIK these
> are always 8 bit, as they were designed for telephony channels (ISDN)
> that operate at 64kbit, thus giving 8kSamples/s at 8 bit.
> 
> The alaw/ulaw encoding gives a somewhat logarithmic scale which gives
> better dynamic range at the expense of small details the human ear
> doesn't recognize well anyway.
> 
> For linear, the difference is in the coding of negative numbers.
> 1s complement will code negative numbers as their positive equivalent 
> XOR 0xffff (i.e. a word with all-one bits). This is a rater uncommon
> coding scheme. It has the odditiy of having a +0 (0x0000) and a 
> -0 (0xffff). 2s complement will add 1 after the above step, which 
> has the advantage of simple handling of arithmetic operations with
> common ALUs designed for unsigned numbers. It just works - only thing
> you have to adjust is handling of overflow flags.
> Another advantage is a slightly increased range of values (-32768 to
> 32767 at 16 bit as compared to -32767 to 32767 at 1s complement)
> at the expense of an asymmetric value range.
> 
> >  xxxxxxxxxx1xxxxx Input Sample Size: 16 bit   (Can i use 8 bit ?) 
> 
> IMHO you should, if you want alaw/ulaw.

              You meant to use 16 Bit or 8 bit ?..

> 
> >  (what does it  mean "ONly FOR Linear PCM in Documentation ?).  
> 
> I suppose these bits get ignored for formats other than linear PCM, as
> ulaw/alaw are inherently 8 bits.

> 
> > xxxxxxxxxxx010xx # of bits padding at MSB: 2 (if i use 16 Bit, 
> > 2bit's of MSB is needed for padding, coz only 14bits are enough 
> > for u-law) 
> 
> AFAIK 8 bits are enough - could you explain?

              U-LAW takes 14bits of linear PCM data as input and generates 8 bit compressed data. Am i correct ?.. Please correct me if i m wrong !!.. Thatswhy i assume that it needs 16 bits for INPUT Sample size and 2 bit offset in MSB position. 

> 
> 
> CU, Andy

-ivy 

> 
> -- 
> = Andreas Beck                    |  Email :  <becka-sig@bedatec.de>         =
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. 
> Download it for free - -and be entered to win a 42" plasma tv or your very
> own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

__________________________
Free 3000MB email. Stops spam 100%. No banner ads. No popup ads. http://www.cashette.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Voice setting for U-law and A-law.
  2005-09-24 11:21 Ivy
@ 2005-09-24 11:32 ` Andreas Beck
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Beck @ 2005-09-24 11:32 UTC (permalink / raw)
  To: bluez-devel

Ivy <ivy@cashette.com> wrote:
> > >  xxxxxxxxxx1xxxxx Input Sample Size: 16 bit   (Can i use 8 bit ?) 
> > IMHO you should, if you want alaw/ulaw.
> You meant to use 16 Bit or 8 bit ?..

8 bit.

> > > xxxxxxxxxxx010xx # of bits padding at MSB: 2 (if i use 16 Bit, 
> > > 2bit's of MSB is needed for padding, coz only 14bits are enough 
> > > for u-law) 
> > AFAIK 8 bits are enough - could you explain?
> U-LAW takes 14bits of linear PCM data as input and generates 8 bit 
> compressed data. Am i correct ?

Yes. That is correct.

> Thatswhy i assume that it needs 16 bits for INPUT Sample size and 
> 2 bit offset in MSB position. 

No - I suppose this is a misunderstanding about "input".

The SCM link via bluetooth uses its own encoding anyway (see the 
comment about on air coding at the end of the list).

INPUT means what you feed in/get out at the driver side.

That is, if you choose alaw, you already feed alaw data.

Otherwise you could just use linear anyway. There would be no use in
converting to alaw first and then again to the air coding format.

Basically you will want to use alaw/ulaw, if you want to feed the
received data directly into a device that wants this data format anyway,
saving unnecessary conversions.


CU, ANdy


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Voice setting for U-law and A-law.
@ 2005-09-24 11:52 Ivy
  0 siblings, 0 replies; 8+ messages in thread
From: Ivy @ 2005-09-24 11:52 UTC (permalink / raw)
  To: bluez-devel; +Cc: Andreas Beck




--- Andreas Beck <becka-bzdvl@bedatec.de> wrote:
> Ivy <ivy@cashette.com> wrote:
> > > >  xxxxxxxxxx1xxxxx Input Sample Size: 16 bit   (Can i use 8 bit ?) 
> > > IMHO you should, if you want alaw/ulaw.
> > You meant to use 16 Bit or 8 bit ?..
> 
> 8 bit.
> 
> > > > xxxxxxxxxxx010xx # of bits padding at MSB: 2 (if i use 16 Bit, 
> > > > 2bit's of MSB is needed for padding, coz only 14bits are enough 
> > > > for u-law) 
> > > AFAIK 8 bits are enough - could you explain?
> > U-LAW takes 14bits of linear PCM data as input and generates 8 bit 
> > compressed data. Am i correct ?
> 
> Yes. That is correct.
> 
> > Thatswhy i assume that it needs 16 bits for INPUT Sample size and 
> > 2 bit offset in MSB position. 
> 
> No - I suppose this is a misunderstanding about "input".
> 
> The SCM link via bluetooth uses its own encoding anyway (see the 
> comment about on air coding at the end of the list).
> 
 
      SCO LInk via bluetooh uses CVSD encoding...  
   
> INPUT means what you feed in/get out at the driver side.
> 
> That is, if you choose alaw, you already feed alaw data.
> 
> Otherwise you could just use linear anyway. There would be no use in
> converting to alaw first and then again to the air coding format.
> 
> Basically you will want to use alaw/ulaw, if you want to feed the
> received data directly into a device that wants this data format anyway,
> saving unnecessary conversions.
> 

   xxxxxx01xxxxxxxx Input Coding: u-law
   xxxxxxxx01xxxxxx Input Data Format: 2"s complement 
   xxxxxxxxxx0xxxxx Input Sample Size: 8 bit
   xxxxxxxxxxx000xx # of bits padding at MSB: 0
   xxxxxxxxxxxxxx00 Air Coding Format: CVSD

               0101000000 = 0x140 is the correct value ?. isnt it ?
hciconfig hci0 voice 0x140. Is it necessary to change my USB alternate setting for  the above changes ?. Right now it is placed in alternate setting 2. (Endpoint value 17). Thanks for bare with me 

Thanks
-IVY  



> 
> CU, ANdy
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. 
> Download it for free - -and be entered to win a 42" plasma tv or your very
> own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

__________________________
Free 3000MB email. Stops spam 100%. No banner ads. No popup ads. http://www.cashette.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Voice setting for U-law and A-law.
@ 2005-09-25 10:38 Ivy
  0 siblings, 0 replies; 8+ messages in thread
From: Ivy @ 2005-09-25 10:38 UTC (permalink / raw)
  To: bluez-devel, linux-usb-devel; +Cc: Andreas Beck


Hi Marcel , Andy ..


           Thanks for bare with me so far ...

            Based on your input and  Mailing list info, I have choosen alternate setting 1 in interface 1. I am using CSR chipset Bluetooth Dongle. My voice setting value is 0x140. (mu-law). If i am submitting URBS to read, my system is hanging.. I am using 2.6.12 kernel. if i am setting default voice setting value 0x60... It is not hanging ... I dont know what would be the probelm... Any one tips  to track down this problem ...  

Thanks
-Ivy

--- Ivy <ivy@cashette.com> wrote:
> 
> 
> 
> --- Andreas Beck <becka-bzdvl@bedatec.de> wrote:
> > Ivy <ivy@cashette.com> wrote:
> > > > >  xxxxxxxxxx1xxxxx Input Sample Size: 16 bit   (Can i use 8 bit ?) 
> > > > IMHO you should, if you want alaw/ulaw.
> > > You meant to use 16 Bit or 8 bit ?..
> > 
> > 8 bit.
> > 
> > > > > xxxxxxxxxxx010xx # of bits padding at MSB: 2 (if i use 16 Bit, 
> > > > > 2bit's of MSB is needed for padding, coz only 14bits are enough 
> > > > > for u-law) 
> > > > AFAIK 8 bits are enough - could you explain?
> > > U-LAW takes 14bits of linear PCM data as input and generates 8 bit 
> > > compressed data. Am i correct ?
> > 
> > Yes. That is correct.
> > 
> > > Thatswhy i assume that it needs 16 bits for INPUT Sample size and 
> > > 2 bit offset in MSB position. 
> > 
> > No - I suppose this is a misunderstanding about "input".
> > 
> > The SCM link via bluetooth uses its own encoding anyway (see the 
> > comment about on air coding at the end of the list).
> > 
>  
>       SCO LInk via bluetooh uses CVSD encoding...  
>    
> > INPUT means what you feed in/get out at the driver side.
> > 
> > That is, if you choose alaw, you already feed alaw data.
> > 
> > Otherwise you could just use linear anyway. There would be no use in
> > converting to alaw first and then again to the air coding format.
> > 
> > Basically you will want to use alaw/ulaw, if you want to feed the
> > received data directly into a device that wants this data format anyway,
> > saving unnecessary conversions.
> > 
> 
>    xxxxxx01xxxxxxxx Input Coding: u-law
>    xxxxxxxx01xxxxxx Input Data Format: 2"s complement 
>    xxxxxxxxxx0xxxxx Input Sample Size: 8 bit
>    xxxxxxxxxxx000xx # of bits padding at MSB: 0
>    xxxxxxxxxxxxxx00 Air Coding Format: CVSD
> 
>                0101000000 = 0x140 is the correct value ?. isnt it ?
> hciconfig hci0 voice 0x140. Is it necessary to change my USB alternate setting for  the above changes ?. Right now it is placed in alternate setting 2. (Endpoint value 17). Thanks for bare with me 
> 
> Thanks
> -IVY  
> 
> 
> 
> > 
> > CU, ANdy
> > 
> > 
> > -------------------------------------------------------
> > SF.Net email is sponsored by:
> > Tame your development challenges with Apache's Geronimo App Server. 
> > Download it for free - -and be entered to win a 42" plasma tv or your very
> > own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> > _______________________________________________
> > Bluez-devel mailing list
> > Bluez-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bluez-devel
> 
> __________________________
> Free 3000MB email. Stops spam 100%. No banner ads. No popup ads. http://www.cashette.com
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. 
> Download it for free - -and be entered to win a 42" plasma tv or your very
> own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
> 
> __________________________
> Free 3000MB email. Stops spam 100%. No banner ads. No popup ads. http://www.cashette.com

__________________________
Free 3000MB email. Stops spam 100%. No banner ads. No popup ads. http://www.cashette.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

end of thread, other threads:[~2005-09-25 10:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-25 10:38 [Bluez-devel] Voice setting for U-law and A-law Ivy
  -- strict thread matches above, loose matches on Subject: below --
2005-09-24 11:52 Ivy
2005-09-24 11:21 Ivy
2005-09-24 11:32 ` Andreas Beck
2005-09-24 10:20 Ivy
2005-09-24 11:03 ` Andreas Beck
2005-09-23 14:43 Ivy
2005-09-23 14:48 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).