#StackBounty: #bluetooth #bluetooth-lowenergy #core-bluetooth #bluetooth-gatt Bluetooth Advertising Data

Bounty: 50

I was trying to understand basics of Bluetooth. I have few queries regarding the scanning and advertising of classic and low energy Bluetooth.

  1. Is EIR data (classic Bluetooth extended inquiry response) and AD data (Bluetooth low energy scan response) read from GAP profile. Where is data from GAP profile stored? Is it on host or controller?
  2. Is there a different GAP profile for classic and different GAP profile for LE ?
  3. When we enable advertising (low energy) using hcitool cmd or enable discoverable mode (classic Bluetooth), how does controller get all the advertisement information (scan response/ extended inquiry response)? Is it stored on controller?
  4. As mentioned in Bluetooth Specification 4.2 section 7.8.8 LE Set Scan Response Data command can be used to provide data for scanning packets. Is this different than GAP ?
  5. Is Gatt Server running before connection is formed ? If not, then how is GAP profile (used for advertising) relevant before connection ?
  6. Can same fields (e.g. device name) from EIR data and AD data be different ?


Get this bounty!!!

#StackBounty: #go #bluetooth #bluez #nrf52 #segger-jlink Error with Go program ( Bettercap 2 ) depending on which bluetooth dongle I us…

Bounty: 50

I use this on Ubuntu 20.04 and Raspberry Pi OS 5.10 but this is not a Linux related issue.

I’m having an issue with a Go program called Bettercap 2 ( https://www.bettercap.org/ and the repository: https://github.com/bettercap/bettercap ) when I use its function to scan bluetooth devices "ble.recon on" with a different bluetooth dongle.

When I use it with a dongle using Realtek RTL8761b drivers ( MPOW MPBH456AB ) you can find on amazon it works well, but when I use a NordicSemi nrf52840 dongle ( https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle ) which is my goal, flashed with Zephyr RTOS’ hci_usb sample ( https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/bluetooth/hci_usb ) which is supposed to turn any micro controller using bluetooth into a regular bluetooth dongle that any computer is supposed to recognize as, it throws this error:

>> ble.recon on
   panic: runtime error: slice bounds out of range [:1] with capacity 0

   goroutine 1 [running]:
   github.com/bettercap/gatt/linux/cmd.(*Cmd).SendAndCheckResp(0x1c637c0, 0xa0c760, 0x1c64fe8, 0x1c6501c, 0x1, 0x1, 0x0, 0x0)
    /home/pi/go/pkg/mod/github.com/bettercap/gatt@v0.0.0-20210514133428-df6e615f2f67/linux/cmd/cmd.go:98 +0x1b4
   github.com/bettercap/gatt/linux.(*HCI).resetDevice(0x18ac0a0, 0x93dc10, 0x18ac0a0)
    /home/pi/go/pkg/mod/github.com/bettercap/gatt@v0.0.0-20210514133428-df6e615f2f67/linux/hci.go:273 +0x2f0
   github.com/bettercap/gatt/linux.NewHCI(0xffffffff, 0x184fd01, 0xff, 0x2, 0x0, 0x0)
    /home/pi/go/pkg/mod/github.com/bettercap/gatt@v0.0.0-20210514133428-df6e615f2f67/linux/hci.go:90 +0x4c0
   github.com/bettercap/gatt.NewDevice(0x184fd1c, 0x2, 0x2, 0x3c, 0x184fd24, 0x1, 0x1)
    /home/pi/go/pkg/mod/github.com/bettercap/gatt@v0.0.0-20210514133428-df6e615f2f67/device_linux.go:57 +0x114
   github.com/bettercap/bettercap/modules/ble.(*BLERecon).Configure(0x18a2780, 0x0, 0x4)
    /home/pi/go/pkg/mod/github.com/bettercap/bettercap@v2.24.1+incompatible/modules/ble/ble_recon.go:165 +0x1cc
   github.com/bettercap/bettercap/modules/ble.(*BLERecon).Start(0x18a2780, 0x1, 0x1b2c001)
    /home/pi/go/pkg/mod/github.com/bettercap/bettercap@v2.24.1+incompatible/modules/ble/ble_recon.go:183 +0x1c
   github.com/bettercap/bettercap/modules/ble.NewBLERecon.func1(0x0, 0x0, 0x0, 0x84f358, 0xc)
    /home/pi/go/pkg/mod/github.com/bettercap/bettercap@v2.24.1+incompatible/modules/ble/ble_recon.go:56 +0x1c
   github.com/bettercap/bettercap/session.(*ModuleHandler).Exec(0x1b2c0c0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/pi/go/pkg/mod/github.com/bettercap/bettercap@v2.24.1+incompatible/session/module_handler.go:74 +0x80
   github.com/bettercap/bettercap/session.(*Session).Run(0x18fb2c0, 0x1c64e30, 0xc, 0x1, 0x1)
    /home/pi/go/pkg/mod/github.com/bettercap/bettercap@v2.24.1+incompatible/session/session.go:416 +0x284
   main.main()
    /home/pi/go/pkg/mod/github.com/bettercap/bettercap@v2.24.1+incompatible/main.go:94 +0x8c8

I have no idea what it means as I’m not a Go developer and have never used this language, I’ve looked at the error and it seems to be in the code but not knowing Go, I prefer to ask before I modify anything.

The problem is only when I’m using the nrf dongle, otherwise it works with the host’s bluetooth and the other realtek dongle.

The nrf dongle works with the BlueZ stack, here are the results:

bluetoothctl ( has a BD address )
Scan does work

$ sudo bluetoothctl
  Agent registered
  [bluetooth]# list
  Controller EB:XX:XX:XX:XX:XX BlueZ 5.50 [default]

btmgmt ( finds the controller )
Scan does work

$ sudo btmgmt --index 0
   [hci0]# auto-power
   Found controller with index 0
   [hci0]# find -l

But, although deprecated, hciconfig and hcitool recognize the realtek dongle but for this one, here are the results:

hciconfig ( no BD address )

$ hciconfig
  hci0:   Type: Primary  Bus: USB
    BD Address: 00:00:00:00:00:00  ACL MTU: 27:7  SCO MTU: 0:0
    UP RUNNING
    RX bytes:1593 acl:0 sco:0 events:88 errors:0
    TX bytes:285 acl:0 sco:0 commands:51 errors:0

hcitool ( Doesn’t find the controller )

$ hcitool scan
  Scanning ...
  Inquiry failed: Operation not supported

So, I assume the dongle works well with BlueZ, being the Linux official bluetooth stack it’s a good sign, but I thought that Bettercap was also using BlueZ and in that sense the dongle should work.

I don’t think there are any drivers to install for the dongle as of the fact that when it is flashed ( J-Link ) it turns into a generic bluetooth dongle.

Do you have any idea what the problem could be ?

I didn’t post on Ask Ubuntu or related because I believe this is a programming issue, not a Linux issue.

Thank you so much for your help !


Get this bounty!!!

#StackBounty: #windows-10 #bluetooth Connecting headphones to bluetooth to the same computer twice (in different operating systems)

Bounty: 500

I have two pair of headphones, both can connect to multiple devices (Bose QC 35 and Bose 700). I have a computer that has 2 installations of Windows 10 and in both I’m seeing the same behaviour: when I connect to one of the two installations, the other one is automatically removed from the list of devices. This is not because I’m reaching the max amount of devices. Do you know what’s going on? how to fix it?

I don’t know much about Bluetooth, but I imagine the hardware of that computer has an id and the headphones can’t have two pairings to the same id? something similar to a MAC? Is it possible to change it by software?


Get this bounty!!!

#StackBounty: #firefox #bluetooth #d-bus #playerctl #mpris firefox disappears from playerctl

Bounty: 100

OS is Debian 10. Firefox version is latest in repos, 78.13.0esr.

Trying to use playerctl with bluetooth buttons to control playback in firefox.

Everything is working fine, I’m away from my desk, pausing and unpausing playback in firefox works as expected.

Suddenly, pause/unpause stops working. I return to my desk, and the output of playerctl -l doesn’t show firefox anymore. The problem is either playerctl, firefox, or something else, but the actual bluetooth button works. (checked with xev)

Pausing and unpausing the playback in firefox manually with the mouse causes playerctl -l to detect firefox again.

How do I fix this?


Get this bounty!!!

#StackBounty: #networking #drivers #20.04 #sound #bluetooth Wifi slows down when Bluetooth headset is connected in Ubuntu 20.04

Bounty: 50

My wifi works perfectly until I connect my system to a Bluetooth headset. After connecting to the Bluetooth headset my wifi slows down a lot. I tried solution from this and this
questions but nothing worked.

The output of lspci -knn | grep Net -A2

02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723]
    DeviceName: Sanji2 
    Subsystem: Hewlett-Packard Company RTL8723BE PCIe Wireless Network Adapter [103c:81c1]
    Kernel driver in use: rtl8723be
    Kernel modules: rtl8723be

thanks in advance 🙂

Edit 1

Output of sudo iwlist freq

lo        no frequency information.

enp1s0    no frequency information.

wlo1      13 channels in total; available frequencies :
          Channel 01 : 2.412 GHz
          Channel 02 : 2.417 GHz
          Channel 03 : 2.422 GHz
          Channel 04 : 2.427 GHz
          Channel 05 : 2.432 GHz
          Channel 06 : 2.437 GHz
          Channel 07 : 2.442 GHz
          Channel 08 : 2.447 GHz
          Channel 09 : 2.452 GHz
          Channel 10 : 2.457 GHz
          Channel 11 : 2.462 GHz
          Channel 12 : 2.467 GHz
          Channel 13 : 2.472 GHz
          Current Frequency:2.447 GHz (Channel 8)


Get this bounty!!!

#StackBounty: #networking #drivers #20.04 #sound #bluetooth Wifi slows down when connected to Bluetooth headset is connected in Ubuntu …

Bounty: 50

My wifi works perfectly until I connect my system to a Bluetooth headset. After connecting to the Bluetooth headset my wifi slows down a lot. I tried solution from this and this
questions but nothing worked.

The output of lspci -knn | grep Net -A2

02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723]
    DeviceName: Sanji2 
    Subsystem: Hewlett-Packard Company RTL8723BE PCIe Wireless Network Adapter [103c:81c1]
    Kernel driver in use: rtl8723be
    Kernel modules: rtl8723be

thanks in advance 🙂

Edit 1

Output of sudo iwlist freq

lo        no frequency information.

enp1s0    no frequency information.

wlo1      13 channels in total; available frequencies :
          Channel 01 : 2.412 GHz
          Channel 02 : 2.417 GHz
          Channel 03 : 2.422 GHz
          Channel 04 : 2.427 GHz
          Channel 05 : 2.432 GHz
          Channel 06 : 2.437 GHz
          Channel 07 : 2.442 GHz
          Channel 08 : 2.447 GHz
          Channel 09 : 2.452 GHz
          Channel 10 : 2.457 GHz
          Channel 11 : 2.462 GHz
          Channel 12 : 2.467 GHz
          Channel 13 : 2.472 GHz
          Current Frequency:2.447 GHz (Channel 8)


Get this bounty!!!

#StackBounty: #20.04 #usb #bluetooth #cinnamon System Freezes when a new bluetooth device or USB device is connected for 5 seconds

Bounty: 50

Unfortunately I cannot show any code or ideas. However if I connect a bluetooth device (my keyboard after going to sleep) or a new USB device (but not SD cards) the system will freeze for around 5 seconds.

Audio will keep playing, but the image is frozen and the mouse/etc will not work.

5.11.0-25 kernel
20.04 Ubuntu


Get this bounty!!!

#StackBounty: #ubuntu #audio #bluetooth Bluetooth Headphone is not detected as an output device in sound setting

Bounty: 50

I am using Ubuntu 20.04 and I have connected my wireless headphone Sony WH-H910N through Bluetooth.

It gets successfully connected but it is not showing as an Output Device in Sound Settings, only Speakers is detected but If I connect realme earphone with the laptop then I can see the Headphones-Built-in-Audio as an output device in the sound setting.

So, what should I do to show my Bluetooth headphones as an output device in the sound setting? Any help would be appreciated.


Get this bounty!!!

#StackBounty: #wireless #20.04 #bluetooth Bluetooth not working in Ubuntu on HP Laptop – 15-di2000tu

Bounty: 50

I have HP Laptop – 15-di2000tu and both WiFi and Bluetooth were working on Windows. After installing Ubuntu 20.04 WiFi is working fine but Bluetooth is showing error "No Bluetooth found. Plugin a dongle to use Bluetooth".

Network Adapter is RTL8723DE

rfkill list output

0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no

bluetoothctl output is Waiting to connect to bluetoothd...

lspci output

00:00.0 Host bridge: Intel Corporation Device 9b61
00:02.0 VGA compatible controller: Intel Corporation Device 9bca (rev 04)
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model
00:12.0 Signal processing controller: Intel Corporation Comet Lake Thermal Subsytem
00:14.0 USB controller: Intel Corporation Device 02ed
00:14.2 RAM memory: Intel Corporation Device 02ef
00:16.0 Communication controller: Intel Corporation Comet Lake Management Engine Interface
00:17.0 RAID bus controller: Intel Corporation 82801 Mobile SATA Controller [RAID mode]
00:1d.0 PCI bridge: Intel Corporation Device 02b0 (rev f0)
00:1d.1 PCI bridge: Intel Corporation Device 02b1 (rev f0)
00:1d.4 PCI bridge: Intel Corporation Device 02b4 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Device 0284
00:1f.3 Audio device: Intel Corporation Device 02c8
00:1f.4 SMBus: Intel Corporation Device 02a3
00:1f.5 Serial bus controller [0c80]: Intel Corporation Comet Lake SPI (flash) Controller
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723DE 802.11b/g/n PCIe Adapter
03:00.0 Non-Volatile memory controller: Toshiba Corporation BG3 NVMe SSD Controller (rev 01)

lsusb output

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 13d3:56c9 IMC Networks HP TrueVision HD Camera
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Sorry for asking this again as there are already lots of such questions, but I am not able to resolve this issue using the suggested solutions or might be I am not doing it properly. So need someone’s help to resolve this.


Get this bounty!!!

#StackBounty: #drivers #bluetooth #pulseaudio #broadcom After installing BCM43142 driver bluetooth stopped working ubuntu 21.04

Bounty: 50

I recently dual boot windows 10 pro and ubuntu 21.04, after installing ubuntu 21.04 when i boot into ubuntu everything works fine except the wifi at that time my bluetooth was working fine but there was no wifi so installed BCM43142 drivers from synaptic package manager and after installing drivers when i reboot my system my wifi start working but my bluetooth stopeped working and stop detecting other devices and connecting already paired devices i already tried many thing like install pulseaudio, restarting bluetooth services, rfkill, reinstalling bluetooth drivers. Nothing work my bluetooth work on windows 10 but not in ubuntu pls help.

lspci output:

00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 0b)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 0b)
00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series HECI #0 (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 1 (rev e4)
00:1c.2 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 3 (rev e4)
00:1c.3 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 4 (rev e4)
00:1d.0 USB controller: Intel Corporation 8 Series USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation 8 Series LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 8 Series SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series SMBus Controller (rev 04)
06:00.0 Network controller: Broadcom Inc. and subsidiaries BCM43142 802.11b/g/n (rev 01)
07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller (rev 07)

lsusb output:

Bus 001 Device 006: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 005: ID 0a5c:21d7 Broadcom Corp. BCM43142 Bluetooth 4.0
Bus 001 Device 004: ID 1bcf:2b8b Sunplus Innovation Technology Inc. 
Bus 001 Device 003: ID c0f4:04e0  
Bus 001 Device 002: ID 8087:8000 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 1ea7:0064 SHARKOON Technologies GmbH 2.4G Mouse
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

systemctl | grep -i blue output:

sys-devices-pci0000:00-0000:00:1d.0-usb1-1x2d1-1x2d1.6-1x2d1.6:1.0-bluetooth-hci0.device loaded active     plugged   /sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.6/1-1.6:1.0/bluetooth/hci0
  sys-subsystem-bluetooth-devices-hci0.device                                                 loaded active     plugged   /sys/subsystem/bluetooth/devices/hci0                                       
  bluetooth.service                                                                           loaded active     running   Bluetooth service                                                           
  bluetooth.target                                                                            loaded active     active    Bluetooth           

dmesg | gerp -i blue output:

[   13.604256] Bluetooth: Core ver 2.22
[   13.604289] Bluetooth: HCI device and connection manager initialized
[   13.604296] Bluetooth: HCI socket layer initialized
[   13.604299] Bluetooth: L2CAP socket layer initialized
[   13.604304] Bluetooth: SCO socket layer initialized
[   15.782083] Bluetooth: hci0: BCM: chip id 70
[   15.783095] Bluetooth: hci0: BCM: features 0x06
[   15.799205] Bluetooth: hci0: shubhang
[   15.799210] Bluetooth: hci0: BCM43142A0 (001.001.011) build 0000
[   16.221057] Bluetooth: hci0: BCM: firmware Patch file not found, tried:
[   16.221061] Bluetooth: hci0: BCM: 'brcm/BCM43142A0-0a5c-21d7.hcd'
[   16.221063] Bluetooth: hci0: BCM: 'brcm/BCM-0a5c-21d7.hcd'
[   18.227516] Bluetooth: hci0: command 0x1003 tx timeout
[   18.229200] Bluetooth: hci0: unexpected event for opcode 0x1003
[   35.453929] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   35.453931] Bluetooth: BNEP filters: protocol multicast
[   35.453935] Bluetooth: BNEP socket layer initialized
[   38.227471] Bluetooth: hci0: command 0x1003 tx timeout
[   38.229183] Bluetooth: hci0: unexpected event for opcode 0x1003
[   74.818324] Bluetooth: RFCOMM TTY layer initialized
[   74.818333] Bluetooth: RFCOMM socket layer initialized
[   74.818343] Bluetooth: RFCOMM ver 1.11

bluetoothctl output:

Agent registered
[CHG] Controller AC:D1:B8:DB:69:38 Pairable: yes

rfkill output:

ID TYPE      DEVICE         SOFT      HARD
 0 wlan      dell-rbtn unblocked unblocked
 1 wlan      phy0      unblocked unblocked
 2 wlan      brcmwl-0  unblocked unblocked
 3 bluetooth hci0      unblocked unblocked

rfkill list all output:

0: dell-rbtn: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
2: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
3: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no


Get this bounty!!!