Bluetooth speaker connected but no sound

Hello there !
I am trying to connect my JBL FLIP 4 bluetooth speaker to my Raspberry pi 3B under OSMC (latest version).

It is a new clean install. I managed to connect the speaker using a2dp, and it connects automatically when i turn it on. However, the sound is still coming from the tv trough HDMI, although the Alsa PulseAudio sound server is selected as sound output.

If i go back to this settings and select it again, then there is no more sound from HDMI and the speaker still doesn’t play sound.
When I turn off the speaker, sound goes back to HDMI.

Would you be able to help ? Thanks a lot

Full log : https://paste.osmc.tv/uvubayiwul

What does pactl list cards short report when the speaker is connected?

With no speaker connected :

 osmc@osmc:~$ pactl list cards short
 0       alsa_card.platform-soc_audio    module-alsa-card.c

With speaker connected :

osmc@osmc:~$ pactl list cards short
0       alsa_card.platform-soc_audio    module-alsa-card.c
1       bluez_card.30_C0_1B_2E_25_82    module-bluez5-device.c

Looks good, what does pactl list sources short show

Without speaker :

osmc@osmc:~$ pactl list sources short
0       alsa_output.platform-soc_audio.analog-stereo.monitor    module-alsa-card.c      s16le 2ch 44100Hz       IDLE

with speaker :

osmc@osmc:~$ pactl list cards short
0       alsa_card.platform-soc_audio    module-alsa-card.c
1       bluez_card.30_C0_1B_2E_25_82    module-bluez5-device.c

I think you took wrong command here

Indeed I made a mistake

Here it is (sound not playing at all):

osmc@osmc:~$ pactl list sources short
0       alsa_output.platform-soc_audio.analog-stereo.monitor    module-alsa-card.c      s16le 2ch 44100Hz       IDLE
1       bluez_sink.30_C0_1B_2E_25_82.headset_head_unit.monitor  module-bluez5-device.c  s16le 1ch 8000Hz        IDLE
2       bluez_source.30_C0_1B_2E_25_82.headset_head_unit        module-bluez5-device.c  s16le 1ch 8000Hz        IDLE

after disconnecting, reconnecting the speaker, ound playing through HDMI while it should be going through bluetooth speaker :

osmc@osmc:~$ pactl list sources short
0       alsa_output.platform-soc_audio.analog-stereo.monitor    module-alsa-card.c      s16le 2ch 44100Hz       IDLE
3       bluez_sink.30_C0_1B_2E_25_82.headset_head_unit.monitor  module-bluez5-device.c  s16le 1ch 8000Hz        SUSPENDED
4       bluez_source.30_C0_1B_2E_25_82.headset_head_unit        module-bluez5-device.c  s16le 1ch 8000Hz        SUSPENDED

Ok as I expected your speaker somehow register as headset.
Just try pactl set-card-profile 1 a2dp_sink

thanks a lot man, it seems to work !
I’ll see if it survives reboot

should be

I still have an issue regarding bluetooth connection with speaker :
When I turn on the speaker, the sound still goes through hdmi. I have to go to audio settings, change ouptu to hdmi and change it back to PulseAudio.
Is there anything I can do about it ?

Not sure why that is the case it worked automatically for me. No direct solution but the team is working on a new bluetooth approach and that would most likely solve your issue.

ok thanks

I’m also having some trouble with my JBL Flip 4 speaker. It paired no problem and says audio is going through the pulseaudio output, but the sound is still using the HDMI connection.

When I run pactl list sources short without the speaker connected I get
‘0 alsa_output.platform-aml_m8_snd.46.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz IDLE
1 alsa_input.platform-aml_m8_snd.46.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE’
When the speaker is connected I get
‘0 alsa_output.platform-aml_m8_snd.46.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
1 alsa_input.platform-aml_m8_snd.46.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED’

Any ideas?

This looks like you haven’t installed the a2dp app.
So either install it via sudo apt-get install a2dp-app-osmc alternatively we are moving on to a new bluez based solution. If you haven’t installed a2dp so far and directly want to jump on the new train let me know and I write you those steps.

If you don’t mind writing it out for me, that would be great! I just started using my vero yesterday and spent most of today trying to figure this out. Thank you!

So you confirm you haven’t installed a2dp-app-osmc so far? Because otherwise you first need to uninstall that.
You can check with dpkg -l | grep a2dp if reply is empty it is not installed.

I did install it, but I already deleted it when I saw your comment on bluez. The text came back clear so I’m good to go.

Ok, bit suprized that it than didn’t work but let us try the other path then.

sudo apt-get update
sudo apt-get install wget libbluetooth3 libsbc1 libfdk-aac1
wget https://collab.osmc.tv/s/hxG3JX4m3rY2XiM/download -O armv7-bluez-alsa-osmc.deb
sudo dpkg -i armv7-bluez-alsa-osmc.deb

That should give you the baseline. You then would need to edit/create the profile with nano .asoundrc with the following content (adapt/replace the fields in the <>

# This file describes the bluetooth sinks available for Kodi to play to
# add lines like the following for each BT device (speaker or headphones)

pcm.mybtdevice {
        type bluealsa
        device "<DEVICE MAC>"
        profile "a2dp"
        hint {show on description "<SIMPLE NAME>"}
}

# using the MAC of the device (see bluetoothctl) instead of 12:34:56:78:9A:BC
# Use any letters or numbers for the description which will show up in Settings-System-Audio

After that I suggest to reboot. You then should have an entry in Kodi under Audio device that shows what you choose as <SIMPLE NAME>

So I did all that and it’s still not working. Under my audio outputs my two options are Playback/recording through the PulseAudio sound server or the HDMI option. The device is still paired, just doesn’t seem to be recognized. Under nano .asoundrc do I put everything you have in blue, including the statements that start with #?