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

Just tried this with my bluetooth headphones. They work great eventually, but there is approximately 2 minutes of caching and video stutter while silent audio before it kicks off.

awesome, altering the /boot/config.txt file did the trick for me!

for the terminal-savvy folks (not sure if all steps are required):

bluetoothctl
power on
scan on
agent on
devices
pair {{mac address as shown by devices}}
connect {{mac address}
exit

as found here: https://wiki.archlinux.org/index.php/Bluetooth

for the devs, audio playback sometimes suffers from some noise (I think, not sure how to describe it. Quality is perfect and no lag) that is probably best described as poking your finger on a poorly (requited?) aux cable which makes the speakers crack for a second. Might be my (old) bluetooth dongle though, not sure. Definitely not the output device.

/home/osmc > dmesg | grep Bluetooth
[    4.314149] Bluetooth: Core ver 2.20
[    4.314260] Bluetooth: HCI device and connection manager initialized
[    4.314283] Bluetooth: HCI socket layer initialized
[    4.314299] Bluetooth: L2CAP socket layer initialized
[    4.314335] Bluetooth: SCO socket layer initialized
[    5.604841] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    5.604862] Bluetooth: BNEP filters: protocol multicast
[    5.604886] Bluetooth: BNEP socket layer initialized

bluetoothctl info A8:5B:78:7D:F0:6C 
Device A8:5B:78:7D:F0:6C
	Name: iPhone van Rowan
	Alias: iPhone van Rowan
	Class: 0x7a020c
	Icon: phone
	Paired: yes
	Trusted: no
	Blocked: no
	Connected: yes
	LegacyPairing: no
	UUID: Vendor specific           (00000000-deca-fade-deca-deafdecacafe)
	UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
	UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: NAP                       (00001116-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
	UUID: Phonebook Access Server   (0000112f-0000-1000-8000-00805f9b34fb)
	UUID: Message Access Server     (00001132-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	Modalias: bluetooth:v004Cp6E00d0920

Sam,

Any chance you have a guidance for the HiFiBerry not showing up in Settings->Audio Output after following the steps outlined above. This was mentioned by @zilexa too.

Thanks much!

  • Micky

I think you’ll find that installing pulse-audio and trying to use a Hifiberry are mutually exclusive, at least for now. So if you have a Hifiberry I would not recommend trying to use the A2DP package at the moment.

Issues with pulse-audio and side effects from it being installed are the main thing that is keeping this package experimental at the moment.

Just what I needed to know. Appreciate the quick turnaround!

sudo apt-get purge pulse-audio

Should remove pulse audio as well as the A2DP package and get your Hifiberry working again.

first post here, just switched to osmc from oe (been meaning to try it but I’m lazy lol). I’m a very infrequent linux user so forgive any dumbness!

(I have 2015.11-1 on a Rpi 2b)

Firstly, I initially had problems with my Belkin F8T012 dongle (pairing always failed). I found this information and now pairing is working. Not sure what the pegasus kernel module does (as mentioned in the link), but everything seems ok with it blocked.

Secondly, like others I was getting a long period of initial audio stuttering. I seem to have fixed this by turning off ‘Start/Stop Discovery’ in Bluetooth options after I’ve successfully paired. This makes a lot of sense, but I didn’t think to try it at first so thought I would mention it in case it helps anyone else.

I do need to remove the device and then re-pair it in osmc when I want to pair (re-connect in the Paired Devices sub-menu doesn’t work for me), but it may be my old Motorola S705 receiver that I’m using (I’ll keep playing around).

I have an Rpi2 running 2015.11-2, with a Cambridge Silicon USB dongle, USB ID 0a12:0001
i’ve installed the .deb on a clean install, per above instructions.
i can connect/pair via bt, and on my phone osmc is my media output
i cannot get sound out of either the HDMI or the analogue port, have changed it multiple times
the only sink i get from “pactl list sinks” is the null sink

suggestions?

See post 123, you probably have to edit config.txt

Is this working on Vero? Tried a while ago and there were issues. Just wondered if things had been updated for Vero as there has been no discussion about it. Thanks!

Hello there,

I have a generic BT adapter which list itself as CSR8510 A10.
Dec 27 15:18:37 osmc-Ridgewell kernel: usb 1-1.2: new full-speed USB device number 4 using dwc_otg
Dec 27 15:18:37 osmc-Ridgewell kernel: usb 1-1.2: New USB device found, idVendor=0a12, idProduct=0001
Dec 27 15:18:37 osmc-Ridgewell kernel: usb 1-1.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
Dec 27 15:18:37 osmc-Ridgewell kernel: usb 1-1.2: Product: CSR8510 A10

I cannot manage to use a BT device. Form My OSMC, I can discover devices, but when I try to pair with it, OSMC displays a message stating that connection has failed, but it is listed in the paired device list. Re-connect to the device always fails.
Looking from the command line (bluetoothctl), the device seems to be paired :
[bluetooth]# info 00:1A:7D:D4:62:24
Device 00:1A:7D:D4:62:24
Name: BRAVEN 570
Alias: BRAVEN 570
Class: 0x240404
Icon: audio-card
Paired: yes
Trusted: yes
Blocked: no
Connected: no
LegacyPairing: no
UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)

If I try to connect manual, it fails :
[bluetooth]# connect 00:1A:7D:D4:62:24
Attempting to connect to 00:1A:7D:D4:62:24
Failed to connect: org.blue.Error.Failed

Did I missed something or am I just a victim of crapy hardware?

EDIT : I relaunched the a2dp install script, had an OSMC update. After pairing again it works like a charm!

I confirm that streaming from OSMC with a generic CSR8510 A10 adapter works fine with my BT speaker Braven 500.

Dilligaf: thanks. i did and it works. still choppy audio occasionally, but whatever.

hi @sam_nazarko
as it goes for me, bluetooth is working great. I was able to connect my phone with raspberry and stream music to it and the same refers to bluetooth speaker where streaming music from raspberry was also possible. Everything loud and clear.

It maybe a dumb question but please correct me if I’m wrong. Pulseaudio is required here and used, right? What version is it, 5?
Would it be possible to upgrade it to the newest version?

Why am I asking? I’m struggling with some issues related to RetroPie (installed via mcobit script howto retrosmc retrogaming on osmc

I have noticed that when pulseaudio process is running, retroarch emulator has various problems with launching, and RetroPie returns a lot of errors related to ALSA.
“ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied. amixer: Control default open error: Connection refused”
“ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied. cannot open mixer: Connection refused”.

But once pulseaudio is terminated, everything seems to be working fine.
Whenever Emulationstation or Retroarch gets stuck (paused screen or something) terminating pulseaudio solves problem.

Ok, so I’m unsure what’s wrong, but I cannot connect my phone to RP2 running OSCM 2015-12-1.

from a ssh I ran :
sudo su
wget http://paste.osmc.io/raw/qiyekuvafe -O- | sudo sh

in the end osmc restarts closing the ssh session, not sure this is intended. So I re-ran the command, it seems all was installed, but how can I check ? the last lines of the ssh session are :

HTTP request sent, awaiting response... 200 OK
Length: 4300 (4.2K) [application/x-debian-package]
Saving to: 'a2dp.deb'

a2dp.deb            100%[=====================>]   4.20K  --.-KB/s   in 0s

2015-12-29 14:46:43 (48.5 MB/s) - 'a2dp.deb' saved [4300/4300]

(Reading database ... 26944 files and directories currently installed.)
Preparing to unpack a2dp.deb ...
Unpacking a2dp-app-osmc (1.0.5) over (1.0.5) ...
Setting up a2dp-app-osmc (1.0.5) ...
Processing triggers for dbus (1.8.20-0+deb8u1) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apt-transport-https libbluray1 libcurl3-gnutls rbp2-image-4.3.0-10-osmc
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

My BT dongle is an Asus USB-BT400 (which is in the list of the supported “out of the box” dongles).

Going to MyOsmc / Network, I enabled BT support, enabling “Start/Stop discovery” I can see BT-enabled devices.
On my phone I can also see my OSMC devices, so all sounds good so far.

The issue is : when trying to pair the Phone (Moto X Style XT1572) to OSCM, it tries for few seconds then give-up.

Did I miss some configuration steps ?

Edit : after several attemps, I could pair to HTB558* home theater (with the “with PIN” option).

Thx

If you are using the old script, problems with libs are expected. It uses raspbian sources.
That is fixed with the new one.

Edit: Sorry. You seem to use the new one. I cannot test bluetooth related things unfortunately.

Ok, Replying to myslef as I made some kid of progress…

  • I can pair OSMC with other BT devices (jabra headset, Philips home theater, etc…).
  • I cannot pair from other device (computer/phone) with OSMC : with my mobile or my computer I can see the OSMC BT but cannot pair with it !

So I paired the OSMC with my phone to give it a try anyway, but when playing music from my phone there’s no sound out of the rasp (HDMI and/or jack audio). Btw is there any notification that is supposed to be displayed in OSMC when I play music from my phone ?

See post 142, did you edit config.txt??

No, I did not (read / edit config), but now that I did it works ! Thx.

Ok, so my only remaining point is regarding pairing, but maybe it’s the normal behavior ?
I can only pair from OSMC/Kodi, which is not very convenient.
And BTW, for some reason now when scaning BT devices from my phone, OSMC is no longer visible…

Note that once the device (phone) has been paired once I can re-connect from it, even after rebooting the rasp.