2006-07-07 15:59:16

by Frédéric DALLEAU

[permalink] [raw]
Subject: [Bluez-devel] Alsa plugin for A2DP daemon

Hi all,

I've been working with Brad's a2dp plugin for some time now. I =

hacked it with the idea of having an ipc alsa plugin and an audio daemon =

and guess what : today, I have something working pretty well. It fully =

separate the application and the headset (tcp used for ipc). Thus, you =

can let the application play audio while having the heaset switched off. =

Switch on the headset and you will start hearing sound. It also permit =

having lots of applications using the headset at a time and yes, sound =

is mixed. You can crash and restart the daemon without interrupting the =

app. Reverse is possible too.
Drawbacks : some ticks in the sound, Tcp may give additionnal burden =

but for now it seems far from being cpu intensive (if you consider Xeon =

as being a representative cpu ;).

Brad, to do this, I only modified file Makefile.am and added new =

source code files in the 'alsa-plugins' folder. It will setup next to =

the original alsa-plugin. Is is called pcm_a2dpd.c. The archive also =

contain a modified version of pcm_a2dp.c that receives connections on =

the control socket.

You can get a full archive there http://fdalleau.free.fr/btsco.tar.gz
I would love to have someone try it on an ARM platform. Next step =

is volume control!

Hope you like it! Documentation follow

Fr=E9d=E9ric




To build
-----------
bootstrap && ./configure --enable-alsaplugin && make && sudo make =

install
You may have to create a symbolic link as I had : sudo ln -s =

/usr/local/lib/alsa-lib /usr/lib/alsa-lib


To run
----------
Your headset must be paired.
create .asoundrc if you do not have one that contain the following =

(don't forget backup previous one)
pcm.!default {
type a2dpd
bdaddr "00:11:22:33:44:55"
}

pcm.a2dpd {
type a2dpd
bdaddr "00:11:22:33:44:55"
}
This bluetooth address is needed but not used. Put something that =

looks like a bluetooth address.

restart alsa with : /etc/init.d/alsa-utils restart

start your favorite media player configure it to play with alsa, and =

press play!

Oops, we forgot to start the daemon... No problem. Go in the =

alsa-plugins subfolder of the archive and type : a2dpd AA:BB:CC:DD:EE:FF.
where AA:BB:CC:DD:EE:FF is the bluetooth address of your device. =

Now, switch on your headset. Ctrl-C will quit the daemon.

Try to keep with 16bits/stereo sounds!

Remove the .asoundrc to restore your sound!



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easi=
er
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D1=
21642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2006-07-12 05:56:46

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] Alsa plugin for A2DP daemon

Fr=E9d=E9ric

I've been trying out your mixer/ipc server. It is a great step forward,
so I have committed it to our project.

> I've been working with Brad's a2dp plugin for some time now. I =

> hacked it with the idea of having an ipc alsa plugin and an audio daemon =

> and guess what : today, I have something working pretty well. It fully =

> separate the application and the headset (tcp used for ipc). Thus, you =

> can let the application play audio while having the heaset switched off. =


using this server I can finally launch gxine with my r35 set. gxine
rapidly opens/closes the audio device several times in a row and that
gives the headset trouble without your server in the middle.

> Switch on the headset and you will start hearing sound. It also permit =

> having lots of applications using the headset at a time and yes, sound =

> is mixed. You can crash and restart the daemon without interrupting the =

> app. Reverse is possible too.

Do you have something in mind for routing audio to the speakers when the
bluetooth headset is not available or if the user chooses to disable it?

Is a2dpd starting the connection to the headset on demand? If you do go
that route, make sure it holds the connection open for a few seconds
after the last client closes it.

> Drawbacks : some ticks in the sound, Tcp may give additionnal burden =

> but for now it seems far from being cpu intensive (if you consider Xeon =

> as being a representative cpu ;).

these ticks are the sound you usually get when packets are sent too
quickly. so the audio using gxine has a bit of a delay and the pitches
of everybody's voices are too low. seems like a straightforward timing
issue.

Brad


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easi=
er
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D1=
21642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-07-11 17:54:22

by Fabien Chevalier

[permalink] [raw]
Subject: Re: [Bluez-devel] Alsa plugin for A2DP daemon



Terrific work !! :-)

Just a tip: maybe you could use UNIX sockets to remove TCP burden.

Cheers,

Fabien

> Hi all,
> =

> I've been working with Brad's a2dp plugin for some time now. I =

> hacked it with the idea of having an ipc alsa plugin and an audio daemon =

> and guess what : today, I have something working pretty well. It fully =

> separate the application and the headset (tcp used for ipc). Thus, you =

> can let the application play audio while having the heaset switched off. =

> Switch on the headset and you will start hearing sound. It also permit =

> having lots of applications using the headset at a time and yes, sound =

> is mixed. You can crash and restart the daemon without interrupting the =

> app. Reverse is possible too.
> Drawbacks : some ticks in the sound, Tcp may give additionnal burden =

> but for now it seems far from being cpu intensive (if you consider Xeon =

> as being a representative cpu ;).
> =

> Brad, to do this, I only modified file Makefile.am and added new =

> source code files in the 'alsa-plugins' folder. It will setup next to =

> the original alsa-plugin. Is is called pcm_a2dpd.c. The archive also =

> contain a modified version of pcm_a2dp.c that receives connections on =

> the control socket.
> =

> You can get a full archive there http://fdalleau.free.fr/btsco.tar.gz
> I would love to have someone try it on an ARM platform. Next step =

> is volume control!
> =

> Hope you like it! Documentation follow
> =

> Fr=E9d=E9ric
> =

> =

> =

> =

> To build
> -----------
> bootstrap && ./configure --enable-alsaplugin && make && sudo make =

> install
> You may have to create a symbolic link as I had : sudo ln -s =

> /usr/local/lib/alsa-lib /usr/lib/alsa-lib
> =

> =

> To run
> ----------
> Your headset must be paired.
> create .asoundrc if you do not have one that contain the following =

> (don't forget backup previous one)
> pcm.!default {
> type a2dpd
> bdaddr "00:11:22:33:44:55"
> }
> =

> pcm.a2dpd {
> type a2dpd
> bdaddr "00:11:22:33:44:55"
> }
> This bluetooth address is needed but not used. Put something that =

> looks like a bluetooth address.
> =

> restart alsa with : /etc/init.d/alsa-utils restart
> =

> start your favorite media player configure it to play with alsa, and =

> press play!
> =

> Oops, we forgot to start the daemon... No problem. Go in the =

> alsa-plugins subfolder of the archive and type : a2dpd AA:BB:CC:DD:EE:FF.
> where AA:BB:CC:DD:EE:FF is the bluetooth address of your device. =

> Now, switch on your headset. Ctrl-C will quit the daemon.
> =

> Try to keep with 16bits/stereo sounds!
> =

> Remove the .asoundrc to restore your sound!
> =

> =

> =

> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job ea=
sier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=
=3D121642
> _______________________________________________
> Bluez-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
> =

> =




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easi=
er
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D1=
21642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-07-07 19:18:59

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] Alsa plugin for A2DP daemon

Fr=E9d=E9ric

> You can get a full archive there http://fdalleau.free.fr/btsco.tar.gz
> I would love to have someone try it on an ARM platform. Next step =

> is volume control!

this sounds great. I will have a look.

I do have a gumstix board I can try this with. I just have to hunt down
a change on their side that broke the btsco cross-compile.

Brad


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easi=
er
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D1=
21642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel