Donate Share

Bluetooth alsa

Tracker: Patches

5 Allow multiple A2DP audio streams - ID: 1844643
Last Update: Comment added ( jlinton )

This patch provides basic support for multiple simultaneous audio streams
to multiple A2DP headphones. It is against the current version in CVS Dec
4,2007

Multiple stream support is configured by adding multiple stanzas to the
alsa .asoundrc file like:

pcm.a2dpd2 {
type a2dpd
socket "/tmp/a2dpd2"
}


pcm.a2dpd3 {
type a2dpd
socket "/tmp/a2dpd3"
}

pcm.a2dpd4 {
type a2dpd
socket "/tmp/a2dpd4"
}


This provides three streams called a2dpd2, a2dpd3 and a2dpd4 (in xmms you
put these names in the audio device field for the alsa output plugin), each
stream needs a unique socket name, so they are also specified.

Then multiple a2dpd daemons are started like:
`a2dpd -f ~/.a2dpdX` where each daemon has a unique configuration file.

Each configuration file then lists the headphone it uses, as always, with
the `address=` line.

Two additional parameters must be added though. First is the socket and the
second is the bluetooth dongle address.

They are specified like:

# the unix socket name for this daemon to communicate on.. defaults to
/tmp/a2dpd if not specified.
socket=/tmp/a2dpd2
# the host address to bind this device to
hostaddress=00:15:83:C3:70:93

The socket address specified here must match the one in the .asoundrc file.


The dongle address is required because the streams will skip if played
through the same BT dongle. Adding additional BT dongles, solves this
problem. If there are multiple dongles though, each headphone must be bound
to one of the dongles otherwise they will all default to running on a
single one.

This brings up an additional problem, pairing. At a minimum the headphone
must be paired with the dongle specified with the hostaddress field. This
can be done by passing the -i hciX option to hcitool. I'm not sure but the
headphones probably also need to be paired with the default BT dongle for
the service discovery phase. You may have to experiment with this. I have
some more code which updates the SDP phases to use the specified dongle,
but in my case it seems to work ok without it, and this patch doesn't
include it.


Finally, there is a new environment variable that may be set before loading
the daemon 'A2DPD_SERVICE_NAME=a2dpd?` which sets the d-bus service name to
something other than a2dpd.


Nobody/Anonymous ( nobody ) - 2007-12-05 05:27

5

Open

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )




Date: 2007-12-05 05:30
Sender: jlinton


Dope I forgot to login...

If you have any questions they may be sent to this account.




Log in to comment.

Attached File ( 1 )

Filename Description Download
multistream-patch Allow multiple A2DP audio streams to multiple headphones Download

Change ( 1 )

Field Old Value Date By
File Added 257320: multistream-patch 2007-12-05 05:27 nobody