Bluetooth fix for December update

Hi !

I made a patches:

branch: a2dp

Remember, that after first headset connect, may be needed to switch card profile by hand:
osmc@pi:~$ pactl set-card-profile bluez_card.XX_XX_XX_XX_XX_XX a2dp_sink

1 Like

Thanks. I’ll take a look at this shortly.


Before the a2dp-app-osmc package has been installed, the “user” instance of pulseaudio still runs at startup, even though the service is already disabled. I’ve found that it is triggered by pulseaudio.socket, so disabling the service will have no effect - and it would probably need to be masked, instead.

After installing the a2dp-app-osmc package, two instances of pulseaudio do run, but the user instance ceases to run after a reboot, though I guess that it might still be activated via pulseaudio.socket.

So do you know what’s being sent to pulseaudio.socket that causes the user instance of pulseaudio.service to start? And is there still a possibility of whatever is sent happening again?

Nope, and I’m not sure stopping this is the solution, because it worked before under Jessie.

Stopping what?

Anything more concrete than that? Different versions of systemd and different versions of pulse.

I’ve now made some fixes available, and hopefully this will allow A2DP to work out of the box again.

  1. Login via the command line
  2. Edit the file /etc/apt/sources.list
  3. Add the following line: deb stretch-devel main
  4. Run the following commands to update: sudo apt-get update && sudo apt-get dist-upgrade && reboot
  5. Your system should have have received the update.

Please see if the issue is resolved.

I also recommend you edit /etc/apt/sources.list again and remove the line that you added after updating. This will return you to the normal update channel.


Thanks sam.

Will give it a test near the weekend.


Thanks Sam, I’ve worked through the different steps that you outlined above and everything proceeded smoothly. I.e it found the update and processed it without issue. However I still can’t seem to use OSMC (Raspberry Pi 2) as the output source with bluetooth.

Hi Sam

Just updated but unfortunately no change the bluetooth device automatically disconnects once connected using bluetoothctl see below. I’m using an external dongle which worked fine before the stretch update.

Anything else i can do to help let me know

[bluetooth]# connect 45:C6:59:42:A3:04
Attempting to connect to 45:C6:59:42:A3:04
[CHG] Device 45:C6:59:42:A3:04 Connected: yes
Connection successful
[CHG] Device 45:C6:59:42:A3:04 ServicesResolved: yes
[CHG] Device 45:C6:59:42:A3:04 ServicesResolved: no
[CHG] Device 45:C6:59:42:A3:04 Connected: no

I’ve tried the update on my RPi3. Still big issues pairing and no audio :frowning:

See Cannot make ALSA + SoundWire to work - #3 by Jean

Don’t know what SoundWire is unfortunately.

Did you try using it as intended (i.e. for A2DP sending / receiving?)

As reported in the linked reply, I tried to use a bluetooth headset and, apart from some issues in the pairing phase, I wasn’t unable to select it as an audio device for the output.

Soundwire is a small binary that (using a Pulseaudio sink) would stream the audio over the network to an Android app.

With the latest a2dp it works for me.
So suggest you try to update to latest devel version and if you still don’t have the Sink provide a screenshot and a debug log.

I’ve already updated with the devel Apt repo last friday, if there aren’t newer updates I’m stuck… Or am I missing some setup step? Do I need to install/configure something additional? The only thing I did is pairing the headphones using bluetoothctland checking in Kodi under System/Audio…

Sam published an update on Sunday

Latest staging update fixed it. Bluetooth doesn’t disconnect after connecting.

All good so far will do more testing.

Thanks @sam_nazarko again :slight_smile:

Yeah some nice improvements but i think pulseaudio plays over kodi

What i am noticing. All my dongles seems to connect and do not disconnect.

Bluetooth stream ==> played through osmc works.

Osmc stream ==> bluetooth does not work.

Whatever i change in system settings => audio => audio output device it always plays through the HDMI.
The weird thing if i play a bluetooth stream it plays through osmc but i can start another local stream in osmc and i have now two audio which plays on top of each other.

I just tested it and version 1.1.3 of a2dp-app-osmc is working when playing audio from OSMC to an external speaker. That’s on a Pi3 with a cheapo (Cambridge Silicon Radio) external dongle. I’ll see if it works on the Pi’s internal bluetooth adapter a bit later.

The audio output device in Settings > System Settings > Audio is set to ALSA: Playback/recording through the PulseAudio sound server.

Update: Also works with the Pi3’s internal bluetooth adapter.

Latest update fixed it for me too, yay!!

Headset connected automatically, and selecting ALSA playback the audio switched immediately to the BT headset!

The noticeable difference now is that under PulseAudio there is a new item under Playback, so all is wired correctly! Great!!

I’ve done additional testing. After the first time, it doesn’t work anymore… I had to reboot, otherwise PulseAudio will not re-configure itself correctly as before. I’m still issuing a connect command through bluetoothctl to make the connection work instantly.

BTW it’s enough for now, thanks!