I found some solutions to use raspberry as bluetooth client to play audio. For example, to play music from phone to raspberry via bluetooth.
But I didn’t find any solution to push audio from KODI to bluetooth speakers. It would be nice, if KODI could recognize bluetooth audio device automatically and start streaming music to bluetooth device. I would like to use USB dongle for bluetooth transmitter connected to raspberry so the raspberry can simultaneously play via bluetooth and audio output. Is ti possible?
Note that this solution (it’s probably the only one) uses PulseAudio which is said to have less audio quality. After following that guide, Kodi will also playback via PulseAudio.
With the speakers I have, the difference will probably not be noticable but I thought you should know
Yes I know but this is only detailed described solution that I manage to found. So if you can suggest something different I will be very happy to try it.
once you are on bluetoothctl app, just make this
agent on
default-agent
scan on wait for your device to show and make it discoverable
then
trust YOURMACADR
pair YOURMACADR
connect YOURMACADR (i think you can direct connect your device, but without trust it, it won’t reconnect at reboot)
Then when bluetoothctl says you’re connect, you have to select via KODI Options the audio output Pulse !
And that work ,
no need to edit some files or thing in the system, all is already here !
sorry for my poor english , that’s not my tongue ! i’ll do my best
Thanks Glou.
This looks easy but if I understood you right… If I want to stream music to bluetooth speakers, raspberry must be paired and connected to bluetooth speakers and output device in KODI must be set to Alsa…
My point is, to select output channel on the fly for example: to point to music file in KODI and select to stream to bluetooth speakers from context menu. Or even better… If I switch on bluetooth speaker, KODI starts to stream audio to bluetooth speakers else KODI play music via audio jack on raspberry.
oh, i haven’t even think about it for my media center !
i will try marcopi’s solution tonight , i think that would be cool if it works !
And maybe that would share my bluetooth audio from my retrosmc addon !
I´m trying to use my Samsung bluetooth headphones.
Was follwing the guide in the 2nd post. Please notice that this guide explain how to use osmc/raspi as an A2DP music receiver NOT as audio streaming source. So i was a bit confused. But this guide helps me to make it able to connect my headphones to my raspi.
So i´m able to connect my headset ! YES!! But i have no audio output. I tried to set audio output in osmc to alsa pulse and so on… but nothing helps, I dont get any sound out of my headset…
Did i miss a point? Whats going wrong… Maybe someone can give me a clue?
I got my little bluetoothspeaker working with the tutorial from Glou…
only thing i have no clue how to make it that after restart the raspberry that it will automatically connect the device?
Its trusted and paired perfectly but still not connect on reboot
First found out that after reboot, the bluetooth is not powered on automatically, so i found a solution by adding a file
/etc/udev/rules.d/10-local.rules
and add following
# Set bluetooth power up
ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", RUN+="/usr/bin/hciconfig %k up"
and in the file
/etc/pulse/default.pa
i add this:
# automatically switch to newly-connected devices
load-module module-switch-on-connect
but sadly the speaker will not connect automatically after reboot…
yes, with the file in the udev rules it will power on automatically…
maybe i’ve found a solution for it with ah bash code on startup that i’ve found on a blog:
3: in /etc/systemd/system i create a file named BTspeaker.timer
[Unit]
Description=Run Script after some time
[Timer]
# Time to wait after booting before activation
OnBootSec=15
Unit=BTspeaker.service
[Install]
WantedBy=multi-user.target
and enable this service with
systemctl enable BTspeaker.timer
so at the end, i was troubling around that connect script starts before before pulseaudio starts and this won’t work… now it waits 15 seconds after boot and this work fine
I had once this issue as well…
At the end found out that my speaker was still connecting to an other divice… And turn off/on my speaker fixed the issue…
Sounds simple but in my case i’ve lost an hour of searching for a solution
Nope, unfortunately it’s not that easy.
I tried to connect with 2 different devices.
A Samsung Bluetooth headphone and a Logitech pure WiFi speaker.
I can discover and pair both of them but can not connect to any device.
Dunno how you guys make it work.
My Bluetooth keyboard is working fine btw…