From: Lars Grunewaldt <lgw@dark-reality.de>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] snd-bt-sco development teamup | ALSA connection
Date: Tue, 10 Aug 2004 16:21:33 +0200 [thread overview]
Message-ID: <4118D9ED.4030705@dark-reality.de> (raw)
In-Reply-To: <1092145515.4564.143.camel@pegasus>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Marcel Holtmann wrote:
| Hi Lars,
|>BlueZ stuff:
|>- - connection handling (should this be solved like in the hidd daemon?)
|
|
| the connection handling is the AT based stuff of the headset or
| handsfree profile and that can be done in a headset/handsfree profile
| daemon. The hidd is different, because it has to move the L2CAP sockets
| into the kernel space. We don't need this here.
Well, I just ment from the user perspective, and it really looks nearly
identically to me. Of course what happens in the kernel is TOTALLY
different!
I agree with most other stuff you wrote, it was the same that I meant.
|>Alsa stuff:
|>- -provide alsa information like supported audio encodings
|
| the current settings of the SCO links are stored as voice_setting in the
| hci_dev structure.
|
Great. Not usable until the alsa module has read it from hci_dev and
reformatted it, so that an alsa application can make use of this
information. Yes? :)
|>- -notice the BlueZ module if some program looks for a connection
|
| If you mean with that when someone opens the DSP device we should create
| the connection, then this will fail. The RFCOMM channel must be created
| first and this is part of the connection handling from userspace. The
| kernel can't do anything here.
Uh, now this gets complicated. We should try to speak in the same terms.
I'm pretty sure it's my fault, but I'm a bit new to this stuff.
|>It would be great if a device (headset) could be connected somehow
|>(tool) manually like hidd --connect <BTADDR>; in this case, an RFCOMM
|>connection will be build.
|>
|>The bluez module than notices the alsa module that there spawned a new
|>device, telling alsa module what codecs to propagate (this should be
|>possible because something similar works for usb audio stuff with
|>hotplugging).
|
|
| The general workflow should be something like this:
|
| - create RFCOMM channel and start AT handling
| - create SCO socket if needed
| - issue ioctl to make SCO socket an ALSA device
|
| At this point the SCO packets would go from the HCI device to the ALSA
| layer without userspace intervention and the userspace program has only
| to take care of the AT handling.
Yes, that is what I meant, of course. But we should line out who (which
code/program) does what, because this is the main reason for
misunderstanding right now.
Please, let me try it again:
[STRUCTURE]
so we get three parts, bluez kernel (BZ), user space daemon (USD) and
alsa driver (AD).
kernel/bluez kernel stuff (BZ):
This part resides in the kernel. It already does. It handles what
happens to the devices, i.e. converts the SCO device into an alsa device
node on request. It builds (not requests!) the connections for RFCOMM
and SCO (of course, that is what it does now too).
user space daemon (USD):
requests headset RFCOMM connect (from the user, like "bthsd --connect
<BTADDR>" or something alike, just an example) and handles the AT
commands. This is what our btsco program does right now, but I'd like to
have a real daemon here that is once started and then runs totally in
the background. Most AT handling that is needed is already implemented.
alsa driver (AD):
the alsa-specific stuff, like reporting to alsa applications what
channels exist, what audio props they have and so on
[INTEROPERABILITY]
There are two main sources that may demand things and that must be
supported:
1. the headset: if the user presses the button, an AT is send. This must
be caught by USD, that opens the SCO connection in the usual way. Now
some ioctl kernel mojo happens to make the SCO connection usable for
alsa programs (I'm not sure how it works, but is sounds easy)
2. the AD itself: a program might open the audio channel, than the AD
must notice the USD (or BZ?) to ring the headset bell so the user
notices, or open the SCO channel directly, depending on configuration;
also we must be able to change volume and stuff.
those two must be able to communicate in some way. The HS sends AT
commands that are handled by the USD, but how can the alsa driver i.e.
request an channel open? Or, from whom (USD or BZ?)
|>I see some problems when an application opens and closes the audio
|>channel rapidly (gnomemeeting does this when playing the ring sound);
|>maybe we could implement something like a release timeout before the SCO
|>connection is truely terminated.
|>
|>My main issue with the current implementation is that if no SCO
|>connection is open, the audio device is simply blocked. Bad habit; it
|>must look transparent for the application, whether there is a BT headset
|>connected to the stack or not, the device should be available (I think).
|>Most programs check device state on startup, and the headset might not
|>be connected at that time by the user.
|
|
| This is not as easy as you think. Lets discuss this later.
Of course it's not that easy, but concerning the device existing problem
the device is reported by the alsa driver, and that one does not depend
on an existing RFCOMM connection or something, so it should be possible
to load the "snd-bt-sco" alsa module (like it is now) so the program
thinks that the driver exists. Audio data should be taken from /dev/null
or something alike to make sure the application does not break when
trying to access the dummy device.
Of course this should not be our first concern, but I think it's a good
idea to think of such things before beginning development...
cu,
~ Lars
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBGNnsQWC6DTWkDAoRAvENAJ9bst1uL+oDjFXM/V9ioCzzcklgCgCffTVQ
8FDDQp18ZuM3j3w/KTHvdps=
=gqoc
-----END PGP SIGNATURE-----
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2004-08-10 14:21 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-09 16:51 [Bluez-devel] snd-bt-sco development teamup Lars Grunewaldt
2004-08-09 17:09 ` Marcel Holtmann
2004-08-09 17:12 ` Lars Grunewaldt
2004-08-09 17:39 ` Marcel Holtmann
2004-08-09 18:21 ` James Courtier-Dutton
2004-08-09 22:26 ` Marcel Holtmann
2004-08-09 23:53 ` Lars Grunewaldt
2004-08-10 12:14 ` Marcel Holtmann
2004-08-10 12:53 ` James Courtier-Dutton
2004-08-10 13:39 ` Jonathan Paisley
2004-08-10 14:26 ` Carl Orsborn
2004-08-10 14:48 ` Marcel Holtmann
2004-08-10 15:31 ` Jonathan Paisley
2004-08-11 8:58 ` Roderick Taylor
2004-08-11 6:40 ` Marcel Holtmann
2004-08-10 15:51 ` James Courtier-Dutton
2004-08-10 18:43 ` Jonathan Paisley
2004-08-10 19:22 ` Carl Orsborn
2004-08-10 12:56 ` [Bluez-devel] snd-bt-sco development teamup | ALSA connection Lars Grunewaldt
2004-08-10 13:45 ` Marcel Holtmann
2004-08-10 13:53 ` [snd-bt-sco] " Jonathan Paisley
2004-08-10 14:36 ` Marcel Holtmann
2004-08-10 14:39 ` Jonathan Paisley
2004-08-10 14:21 ` Lars Grunewaldt [this message]
2004-08-10 15:01 ` Marcel Holtmann
2004-08-10 16:02 ` Lars Grunewaldt
2004-08-10 14:53 ` James Courtier-Dutton
2004-08-10 13:03 ` [Bluez-devel] snd-bt-sco development teamup Jonathan Paisley
2004-08-10 13:11 ` Marcel Holtmann
2004-08-10 13:18 ` Lars Grunewaldt
2004-08-10 13:20 ` Jonathan Paisley
2004-08-10 13:22 ` Lars Grunewaldt
2004-08-10 13:54 ` James Courtier-Dutton
2004-08-10 13:28 ` Marcel Holtmann
2004-08-10 13:40 ` James Courtier-Dutton
2004-08-10 13:49 ` Marcel Holtmann
2004-08-10 14:07 ` James Courtier-Dutton
2004-08-10 14:34 ` Marcel Holtmann
2004-08-10 15:15 ` James Courtier-Dutton
2004-08-10 15:25 ` Marcel Holtmann
2004-08-10 16:46 ` James Courtier-Dutton
2004-08-10 22:58 ` Marcel Holtmann
2004-08-10 11:48 ` Lars Grunewaldt
2004-08-10 12:08 ` Marcel Holtmann
2004-08-10 12:40 ` Lars Grunewaldt
2004-08-10 13:03 ` Marcel Holtmann
2004-08-10 13:10 ` Lars Grunewaldt
2004-08-10 13:30 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4118D9ED.4030705@dark-reality.de \
--to=lgw@dark-reality.de \
--cc=bluez-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.