Hi People, last weekend I got a SONY SRS-XB20 Bluetooth speaker as a gift from my brother which worked perfectly with my Android mobile. Then I wanted to connect this with my Ubuntu laptop and had to go through lot of Googling to play a song on it!. Here is the steps I have taken in case anybody wanted..
First thing I noticed was my Bluetooth is not enabling correctly on through the GUI. When I click the Bluetooth ON button it moves to the Off side showing its enabling but not really working.
This made me sure about the hardware has identified correctly by the system,
lspci -nnk | grep -iA3 net; lsusb; dmesg | egrep -i 'blue|firm'
01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [10ec:8136] (rev 05)
Subsystem: Dell RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [1028:0597]
Kernel driver in use: r8169
Kernel modules: r8169
02:00.0 Network controller [0280]: Qualcomm Atheros AR9485 Wireless Network Adapter [168c:0032] (rev 01)
Subsystem: Dell AR9485 Wireless Network Adapter [1028:0209]
Kernel driver in use: ath9k
Kernel modules: ath9k
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0c45:649a Microdia
Bus 001 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 003: ID 0cf3:e004 Atheros Communications, Inc.
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 09da:c10a A4Tech Co., Ltd.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[ 2.715869] usb 1-1.1: Product: Bluetooth USB Host Controller
[ 12.567728] Bluetooth: Core ver 2.22
[ 12.567748] Bluetooth: HCI device and connection manager initialized
[ 12.567752] Bluetooth: HCI socket layer initialized
[ 12.567754] Bluetooth: L2CAP socket layer initialized
[ 12.567759] Bluetooth: SCO socket layer initialized
[ 28.907788] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 28.907790] Bluetooth: BNEP filters: protocol multicast
[ 28.907794] Bluetooth: BNEP socket layer initialized
[ 83.309988] Bluetooth: RFCOMM TTY layer initialized
[ 83.310004] Bluetooth: RFCOMM socket layer initialized
[ 83.310012] Bluetooth: RFCOMM ver 1.11
Next step is reinstalling my Bluetooth driver completely. So if there’s any issue, it will wipe out and reinstall correctly with the current system config
sudo apt-get --reinstall install bluez
Now make sure your Bluetooth device is not blocked by rfkill.
- Run
rfkill list
and it should give you a screen similar to below if the device is blocked by the utility.
manjula@Cluster-M:~$ rfkill list
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no
- Notice the above device
1
is soft blocked. Let’s unblock it too..
rfkill unblock 1
- Run
rfkill list
and make sure the device is no more blocked.
That’s it, Bluetooth device is enabled correctly but still the GUI is unresponsive and can’t connect to my speaker. No Worries, let’s do this through the console!!!
Fire the console and you will have a nice and cool tool bluetoothctl
comes with Ubuntu.
Below the steps to connect to a device,
- Run
bluetoothctl
.
- Set the default agent
default-agent
.
- Power on the device
power on
. (The device will power off on each startup and you can set it to auto power on by adding AutoEnable=true
in /etc/bluetooth/main.conf
at the bottom in the [Policy]
section).
- Let’s scan for available devices,
scan on
. (make sure your BL device is on pairing mode, the connection LED should blink continuously).
- Once the scan is finished it will list down the MAC addresses of the available devices and note the BL speaker you wanted to connect.
- Type
pair
and hit enter. (enter the first two letters of the MAC and hit TAB to auto complete. ‘Case Sensitive’)
- Once the device is successfully paired,
connect
to start the paired connection.
- Now the connection is successfully established and you are ready to play with sound tool. Take a look at my sample connection terminal snap below if you missed any of above point.
manjula@Cluster-M:~$ bluetoothctl
[NEW] Controller F4:B7:E2:8A:C8:8C Cluster-M [default]
[NEW] Device B8:D5:0B:5A:4E:64 B8-D5-0B-5A-4E-64
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller F4:B7:E2:8A:C8:8C Discovering: yes
[CHG] Device B8:D5:0B:5A:4E:64 RSSI: -44
[CHG] Device B8:D5:0B:5A:4E:64 TxPower: 0
[CHG] Device B8:D5:0B:5A:4E:64 Name: SRS-XB20
[CHG] Device B8:D5:0B:5A:4E:64 Alias: SRS-XB20
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 00000000-deca-fade-deca-deafdecacaff
[CHG] Device B8:D5:0B:5A:4E:64 ManufacturerData Key: 0x5349
[CHG] Device B8:D5:0B:5A:4E:64 ManufacturerData Value: 0x53
[CHG] Device B8:D5:0B:5A:4E:64 ManufacturerData Value: 0x43
[bluetooth]# pair B8:D5:0B:5A:4E:64
Attempting to pair with B8:D5:0B:5A:4E:64
[CHG] Device B8:D5:0B:5A:4E:64 Connected: yes
[CHG] Device B8:D5:0B:5A:4E:64 Modalias: bluetooth:v0039p1582d2203
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 00000000-deca-fade-deca-deafdecacaff
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device B8:D5:0B:5A:4E:64 ServicesResolved: yes
[CHG] Device B8:D5:0B:5A:4E:64 Paired: yes
Pairing successful
[CHG] Device B8:D5:0B:5A:4E:64 ServicesResolved: no
[CHG] Device B8:D5:0B:5A:4E:64 Connected: no
[bluetooth]# connect B8:D5:0B:5A:4E:64
Attempting to connect to B8:D5:0B:5A:4E:64
[CHG] Device B8:D5:0B:5A:4E:64 Connected: yes
Connection successful
Not let’s look at the audio controller, just play a song and see whether it plays on the BL speaker. If not, just follow the below steps,
Install the Pulse Audio controller for more tweaking
sudo apt-get install pavucontrol
- Open PulseAudio Volume Control and go to the Configurations tab and set your Bluetooth speaker profile to A2DP Sink as shown in the blow screenshot,
- Move to the Playback tab and switch to the secondary audio device shown in the drop down as shown below,
Annd that’s it. Your speakers should start showing it’s colors. Let me know your thoughts in comments.
Happy Christmas and happy new year 2018!!.
Here is mine, Love it ❤
Source : ArchLinux wiki