[collected] A2DP BlueTooth Support.

Hi guys
despite what everyone says, this is quite possible using pulseaudio AND it works like a charm.

Why another input-device, you ask?:
Well, let me explain. I have a “braai room” (I am South African and over weekends EVERYBODY ‘braai’ or barbeque) that I have a small music system built into. What happens is my friends will inevetably try to get some sort of song listened to from a Cellphone (Smartphone). What I would like to do is give them the ability to connect to the device using BlueTooth technologies so that they can stream their ‘song’ without looking for cables or listening over a ‘cr@ppy’ celphone speaker.

that’s it
cyber7

Hi
I suggested the same thing awhile ago glad to see some support. This would be a great feature its unique and useful. And its doable…

Hi,

+1 for this feature.

Would be fantastic when ‘Android people’ coming to my place could play there music without installing 3rd party apps like BubbleUPnP. etc.

cheers,
lee

Hi All,

First thanks for your fantastic work.
And second, I add a +1 to this feature.

OK this is nice to play high quality music from a server but during barbecues or whatever parties, there is always a geek that have in his phone all the necessary music to put the “fire” on the dance floor. So Volumio should give the possibility to perform bluetooth direct connection between a smartphone and the Pi. I have already a bluetooth dongle on my Pi, just missing the code on Volumio to allow this nice function.

Could you have a look at this and post if you have this function planned in the next Volumio version ?

Thanks
Bleu

Bt is not on top of my priority list… But Spotify is, and guess this can be good for parties as well!!! :wink:

BT audio generally means you must have pulseaudio. I doubt we want to install pulseaudio in the pursuit of bit perfect streams, being lightweight…etc. It is possible to do BT with alsa using some code from this guy. That link has some pretty interesting discussion about the state of BT audio in linux. Here’s a link to his code. Someone put it up on Github too. I have complied and tested this code and it worked fine.

I don’t know if this is the best way to go about implementing BT audio since i imagine it would support the SBC protocol only. However that covers 99.9999% cases of use out there, it just is a lot more lossy than mp3 or apt-x protocols. Supporting other protocols might just be a matter of calling different libraries with the above code. That’s far outside of my programming abilities though. Perhaps the best solution would be to only use the portions of pulseaudio that are needed so this code is maintained by the pulseaudio project for us.

I think the real challenge in this project is writing some scripts to handle the pairing of new devices and to call the above software when playback is desired. All in all, it would not be too bad. Though i could see needing to add a soft button in the webui to pair new devices.

Hi everyone,

I’m also interested about the A2DP support. Any news? If I’m not wrong Volumio is based on Debian and the latter supports A2DP wiki.debian.org/BluetoothUser/a2dp. What is missing in Volumio in order to support it? I could help to implement the feature.
Thank you

I recently played around with this a bit and found a few things. Volumio appears to be based on debian testing or newer version of debian. What matters about that is the the bluez (bluetooth stack) is a version greater than 5.0. As I understand it, bluez changed a fair amount when it went from 4.x to 5.x. As you mentioned, A2DP is still supported but it is supported through pulseaudio. Pulseaudio is the dominant sound server in linux. Its main purpose is to mix audio from all applications together and then spit it out to a ALSA driver that then interacts with hardware. The main problem with pulseaudio for our application is that it resamples audio by default, which makes bit perfect audio impossible, it wants to take over the sound card when it is running, and its fairly large install size for what it is. This is about as far as i got though.

What needs to happen next is to install pulseaudio in a way that it doesn’t take over all sound duties so we can still output audio directly to ALSA when not using bluetooth. This more than likely would be through a set of scripts that run when bluetooth devices connect. These would launch pulseadio, setup the various loop back devices that are needed to link the incoming audio stream to the sound card. There would be another script that shuts down pulseaudio when bluetooth playback is done.

The other thing that would need to be sorted out is how to handle pairing of new devices. You’d either need a pair button in the web interface or to run some software to always enable pairing.

so yes it is possible, but it is a matter of putting the bits together in the right way.

Any news? On which version of Debian is based Volumio?

cat /etc/apt/sources.list deb http://mirrordirector.raspbian.org/raspbian/ jessie main deb-src http://mirrordirector.raspbian.org/raspbian/ wheezy main

looks like jessie for packages and wheezy for source code. I think perhaps thats a mistake. Anyways the packages are Debian Jessie so the system is, which is currently Debian testing.

As for status, i am interested in making this work, but I have many other things going on so i am unlikely to get to it.

I would like to top up this feature request. I think it would be very useful feature.

I would love too. I will put myself at work after Volumio2 will be released…

Thank you! Can’t wait for 2 and eventually Bluetooth!

Would be great to add Bluetooth to Volumio and have the ability to disable pulseaudio when not in use to keep good audio quality.

In the meanwhile, I’ll use OSMC (follow this guid to enable bluetooth A2DP : instructables.com/id/Enhance … th-Blueto/ ) when I need to stream music through bluetooth.

Thanks for your work.

+1

Heaving bluetooth in volumio would be great.

I’m currently using some older Rasbian where I (<-- /me aka. bluetooth-&linux-sound-noob) somehow managed to run the RasPi as a bluetooth receiver - thou it is via pulseaudio…

However: while googling I came across this post: lightofdawn.org/blog/?viewDetailed=00032 . He managed to directly connect bluetooth to alsa (without pulseaudio). His C-Code is for Bluez 4, but he claims it should be easily adaptable to Bluez 5. Dunno - but maybe this helps…

Cheers,
Jochen

I managed to get a working A2DP sink based on Volumio2 Alpha6 that connects via PIN code without any interaction on the volumio side. The only thing I can’t achieve is remote volume control via the source device. However I’m not sure whether this due to my setup, my iPhone or the used bluez version.

If anyone can explain or hint me at a docu on how to include it in Volumio2 or make it a plugin (maybe even better) I’d be willing to contribute.

Want to support the wish for bluetooth input with the good news You might already have read:

Raspi 3 will have WLAN and BLUETOOTH onboard!

I´d really apreciate bluetooth included because my digital X-over has only two digital inputs, disc player and streamer use these. And I repeat, what others have already said: this is for visitors, it´s not obligatory hi-end quality as in “normal” streaming mode, even though it would be great.

So Michelangelo, let Your heart be moved…

Hi,
since volumio 2 has been released. Are there any updates about this interesting feature?

Have you read https://volumio.github.io/docs/?
Let me know if you need some help.

Fightclub could you share how you did that? As it was previously mentioned, we need to do it without pulse… Just good old alsa…

I successfully installed bluetooth on my pi running Volumio 2.
I wrote a short guide how I managed to do do…github.com/karaambaa/a2dp-bluetooth-server

I hope it helps, I think it should be possible to use expect instead of python and pexpect

By the way, thank you for all the effort you put into maintaining and improving Volumio :smiley: