[How-to] set up Bluetooth audio

I think I had to remove them when I tried to upgrade to Kodi V19, but I ran the commands anyway.
None of the packages were found on the system:

osmc@osmc:~$ sudo dpkg -r armv7-bluez-alsa-app-osmc
dpkg: warning: ignoring request to remove armv7-bluez-alsa-app-osmc which isn't installed
osmc@osmc:~$ sudo dpkg -r armv7-bluez-alsa-osmc
dpkg: warning: ignoring request to remove armv7-bluez-alsa-osmc, only the config
 files of which are on the system; use --purge to remove them too
osmc@osmc:~$ sudo apt-get remove --purge a2dp-app-osmc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package a2dp-app-osmc
osmc@osmc:~$ sudo apt-get remove --purge pulseaudio-module-bluetooth
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'pulseaudio-module-bluetooth' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  armv7-libass-osmc armv7-libnfs-osmc dh-python g++-6 gnupg-agent libass5 libavcodec57 libavdevice57
  libavfilter6 libavformat57 libavresample-dev libavresample3 libavresample4 libavutil55 libbind9-140
  libbluray1 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcryptsetup4 libdevmapper-event1.02.1 libdns162
  libebur128-1 libegl1-mesa libenca0 libevent-2.0-5 libfcitx-gclient0 libgdbm3 libgl1-mesa-glx libgles2-mesa
  libilmbase12 libisc160 libisccc140 libisccfg140 libiso9660-8 liblivemedia57 liblvm2app2.2 liblwres141
  libncurses5 libnfs8 libntfs-3g871 libopencv-core2.4v5 libopencv-imgproc2.4v5 libopenexr22 libperl5.24
  libpostproc54 libprocps6 libprotobuf-lite10 libproxy1v5 libpython3.5-minimal libpython3.5-stdlib libraw15
  libsndio6.1 libsodium18 libstdc++-6-dev libswresample2 libswscale4 libunistring0 libupnp6 libva-drm1
  libva-wayland1 libva-x11-1 libva1 libvpx4 libwayland-egl1-mesa libwebpmux2 libx264-148 libx265-95
  python-apt python-certifi python-chardet python-dbus python-gi python-gobject python-gobject-2 python-idna
  python-imaging python-pexpect python-pil python-pkg-resources python-ptyprocess python-requests python-six
  python-unidecode python-urllib3 python3.5 python3.5-minimal samba-common wireless-firmware-osmc
  x11proto-dri2-dev x11proto-gl-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
osmc@osmc:~$ sudo apt-get remove --purge pulseaudio
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'pulseaudio' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  armv7-libass-osmc armv7-libnfs-osmc dh-python g++-6 gnupg-agent libass5 libavcodec57 libavdevice57
  libavfilter6 libavformat57 libavresample-dev libavresample3 libavresample4 libavutil55 libbind9-140
  libbluray1 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcryptsetup4 libdevmapper-event1.02.1 libdns162
  libebur128-1 libegl1-mesa libenca0 libevent-2.0-5 libfcitx-gclient0 libgdbm3 libgl1-mesa-glx libgles2-mesa
  libilmbase12 libisc160 libisccc140 libisccfg140 libiso9660-8 liblivemedia57 liblvm2app2.2 liblwres141
  libncurses5 libnfs8 libntfs-3g871 libopencv-core2.4v5 libopencv-imgproc2.4v5 libopenexr22 libperl5.24
  libpostproc54 libprocps6 libprotobuf-lite10 libproxy1v5 libpython3.5-minimal libpython3.5-stdlib libraw15
  libsndio6.1 libsodium18 libstdc++-6-dev libswresample2 libswscale4 libunistring0 libupnp6 libva-drm1
  libva-wayland1 libva-x11-1 libva1 libvpx4 libwayland-egl1-mesa libwebpmux2 libx264-148 libx265-95
  python-apt python-certifi python-chardet python-dbus python-gi python-gobject python-gobject-2 python-idna
  python-imaging python-pexpect python-pil python-pkg-resources python-ptyprocess python-requests python-six
  python-unidecode python-urllib3 python3.5 python3.5-minimal samba-common wireless-firmware-osmc
  x11proto-dri2-dev x11proto-gl-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

That’s what I saw in your logs. It should really be tidied up with --purge but then you would have to run sudo apt-get install --reinstall armv7-bluezalsa-osmc to make sure you have the latest conf files. This won’t affect your .asoundrc.

No harm in running sudo apt autoremove as well.

I did sudo apt-get purge armv7-bluezalsa-osm followed by sudo apt-get install --reinstall armv7-bluezalsa-osmc and a poweoff.

Unfortunately, still no sound over Buds.

I could pair my BT earplug at “my osmc”, but cannot find an audio device at settings>system>audio. What could be wrong?

osmc 2021.11-1

Cheers,
Wolf

Try restarting Kodi (Power->Exit).

If that doesn’t work, please start a new thread and post debug logs.

Have you updated to the November release? Try that and delete or rename .asoundrc. If no better, start a new thread with debug logs.

A post was split to a new topic: BT earbuds no sound

I could make it work - thank you very much. But now to activate a BT connection, I have to go to

  1. switch on BT device
  2. go to my osmc, connect the device there
  3. go to system > audio and switch to BT connection

Steps 2 and 3 require a number of clicks each - so that will not happen very often. Is there a shortcut for that whole procedure?

I you switch to Bluetooth Audio once it should always switch to your BT as soon as it connects and back to HDMI when it disconnect no need to change here.

The device should auto connect if you paired it. Only issue I have seen if the device is paired with multiple devices the auto connect sometimes fails.

I have OSMC setup on a Pi3 with IQaudio DAC HAT - using the Nov 21 version. It all works fine as a music player for material in my library.

Now, I’d like to set it up to operate as a Bluetooth speaker for my Smart TV so I figure I should follow the second section - Streaming to your OSMC device. However as the Pi is now operating headless I can only access the web interface or command line. Is it possible to pair/trust the TV Bluetooth from the command line?

Start here

Thank you so much, the guide is very clear and excellent.
I had given up a year ago with pulse, but today I just paired and activated both my BT headset and speaker, and all is nice and working !
Streaming from the smartphone is working fine as well.

Great job, much appreciated!

3 Likes

I’m having some difficulty in bluetoothctl. I get the errors below when trying to power on or make the controller discoverable although I can change the pairable status. Have I missed some other required steps?

[bluetooth]# show
Controller B8:27:EB:5F:32:CF
Name: osmc
Alias: osmc
Class: 0x000000
Powered: no
Discoverable: no
Pairable: yes
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
Modalias: usb:v1D6Bp0246d052B
Discovering: no
[bluetooth]# power on
Failed to set power on: org.bluez.Error.Blocked
[bluetooth]# discoverable on
Failed to set discoverable on: org.bluez.Error.Failed
[bluetooth]# pairable off
Changing pairable off succeeded
[CHG] Controller B8:27:EB:5F:32:CF Pairable: no
[bluetooth]# pairable on
Changing pairable on succeeded
[CHG] Controller B8:27:EB:5F:32:CF Pairable: yes
[bluetooth]#

For audio devices, you would normally set that device in discoverable mode and initiate pairing from your OSMC device. Follow the steps above. Do not mess with power (as long as bluetooth is enabled in MyOSMC) or discoverable.

is it working/available for current builds?

yes

tried tree different android smartphones to pair, but fails always.
build 2022.03 and current build 2022.06 for rpi3 with onboard bluetooth.
same fail with or without pin.

btw: connecting wifi fails too on current build 2022.06.

Could you let us know the model of the phones, and post some logs?

I can reproduce this. Try pairing with bluetoothctl while we investigate.

please wait, log is in progress.

smartphones are:
Samsung S5 mini, Android 6.0.1
Oukitel K6000 Plus, Android 7.0
Umidigi A9 Pro, Android 11