2008-03-25 12:01:31

by Paul

[permalink] [raw]
Subject: [Bluez-users] ACL connection handle

Hi,

I have a bluetooth module in which there is an option to select the
interface (HCI or PCM) for the next SCO connection.This is done by sending
an HCI command .So I can use hcitool cmd option right? From the manual of
the BT module I figured out the OCF and OGF of the command, now on the
parameter part it requires the ACL connection handle.
How I can I find out the connection handle for a particular connection?
Usually when I do a file transfer or try to play through the HCI
interface,hcidump shows

< ACL data: handle 256 flags 0x02 dlen 8

So can I use 256 in place of the ACL connection handle in the HCI command?
Thank you for your time and consideration,
Regards,
Matt


Attachments:
(No filename) (689.00 B)
(No filename) (897.00 B)
(No filename) (228.00 B)
(No filename) (164.00 B)
Download all attachments

2008-03-28 03:05:24

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-users] ACL connection handle

Marcel

As a straw man for the sco routing, would the socket option look
anything like this? I'm assuming that the driver would report a socket
connect failure if you specify a route that the driver can't do.

--- sco.h.orig 2007-12-24 10:01:18.000000000 -0700
+++ sco.h 2008-03-27 20:57:44.000000000 -0600
@@ -45,8 +45,12 @@

/* set/get sockopt defines */
#define SCO_OPTIONS 0x01
+#define SCO_ANYROUTE 0x00
+#define SCO_HCIROUTE 0x01
+#define SCO_PCMROUTE 0x02
struct sco_options {
uint16_t mtu;
+ uint8_t route;
};

#define SCO_CONNINFO 0x02

--
Brad

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2008-03-27 15:10:32

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] ACL connection handle

Hi Brad,

>> shouldn't be a big problem, but in general this belongs into the
>> kernel since userspace is not dealing with ACL and SCO/eSCO
>> connection
>> handling.
>
> I'll agree it would be cleaner in kernel. If it's to be handled in the
> kernel then I think we need some way like an ioctl so the userspace
> app can tell the kernel, before opening the sco connection, whether it
> should happen on pcm or hci. It would be handy to have a way for the
> app to ask the kernel where sco is going, in case the preferred
> transport wasn't available.

we would need to push the actual code into the drivers since the core
has to stay vendor free. For selecting the routing we could use a
socket option.

Regards

Marcel


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2008-03-27 03:43:30

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-users] ACL connection handle

Marcel

> shouldn't be a big problem, but in general this belongs into the
> kernel since userspace is not dealing with ACL and SCO/eSCO connection
> handling.

I'll agree it would be cleaner in kernel. If it's to be handled in the
kernel then I think we need some way like an ioctl so the userspace
app can tell the kernel, before opening the sco connection, whether it
should happen on pcm or hci. It would be handy to have a way for the
app to ask the kernel where sco is going, in case the preferred
transport wasn't available.

--
Brad

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2008-03-26 16:27:38

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] ACL connection handle

Hi Brad,

>> I am using the infineon.When I play through the uart, I will give
>> -D
>> bluetooth option to aplay and this will create an acl as well as
>> sco
>> connection and route audio through uart.But if I am using the pcm
>> interface
>> , I will route audio to the pcm interface on the host connected
>> to the bt
>> module and use aplay without the bluetooth option right?,So I have
>> to create
>> an acl connection and then use the hcitool cmd to switch the SCO
>> interface
>> before I do aplay .So is that necessary to give the command from
>> inside the
>> audio service ?How would I establish the acl connection? Can I use
>> rfcomm
>> connect ?
>
> The bt alsa plugin does only make sense when getting audio over hci,
> but the audio service was designed so you could use d-bus to make it
> negotiate the connection and then get the audio through another route,
> eg the pcm.
>
> You could run the bluetooth negotiation yourself when going through
> pcm, but it would be better use of the infrastructure to patch the
> audio service so it can be used for both the pcm and hci cases. iirc,
> the audio service assumes you'll use one kind of routing the whole
> time you run it, so that would have to be changed to be a runtime
> setting set through d-bus.
>
> The audio service might be patched to, for example, invoke an external
> program between establishing the acl and sco connections. that could
> take an acl handle and do the infineon magic.
>
> I'm not sure there is a way to pull this off in a way that Marcel
> would accept upstream, but even if you have to do a custom patch to
> the audio service to make it work the way you need it I think you'll
> be able to pull it together more quickly.

shouldn't be a big problem, but in general this belongs into the
kernel since userspace is not dealing with ACL and SCO/eSCO connection
handling.

Regards

Marcel


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2008-03-25 14:39:33

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-users] ACL connection handle

Matt

this would be a good topic for bluez-devel. Are you subscribed over there?

> I am using the infineon.When I play through the uart, I will give -D
> bluetooth option to aplay and this will create an acl as well as sco
> connection and route audio through uart.But if I am using the pcm interface
> , I will route audio to the pcm interface on the host connected to the bt
> module and use aplay without the bluetooth option right?,So I have to create
> an acl connection and then use the hcitool cmd to switch the SCO interface
> before I do aplay .So is that necessary to give the command from inside the
> audio service ?How would I establish the acl connection? Can I use rfcomm
> connect ?

The bt alsa plugin does only make sense when getting audio over hci,
but the audio service was designed so you could use d-bus to make it
negotiate the connection and then get the audio through another route,
eg the pcm.

You could run the bluetooth negotiation yourself when going through
pcm, but it would be better use of the infrastructure to patch the
audio service so it can be used for both the pcm and hci cases. iirc,
the audio service assumes you'll use one kind of routing the whole
time you run it, so that would have to be changed to be a runtime
setting set through d-bus.

The audio service might be patched to, for example, invoke an external
program between establishing the acl and sco connections. that could
take an acl handle and do the infineon magic.

I'm not sure there is a way to pull this off in a way that Marcel
would accept upstream, but even if you have to do a custom patch to
the audio service to make it work the way you need it I think you'll
be able to pull it together more quickly.

--
Brad

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2008-03-25 13:00:12

by Paul

[permalink] [raw]
Subject: Re: [Bluez-users] ACL connection handle

Brad,
I am using the infineon.When I play through the uart, I will give -D
bluetooth option to aplay and this will create an acl as well as sco
connection and route audio through uart.But if I am using the pcm interface
, I will route audio to the pcm interface on the host connected to the bt
module and use aplay without the bluetooth option right?,So I have to
create an acl connection and then use the hcitool cmd to switch the SCO
interface before I do aplay .So is that necessary to give the command from
inside the audio service ?How would I establish the acl connection? Can I
use rfcomm connect ?

Thanks again for your time,
Regards,
Matt.

On Tue, Mar 25, 2008 at 5:46 PM, Brad Midgley <[email protected]> wrote:

> Paul/Matt
>
> > I have a bluetooth module in which there is an option to select
> the
> > interface (HCI or PCM) for the next SCO connection.This is done by
> sending
> > an HCI command .
>
> the infineon works this way. I believe the timing of this hci command
> (after establishing acl, before establishing sco) will require the
> code to be invoked from inside our audio service.
>
> --
> Brad
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Bluez-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>


Attachments:
(No filename) (1.52 kB)
(No filename) (2.15 kB)
(No filename) (228.00 B)
(No filename) (164.00 B)
Download all attachments

2008-03-25 12:16:20

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-users] ACL connection handle

Paul/Matt

> I have a bluetooth module in which there is an option to select the
> interface (HCI or PCM) for the next SCO connection.This is done by sending
> an HCI command .

the infineon works this way. I believe the timing of this hci command
(after establishing acl, before establishing sco) will require the
code to be invoked from inside our audio service.

--
Brad

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users