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

The BTPlayer uses PulseAudio, and we don’t listen to CEC events and pass that on. This might change in the future though. It’s a good suggestion if we can get it to work.

Hi Sam, testing a little bit more the A2DP I often experience no audio output during a streaming or just at the beginning, although the BT speaker is still connected.
Moreover when this occurs, switching again the audio output to hdmi has no effect and I’m obliged to restart OSMC.

I keep getting a “HTTP request sent, awaiting response… 404 Not found” response.

Hey all new to the thread and OSMC in general, I was wondering with connect a phone to the Pi (Pi3, latest OSMC) via Bluetooth if you can get GPIO pin 4 to act an FM transmitter, its possible to do it with Raspbian, but that only allows for one song, or theoretically a playlist of songs to be played and that its, song change requires terminal use. Basically I am looking to stream music like this:

Phone–>BT–>OSMC(Pi)–>GPIO 4 FM

Thank you!

if it is possible, would it be able to be tuned easily? id like to use this in my vehicle as there is no Aux, BT, or even a tape player (just Nav and Cd’s

I’m going to add my findings here as well (as addition to my other topic).

I connected my Yamaha (YAS-105) Soundbar to my Pi 3.
Works perfect with the UI and stereo video, no sound with DD5.1 or DTS.
Same results with on-board BT, expensive DJA pro BT 4.0 dongle (labeled for audio transmission and data transmission) and cheap BT 3.0 dongle.

Original Pi 3 Power Supply, installed the above script from the first post and set sound to ALSA.
Passthrough enabled (can’t switch device from PI:HDMI, that’s grayed out), DD5.1 passthrough enabled and AC3 Transcode enabled for DTS and others since my soundbar only supports AC3.

Set to 2.0 channels tried 5.1 as well, no change, only works in PCM (2.0 Stereo, there is a little PCM light on my bar that lights up when Bluetooth is enabled while the DD5.1 stays unlit) with passthrough disabled, no glitches in stereo, it works flawless but I really don’t want to listen to stereo sound :stuck_out_tongue: .
Anyone any ideas on how to fix this or if it is fixable? Can provide logs if needed.

Just reinstalled OSMC from scratch, when testing BT Headphones I only saw “ALSA: bcm2835 something…” in the Output settings, not “ALSA: OSMC streaming to Bluetooth speaker/headphones”.

When reinstalling using the OP command, the Rpi 3 rebooted, and BT Audio worked fine.

PS. It even kept disconnecting before reinstalling, and pairing only worked during playback, now BT stays connected and reconnects successfully when turning the headphones on.

Great work!

Hi,

I’ve tried to read and CTRL+F as much as I could but this thread is quite long and I’m not sure whether previous information are still accurate or not.

How is Bluetooth audio streaming (A2DP) working at the moment with the bluetooth chip included in the Raspberry Pi 3 ? Does it have lag/disconnecting/other issues ?

Thank you !

I’m using BT audio streaming (A2DP) with BT dongle (not onboard RPI3 BT). For me it’s running 24/7.
Sometimes I need to restart Kodi (or occasionally re-connect/re-pair with BT speaker), but most
of the time it is working very well. The sound is very impressive. I also had to set
buffermode=1 otherwise the audio was breaking up sometimes (dropouts).

I’m using it for mostly DVB-T Radio from another OSMC running OSMC/TVHeadend.
The RPI3 is simultaneously ‘reading’ audio data from the network and ‘writing’ data to USB (Bluetooth).

This setup works ok, but it’s probably better to stream local data to BT instead of network data.
(for example If I try to stream live TV instead of Radio with the audio streamed to BT, then it’s too jittery).

hope this helps.

Best regards,
Niall.

HI Sam, All,

I had configured the Bluetooth as stated by Sam in the first post and all was working well til few days ago. Am not sure which build update broke it, but the a2dp-app-osmc isn’t working anymore. I thought it was something because of my extreme customization so did a fresh install of the latest build from the osmc downloads site September build. But now when I run the scrip I get the Setting up a2dp-app-osmc (1.0.5) … Processing triggers for dbus (1.8.20-0+deb8u1) … and the system reboots. On checking the MyOSMC/Networks it shows the Bluetooth option shows up for a second and the GUI gets rewritten to the old state (without Bluetooth option). Not able to debug this. Please help.

Thanks.

I tried this just for fun and had some success but some odd side effects, including an inability to record live TV. I removed the a2dp-app-osmc package and will go back for more detailed testing when I have time but now my BT keyboard won’t re-connect after a re-boot. It says it’s paired and bluetoothctl says it’s trusted but I have to delete and re-pair after a re-boot and sometimes after coming back from sleep.

Any thoughts on why this has happened? It worked fine before.

Edit: There is a link key in /var/lib/bluetooth/{BTadapterID}/{BTkeyboardID}/info which is incorrect after a reboot. I’ve tried everything to get rid of it but it keeps coming back. Everything = re-pairing the keyboard, removing the keyboard in MyOSMC, removing the keyboard with bluetoothctl, deleting the file, deleting /var/lib/bluetooth/*, purging bluez and re-installing it.

Edit2: It’s nothing to do with this thread. Turns out my SD card has gone funny so that any changes to the file system do not survive a re-boot.

I’ve been having issues with the sound cutting out then disconnecting when using the Raspberry Pi 3’s on board bluetooth. Has anyone had any luck getting this working with it or knows a good bluetooth adapter that does?

Yeah had same problem with onboard bluetooth. Using adapter works much better.

Hi,
Is it possible to output both to HDMI and connect bluetooth headphones?
Thank you.

Hi Guys,

First post in the forums. :slight_smile:

I have installed as per instruction, after my Pi3 reboots I can pair my phone (HTC One X+) and it detects as BT audio device when I connect my phone and play some music it streams via BT and it plays from HDMI no problems :slight_smile:

For the life of me I cannot figure out how to get the audio to output on the 3.5mm jack, to which my sound system is connected :frowning: Has anyone figured this out?

I have tried this… amixer cset numid=3 1 after which no sound from anything.

Thanks
Taygs

How is Settings|System|Audio set - I would expect it set for analog or dual HDMI/analog?
Derek

I did clean install so was HDMI only. Then I ran the install and it worked via HDMI. I changed to Analog only to match my setup but BT still only streams via HDMI
Taygs

Is it only the BT stuff coming out the HDMI and all other system sounds coming out via 3.5mm or is everything coming out via 3.5mm?

Only BT stuff comes out of HDMI, all OSMC sounds and media are through 3.5mm as intended. I need to figure out how to get the BT streaming through the 3.5mm as well.

If I do the amixer cset numid=3 1 it breaks the BT streaming, phone is still connected and playing but no audio, HDMI or 3.5mm. If I do amixer cset numid=3 2 to set back to HDMI it’s still broken.

All the while OSMC sounds and media are 100% OK through 3.5mm.

Taygs

so this is what worked for me…

sudo amixer -c 0 cset numid=3 1

now BT streamed audio is output through 3.5mm. the difference being the “-c 0”. from what I can tell is the -c 0 selects the sound device. I don’t understand it, it works, I’m happy :smile:

Keep up the good work guys!!!

Here’s an update, and a question:

I have RPI3 (with official 2.5A psu). Instead of Wifi dongle, I’m using an ethernet connection
to a TP-LINK mini wifi router (TL-WR702N). I can stream live HD TV channels over the network, and it
works great with no jitter.

Steaming audio to Bluetooth (dongle, not built-in) also works very well. The sound is great on my
homemade BT speaker (sound-off with Bose Sounklink Mini here: - YouTube)

If I then try stream the audio to Bluetooth, the picture starts to break-up, and it’s basically
unusable. Video only = perfect. Audio only = perfect. Video + Audio = crap :frowning:

Am I right in thinking that all of this data on the same bus (ethernet, bluetooth) is just too much
for one RPI3?

Would it be different on a Vero @sam_nazarko …?>

Thanks.
Best regards,
Niall.