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/10/2006 18:50:01
--Boundary-01=_JjEfFvDyHw8fAJh
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

On Sunday 10 December 2006 18:14, Iain Hibbert wrote:
> On Sun, 10 Dec 2006, Juan RP wrote:
> > On Sunday 10 December 2006 16:38, Juan RP wrote:
> > > accept_sco: blocksize=0 info.blocksize=800 mtu=0
> >
> > The problem is mtu that is 0, blocksize is fine.
>
> Hm, in that case I should add a check there to at least fail gracefully..

Ah, so the problem was that I was using hw.ubt0.config=0!

> > Anyway hardcoding the mtu value (127) does not seem to work
> > and I can hear only distortions.
>
> How did you hardcode that value? 127 is likely too large - did you read
> the CAVEAT section from ubt(4) and enable the USB isochronous data for
> ubt?  That should explain somewhat how to calculate a proper value (its
> suboptimal that we should have to do that, but I haven't worked out the
> real problem in the USB stack as yet)

I thought mtu was referring to net.bluetooth.rfcomm.mtu_default.

> The MTU retrieved from the socket will be the "sco_mtu" value as reported
> by btconfig - if this is still zero, then that is what the device is
> reporting and I'm not sure if setting it to a higher value will work
> properly. I understand that some older Belkin USB dongles (Broadcom 2035)
> had trouble with SCO data and report the value in this way.

I understand... I changed hw.ubt0.config to 1 and I got:

[juan@nocturno][~]> sysctl -a|grep -E '(ubt|bluetooth)'
net.bluetooth.hci.sendspace = 259
net.bluetooth.hci.recvspace = 4096
net.bluetooth.hci.acl_expiry = 10
net.bluetooth.hci.memo_expiry = 600
net.bluetooth.hci.eventq_max = 20
net.bluetooth.hci.aclrxq_max = 50
net.bluetooth.hci.scorxq_max = 50
net.bluetooth.l2cap.sendspace = 4096
net.bluetooth.l2cap.recvspace = 4096
net.bluetooth.l2cap.rtx = 30
net.bluetooth.l2cap.ertx = 180
net.bluetooth.rfcomm.sendspace = 4096
net.bluetooth.rfcomm.recvspace = 4096
net.bluetooth.rfcomm.mtu_default = 127
net.bluetooth.rfcomm.ack_timeout = 20
net.bluetooth.rfcomm.mcc_timeout = 20
net.bluetooth.sco.sendspace = 4096
net.bluetooth.sco.recvspace = 4096
hw.ubt0.config = 1
hw.ubt0.alt_config = 6
hw.ubt0.sco_rxsize = 9
hw.ubt0.sco_txsize = 9
[juan@nocturno][~]>

I start /etc/rc.d/btconfig:

[juan@nocturno][~]> sudo /etc/rc.d/btconfig start
Configuring Bluetooth controllers: ubt0.
[juan@nocturno][~]>

But can you explain with details how to calculate the SCO
packet size?

-- 

http://plog.xtrarom.org/
Juan RP's blog - NetBSD/pkgsrc news in Spanish
--Boundary-01=_JjEfFvDyHw8fAJh
Content-Type: text/html;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:10pt;font-family:Bitstream Vera Sans">
<p>On Sunday 10 December 2006 18:14, Iain Hibbert wrote:</p>
<p><span style="color:#008000">&gt; On Sun, 10 Dec 2006, Juan RP wrote:</span></p>
<p><span style="color:#007000">&gt; &gt; On Sunday 10 December 2006 16:38, Juan RP wrote:</span></p>
<p><span style="color:#006000">&gt; &gt; &gt; accept_sco: blocksize=0 info.blocksize=800 mtu=0</span></p>
<p><span style="color:#007000">&gt; &gt;</span></p>
<p><span style="color:#007000">&gt; &gt; The problem is mtu that is 0, blocksize is fine.</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt; Hm, in that case I should add a check there to at least fail gracefully..</span></p>
<p></p>
<p>Ah, so the problem was that I was using hw.ubt0.config=0!</p>
<p></p>
<p><span style="color:#007000">&gt; &gt; Anyway hardcoding the mtu value (127) does not seem to work</span></p>
<p><span style="color:#007000">&gt; &gt; and I can hear only distortions.</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt; How did you hardcode that value? 127 is likely too large - did you read</span></p>
<p><span style="color:#008000">&gt; the CAVEAT section from ubt(4) and enable the USB isochronous data for</span></p>
<p><span style="color:#008000">&gt; ubt?  That should explain somewhat how to calculate a proper value (its</span></p>
<p><span style="color:#008000">&gt; suboptimal that we should have to do that, but I haven't worked out the</span></p>
<p><span style="color:#008000">&gt; real problem in the USB stack as yet)</span></p>
<p></p>
<p>I thought mtu was referring to net.bluetooth.rfcomm.mtu_default.</p>
<p></p>
<p><span style="color:#008000">&gt; The MTU retrieved from the socket will be the &quot;sco_mtu&quot; value as reported</span></p>
<p><span style="color:#008000">&gt; by btconfig - if this is still zero, then that is what the device is</span></p>
<p><span style="color:#008000">&gt; reporting and I'm not sure if setting it to a higher value will work</span></p>
<p><span style="color:#008000">&gt; properly. I understand that some older Belkin USB dongles (Broadcom 2035)</span></p>
<p><span style="color:#008000">&gt; had trouble with SCO data and report the value in this way.</span></p>
<p></p>
<p>I understand... I changed hw.ubt0.config to 1 and I got:</p>
<p></p>
<p>[juan@nocturno][~]&gt; sysctl -a|grep -E '(ubt|bluetooth)'</p>
<p>net.bluetooth.hci.sendspace = 259</p>
<p>net.bluetooth.hci.recvspace = 4096</p>
<p>net.bluetooth.hci.acl_expiry = 10</p>
<p>net.bluetooth.hci.memo_expiry = 600</p>
<p>net.bluetooth.hci.eventq_max = 20</p>
<p>net.bluetooth.hci.aclrxq_max = 50</p>
<p>net.bluetooth.hci.scorxq_max = 50</p>
<p>net.bluetooth.l2cap.sendspace = 4096</p>
<p>net.bluetooth.l2cap.recvspace = 4096</p>
<p>net.bluetooth.l2cap.rtx = 30</p>
<p>net.bluetooth.l2cap.ertx = 180</p>
<p>net.bluetooth.rfcomm.sendspace = 4096</p>
<p>net.bluetooth.rfcomm.recvspace = 4096</p>
<p>net.bluetooth.rfcomm.mtu_default = 127</p>
<p>net.bluetooth.rfcomm.ack_timeout = 20</p>
<p>net.bluetooth.rfcomm.mcc_timeout = 20</p>
<p>net.bluetooth.sco.sendspace = 4096</p>
<p>net.bluetooth.sco.recvspace = 4096</p>
<p>hw.ubt0.config = 1</p>
<p>hw.ubt0.alt_config = 6</p>
<p>hw.ubt0.sco_rxsize = 9</p>
<p>hw.ubt0.sco_txsize = 9</p>
<p>[juan@nocturno][~]&gt;</p>
<p></p>
<p>I start /etc/rc.d/btconfig:</p>
<p></p>
<p>[juan@nocturno][~]&gt; sudo /etc/rc.d/btconfig start</p>
<p>Configuring Bluetooth controllers: ubt0.</p>
<p>[juan@nocturno][~]&gt;</p>
<p></p>
<p>But can you explain with details how to calculate the SCO</p>
<p>packet size?</p>
<p></p>
<p>-- </p>
<p></p>
<p>http://plog.xtrarom.org/</p>
<p>Juan RP's blog - NetBSD/pkgsrc news in Spanish</p>
</body></html>
--Boundary-01=_JjEfFvDyHw8fAJh--