[Deprecated] [TESTING] Bluetooth audio streaming (A2DP)

Hello @sam_nazarko,
First of all - thanks for your great job!
As far as I know A2DP protocol is limited to stereo output (correct me if I’m wrong) but if we combine couple of bluetooth modules and something like [JACK][1] or something like described in [this forum][2] can we create wireless multichannel surround system where every channel is streamed separately?

P.S. That is only crazy idea nothing else :wink:
[1]: What is JACK - Community Help Wiki
[2]: sound - How to redirect single audio channels to different devices? - Ask Ubuntu

1 Like

I have worked out a way to allow Bluetooth audio streaming from Kodi as well without breaking other user’s systems:

Sam

3 Likes

Nice job, looks good.

Will apt-get upgrade get this version?

Cheers

1 Like

Yes

When it’s released in the next update, yes. But we recommend you update via My OSMC.

Sam

@sam_nazarko

xbmc can load both pulse/alsa sinks and the same time, just swap the order of enumerating the audio (alsa 1st, pulse after) because pulse tends to lock the device so xbmc would be (sometimes) not able to see the alsa sinks during load.

Yes, you can load multiple CAESink() at the same time, but I don’t think PulseAESink is actually needed at all, because ALSA has a plugin to it. The issue is more that if Pulse is enabled, user may accidentally select it and not take advantage of Passthrough etc.

You are right about order swapping though: if you look at Pi, which is PiSinkAE, it never allows Pulse to be set as default device. But, the main issue is that the PulseAudio output is being picked up by CAESinkALSA, not CAESinkPulse.

Sam

Understood. If you want any further testing of the release candidate, let me know.

I will wait for the next release!

Cheers

A further update – while we’re now filtering devices correctly, ALSA sinks are not always properly enumerated on some platforms (Vero, AppleTV), so we won’t be including this in the October update.

Sam

hi sam,

I’ve tried this with my two iphones, both had pairing problem:

On OSMC it shows always “working …”.
On one of my iphone it poped out dialog to ask me for the approval of pairing. I clicked “accept” then it showed on my iphone “pairing failed”.

Should I try again and give you more detailed information?

Zhou

There are known problems with some types of Bluetooth pairing in the networking GUI that have been fixed - try again after installing tomorrows update.

Right now I’m listening to audio from OSMC on my Bose bluetooth speaker. My BT dongle is from Modmypi. The audio is the radio streamed from another OSMC (TVHeadend using Sundtek USB DVB-T).

Sound quality much better than the BT transmitter that I was using connected to HDMI audio out. Pairing doesn’t seem to be any problem so far. Though, I think I need to have the BT speaker on before power-up OSMC.

I use this for the radio all day everyday, so if there are any issues, then I should have some helpful feedback within a few days.

Thanks Sam…!

Best regards,
Niall.

Are your speakers automatically connect after a reboot? Seems after a reboot I have to manually connect them once with bluetoothctl after that they connect automatically when I switch them on/off

ok, so I did a reboot and it didn’t come back :frowning:

My BT speaker turned from white to blue, Then with OSMC
I did re-connect, and that worked fine (blue turned to white on BT speaker).

But still no audio.

Eventually, I got it back.
But I needed to set the Audio back to HDMI, then reboot, then re-connect BT,
then set the Audio to Bluetooth.

Now it’s all fine again :smile:

Hi,

Love this! I’ve spent ages with a naff (and it was expensive) A2DP dongle plugged into a 3.5mm in order to output to BT speaker.

So things I’ve noticed, I’m sure most of them are knowns.

I can stream in from one bluetooth source and out to another, so bandwidth available for 2 paired devices both pushing stereo audio.

Once the incoming bluetooth sink is latched to an output it can’t be software swapped, ie if set to output to BT speaker, switching back to HDMI manually causes the audio to drop until you break the incoming link and reconnect. However, if you switch the BT speaker off it will fallback to HDMI audio, even though it’s not set to it.

Once the BT speaker has been connected it will disconnect and reconnect happily when switched on and off. The settings will switch HDMI to BT and back fine, and disconnecting/reconnecting speaker fails over and relinks fine if you’ve left the setting on ALSA. Both the incoming phone and the outgoing speaker needed a forced connect after boot. For the speaker this was by “re-connecting” in “My OSMC-Network”, for the phone I was able to trigger the connect by turning off and back on the “Throw” feature.

The Bluetooth Adapter is Cambridge Silicon Radio chipset. Amazon.co.uk

The speaker is Bose Soundlink III, phone input is Sony Z3C.

Happy to answered/try more if required.

Please could this add-on package remain available if the main features don’t get integrated into OSMC, the A2DP out to speaker is something I’ve needed for ages.

Thanks

Ant

At the moment when you reboot OSMC it will not automatically attempt to reconnect to a Bluetooth speaker that is paired even if it is turned on. (You must choose connect in Bluetooth settings)

We’re aware of this but I’m not sure what the solution is at the moment.

I think we can life with the connect after reboot for the time being as reboot is not happen too often on the PI.
For the time being I have put echo -e 'connect 08:DF:1F:21:CB:03 \n' | bluetoothctl into reboot cron.

Of course it would be better to automatically re-connect
at boot if possible. But OSMC is left powered on all the time, so rebooting
should be fairly rare.

This morning, I just turned on my BT speaker, and it was still
connected to OSMC. When I played the audio, it still worked from yesterday :smile:
(I didn’t turn off OSMC).

I’ve know I’ve said this already … but this is a really great feature and the
sound is a really big improvement compared with using a BT transmitter with 3.5mm jack audio.

Thanks.
Best regards,
Niall.

Yes, you can use bluetoothctl to trigger a reconnect but that is a bit of a hack, I mean I’m not sure what the correct/elegant solution is at the moment. BTW this should work just fine:

bluetoothctl connect 08:DF:1F:21:CB:03

No need to pipe the command to it…

Nope, that just jumps into the command line mode

osmc@osmc.hongkong:~$ bluetoothctl connect 08:DF:1F:21:CB:03
[NEW] Controller 00:11:67:00:00:00 osmc.hongkong [default]
[NEW] Device 08:DF:1F:21:CB:03 Bose Mini SoundLink
[bluetooth]#