Subject: Re: comms/bthfp floating point exception
To: Iain Hibbert <plunky@rya-online.net>
From: Juan RP <juan@xtrarom.org>
List: pkgsrc-users
Date: 12/11/2006 22:10:14
On Sunday 10 December 2006 20:09, Iain Hibbert wrote:

> I tried to make it clear in the CAVEAT section of ubt(4) (I guess that
> bthfp(1) manpage should also have a pointer to that)
>
> The Audio data is sent over the Bluetooth link in a SCO packet, and the
> device itself provides a SCO maximum payload size that it can accept. This
> value will be given by the 'btconfig -v ubt0' command (sco_mtu).

On my system it's 0, changing hw.ubt0.config doesn't seem to change 
something...

[juan@nocturno][~]> sudo btconfig -v ubt0
ubt0: bdaddr 00:0a:94:13:22:93 flags 0x3<UP,RUNNING>
        num_cmd = 1
        num_acl = 20, acl_mtu = 120
        num_sco = 0, sco_mtu = 0
        class: [0x020104] Desktop Computer <Networking>
        name: "usb-dongle"
        voice: [0x0060]
        pin: variable
        options: iscan pscan auth encrypt
[juan@nocturno][~]>

Is it the expected value?

> SCO packets (header + payload) are chopped up into frames (of sco_txsize,
> above) when they are sent via isochronous transfer over the USB bus, and I
> found that if you try to send a partial frame, the USB Device/Hub will
> crash. So, we need to make it so that a SCO packet fits exactly into an
> integer number of frames.
>
> Now, there are several possible configurations for the isochronous data
> transfer and since they reserve bandwidth I left it turned off by default
> for now.
>
> So, since you want to use a single 16-bit voice channel (thats all thats
> going to work, for now) use config#2. On my system (probably yours too,
> I'm not sure) that gives me:
>
> hw.ubt0.config = 2
> hw.ubt0.alt_config = 6
> hw.ubt0.sco_rxsize = 17
> hw.ubt0.sco_txsize = 17
>
> and I know the USB frame size is 17 bytes. If I enable my device, I see
> that its maximum payload size is 64 bytes (yours could be something else),
> and if I calculate the possible payloads that would fit exactly into
> numbers of frames, I get the following:

I would like to know the maximum payload size of my device but don't know
where did you get the 64bytes value...

>            (17 * 1) - 3 = 14
>            (17 * 2) - 3 = 31
>            (17 * 3) - 3 = 48
>            (17 * 4) - 3 = 65
>            (17 * 5) - 3 = 82
>            etc.
>
> which means that the largest payload I can currently use is 48 so I change
> the value:

Thanks for the information (note that I did already read the manpage before
your comments, but it wasn't enough for me to understand).

> % sudo btconfig ubt0 scotu 48
>
> and now it just works with no errors..

Looks like I'd have to use same value than you, but that doesn't work for 
me... bthfp works fine but does not print "Audio connection established" or
something like this as my previous tests, and I can only hear audio
distorted or garbage.

-- 

http://plog.xtrarom.org/
Juan RP's blog - NetBSD/pkgsrc news in Spanish