Last week was the midterm evaluations for GSoC and also the very same week when my patches were merged upstream into BlueZ. Most of the work was to adapt the existing Source functions to support both Source and Sink and to add Sink logic to the A2DP Server.
There is now a new Source interface on D-Bus, similar to the Sink interface, than can be used to access the Sink functionality. It may sound odd the Sink being accessed through an interface called Source, but in this case it actually acts as a sink on the air interface (receives audio stream from other bluetooth device) and as a source on the application interface (generates audio stream to applications).
Unfortunately, that’s not enough for one to be able to stream audio to a BlueZ device. Right now there is no client able to handle the incoming stream. The good news are that this is part 2 of my SoC project, to implement some clients outside BlueZ to handle this stream. I’m gonna start with PulseAudio, since I’ve implemented the bluetooth sink module on it last year and am more familiar with it’s implementation. After that, I’ll probably implement an ALSA client too.
So what’s the current implementation useful for? From an users perspective, not much. But it shows we are on the way to have it done. Right now it’s possible to connect to the audio sink and put it on STREAMING state, but it doesn’t know how handle the stream and disconnects after a few packets. I’ve tested it with two bluetooth adapter on my laptop and also trying to stream from an Android phone to the laptop.
The Source interface is disabled by default, so if want to test it, make sure to add an “Enable=Source” line to your audio.conf. The code is available on bluez git repo and will be on release 4.46.