fraisdos
Posts: 4
Joined: Wed Oct 10, 2018 12:07 am

Bluetooth a2dp profile

Tue Feb 19, 2019 8:27 pm

I like using a Bluetooth headset with Kodi or Emulation Station.
For that I have installed pulseaudio.

Sound is excellent but the profile a2dp is not automatically connecting. Even if switch-on-connect is available into /etc/pulse/default.pa.
Then I have to lunch pacmd set-card-profile bluez_card.E4_22_A5_BD_4B_7D a2dp_sink to get a2dp time to time.
I have test with this udev rule: ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="E4:22:A5:BD:4B:7D", RUN+="/usr/bin/pacmd set-card-profile bluez_card.E4_22_A5_BD_4B_7D a2dp_sink"

But no luck, pulseaudio is not start as a daemon. I get this message : No PulseAudio daemon running, or not running as session daemon.

Any idea how to solve this ?

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth a2dp profile

Tue Feb 19, 2019 11:23 pm

I wonder if you ARE using PulseAudio for audio streaming, despite having installed it. For the past year or two, Raspbian has been shipping with BlueALSA, which allows you to implement A2DP without the need for PulseAudio. The two don't cooperate nicely, and my recommendation is not to install PA.

If you are indeed running PA, make sure it is running in system-wide mode (may require editing pulseaudio.service), and make sure you have the relevant modules loaded. Edit /etc/pulse/system.pa, and add the following lines at the bottom

Code: Select all

load-module module-bluetooth-policy
load-module module-bluetooth-discover
Remove the udev rule and forget about it.

If your system is falling back to BlueALSA, well, it should work on its own. My Bluetooth speaker always reconnects automatically whether the Pi or the speaker or both are power-cycled. Go into bluetoothctl and ensure the speaker is paired AND trusted.

fraisdos
Posts: 4
Joined: Wed Oct 10, 2018 12:07 am

Re: Bluetooth a2dp profile

Wed Feb 20, 2019 6:37 am

I do remember that I tested BlueALSA first. But I didn't get the bluetooth headset working with kodi & retrogames.
This is the reason why I switched to PA even if I don't stream audio.

Is that possible to get the audio through bluetooth headset with kodi & retrogames when using BlueAlsa ?

I have tested with system-wide mode and the two lines, module-bluetooth-policy and module-bluetooth-discover, at the end of system.pa. No luck.

Return to “Troubleshooting”