How to use an external bluetooth speaker in linux

If you want to use an external bluetooth headphone or speaker paired with your computer, there's the small steps to follow:

  1. Install the needed dependencies:

sudo apt-get install bluetooth blueman bluez pulseaudio-module-bluetooth bluez-firmware

Important notes:

  • if you have the "connman" package installed you must uninstall it first or to install "connman-gtk" and enable the bluetooth device, otherwise you won't be able to enable it
  • Make sure that your bluetooth is enabled in your bios, if you have it and doesn't appears as an adapter
  1. Remove the previous pulseaudio configurations, otherwise you will be unable to connect it

rm -r ~/.config/pulse ; pulseaudio -k

  1. Play some music or any audio in your computer (this is suggested in order to enable the "Audio Sink" option in your pulseaudio system)

  2. run the bluetooth app (you have it also in your menus)

blueman-applet

  1. Configure and Pair your bluetooth audio device:
  • Turn ON your bluetooth speaker and press the button to start a new pairment with devices
  • Select "Devices" from the menu of blueman-applet (should appear as a gadget in the corner, otherwise run the command "blueman-manager")
  • Scan / Search for devices
  • Right click on your bluetooth device when it appears, select "Pair"
  • Right click again, select "Connect" to "Audio Sink" (if you have it, its the preferred one and more compatible)
  • Right click again, select "High Fidelity" in your "Audio Profile" section
  • Restart your audio / music application, and play some audio again
  • Right click again, select "Trust" to remember this device

How to connect the speaker at desktop start

  • add blueman to your startup applications
  • make sure that the device is on mode "trust"
  • on desktop startup, if has not automatically connected, right click on the gadget and select "recent connections"

:furrydance: :happy_dance: :happy: Enjoy! :happy: :happy_dance: :furrydance:

feel free to improve this howto you have suggestions to add or special notes

1 Like

Thankyou! That was very easy and well explained!

Do you mean either reinstall or just install connman-gtk and enable bluetooth manually?
Because for example reinstalling connman means dropping all connection untill reboot. Looks like it's unable to find even the ethernet connection!

I was bored so i wrote a script following your "how to" step by step :slight_smile:
I know is not good but well

1 Like

Nice, have you tried using "yad" or "zenity" to make these kind of scripts palpable for those that are commandline-phobic ????
:happy_dance:

1 Like

connman makes your connections to may not work as expected, so its better to not use it for now (unless you want it as a replacement of network-manager), but on this case about bluetooth, it automatically switches the bluetooth OFF all the time, so what meant the tutorial is either remove connman package or to install connman-gtk to configure bluetooth to be ON

Honestly I had no idea about their existence. I will look at them.
I could rewrite the scripts using them, maybe @Thanatermesis may even add the script to the elive configuration things

Where it might be a point that "network-manager" does not work well on E23 that uses "conman" ..... making this an E16 thing.
And how about the settings in "laptop-mode-tools" ?
There's a checkbox there too, enabling bluetooth. :thinking:

Done!

1 Like

I am lost here, this script can make mu BLueTooth work that I am using E16 or E23 ?

JF
I am now back on E16

Oh well, i tried it on e16. Up to you trying on e23.
The script simply does what @Thanatermesis wrote in the how-to. I guess yes. Honestly i guess it should work DE-independently.

1 Like

connman-gtk does allow to turn on bluetooth if set to "enabled" but only for a very short while, practically blocks straight away. :face_with_head_bandage:

rfkill state goes from UNBLOCKED to SOFT_BLOCKED

~ ❯❯❯ tail -f /var/log/syslog 130
Feb 15 17:08:17 localhost laptop-mode: enabled, not active
Feb 15 17:08:17 localhost rfkill: block set for type bluetooth
Feb 15 17:08:17 localhost laptop-mode: enabled, not active
Feb 15 17:08:17 localhost rfkill: block set for type bluetooth
Feb 15 17:08:18 localhost laptop-mode: enabled, not active
Feb 15 17:08:18 localhost rfkill: block set for type bluetooth
Feb 15 17:08:18 localhost systemd[1]: Reached target Bluetooth.
Feb 15 17:08:18 localhost systemd[1]: Stopped target Bluetooth.
Feb 15 17:08:21 localhost systemd[1]: systemd-rfkill.service: Succeeded.
Feb 15 17:08:24 localhost blueman-mechanism: Exiting
Feb 15 17:08:45 localhost URfkill[1637]: device_changed_cb: tpacpi_bluetooth_sw
Feb 15 17:08:45 localhost URfkill[1637]: killswitch state: KILLSWITCH_STATE_SOFT_BLOCKED new_state: KILLSWITCH_STATE_UNBLOCKED
Feb 15 17:08:45 localhost systemd[1]: Starting Load/Save RF Kill Switch Status...
Feb 15 17:08:45 localhost systemd[1]: Started Load/Save RF Kill Switch Status.
Feb 15 17:08:45 localhost kernel: [ 2209.329466] usb 2-7: new full-speed USB device number 14 using xhci_hcd
Feb 15 17:08:45 localhost kernel: [ 2209.478741] usb 2-7: config 1 interface 1 altsetting 0 endpoint 0x3 has wMaxPacketSize 0, skipping
Feb 15 17:08:45 localhost kernel: [ 2209.478744] usb 2-7: config 1 interface 1 altsetting 0 endpoint 0x83 has wMaxPacketSize 0, skipping
Feb 15 17:08:45 localhost kernel: [ 2209.478749] usb 2-7: New USB device found, idVendor=8087, idProduct=07dc, bcdDevice= 0.01
Feb 15 17:08:45 localhost kernel: [ 2209.478751] usb 2-7: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Feb 15 17:08:45 localhost URfkill[1637]: adding killswitch idx 12 soft 0 hard 0
Feb 15 17:08:45 localhost URfkill[1637]: killswitch state: KILLSWITCH_STATE_UNBLOCKED new_state: KILLSWITCH_STATE_UNBLOCKED
Feb 15 17:08:45 localhost URfkill[1637]: Setting device 12 (BLUETOOTH) to unblock
Feb 15 17:08:45 localhost kernel: [ 2209.494302] Bluetooth: hci0: read Intel version: 370710018002030d00
Feb 15 17:08:45 localhost kernel: [ 2209.494332] bluetooth hci0: firmware: direct-loading firmware intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
Feb 15 17:08:45 localhost kernel: [ 2209.494334] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
Feb 15 17:08:45 localhost laptop-mode: enabled, not active
Feb 15 17:08:45 localhost rfkill: block set for type bluetooth
Feb 15 17:08:45 localhost URfkill[1637]: device_changed_cb: tpacpi_bluetooth_sw
Feb 15 17:08:45 localhost URfkill[1637]: killswitch state: KILLSWITCH_STATE_UNBLOCKED new_state: KILLSWITCH_STATE_SOFT_BLOCKED
Feb 15 17:08:45 localhost URfkill[1637]: device_changed_cb: hci0
Feb 15 17:08:45 localhost URfkill[1637]: killswitch state: KILLSWITCH_STATE_SOFT_BLOCKED new_state: KILLSWITCH_STATE_SOFT_BLOCKED
Feb 15 17:08:45 localhost kernel: [ 2209.547978] usb 2-7: USB disconnect, device number 14
Feb 15 17:08:47 localhost kernel: [ 2211.557439] Bluetooth: hci0: command 0xfc8e tx timeout
^C

Uninstalling connman isn't a good idea on E23 as "nm-manager" doesn't open aymore there. :slightly_frowning_face:

If you are referring to the fact that you would not have a network manager anymore, you can:
sudo apt-get install --download-only --reinstall connman connman-gtk (i'm not sure about this command but should be something like that)
sudo service connman stop
sudo apt-get install connman connman-gtk
sudo service connman start

and you should be free to reinstall it without too many trouble! If this is what you needed i will add it to the script

1 Like

Which leaves the question whether there are others here for whom this method indeed works.

Anyone ?????

I actually never use bluetooth but I do remember that it also requires setting audio devices to it specifically to have output.

We should not worry much about the configurations and scripts since the idea is that it should "work out of the box" like everything else in elive :slight_smile:

This howto is for those who wanted to use it in versions before 3.8.5+ and for having some SEO results in google too to promote elive :wink:

So dependencies will be by default installed in next versions and hopefully the gadget will make it work out of the box directly

2 Likes