[Solved] Getting weird behaviour from bluetooth on Debian 9

If none of the more specific forums is the right place to ask

[Solved] Getting weird behaviour from bluetooth on Debian 9

Postby aagontuk » 2019-07-05 17:07

I was trying to use bluetooth in my Dell Inspiron 3521 laptop. I am using debian 9 netinst with i3 wm. I have followed this debian wiki page for this. But when I tried to use my bluetooth from bluetoothctl I noticed that the list command shows no device(or controller according to bluetoothctl). Also hcitool dev command, rfkill list all etc showed no hci device in my system.

Then to check if it is a hardware issue I booted from live ubuntu 19.04 and tried to use bluetooth. In that case my bluetooth worked perfectly. Then when I booted from my debian system again in my surprise I noticed that now my bluetooth is working without any problem!

After rebooting, again my bluetooth device is lost! I can't find any hci device in my debian system. Why is this happening?

Here are some information about my system and relevant command outputs when bluetooth device isn't found:

$ cat /etc/os-release

Code: Select all
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"


$ lspci

Code: Select all
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C216 Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C216 Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C216 Chipset Family SMBus Controller (rev 04)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller (rev 05)
02:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)


$ sudo systemctl status bluetooth

Code: Select all
 bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2019-07-05 23:18:49 +06; 31min ago
     Docs: man:bluetoothd(8)
 Main PID: 2240 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/bluetooth.service
           └─2240 /usr/lib/bluetooth/bluetoothd

Jul 05 23:18:49 multivac systemd[1]: Starting Bluetooth service...
Jul 05 23:18:49 multivac bluetoothd[2240]: Bluetooth daemon 5.43
Jul 05 23:18:49 multivac systemd[1]: Started Bluetooth service.
Jul 05 23:18:49 multivac bluetoothd[2240]: Starting SDP server
Jul 05 23:18:49 multivac bluetoothd[2240]: Bluetooth management interface 1.14 initialized


$ sudo rfkill list all

Code: Select all
0: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no


$ sudo hcitool dev

Code: Select all
Devices:
Last edited by aagontuk on 2019-08-16 14:07, edited 1 time in total.
aagontuk
 
Posts: 6
Joined: 2019-07-05 16:15

Re: Getting weird behaviour from my bluetooth device on Debi

Postby pylkko » 2019-07-18 13:40

Do you have any error messages or similar relating to bluetooth in either dmesg or journalctl outputs? Perhaps non-free firmware or firmware of a particular revision number is needed for full functionality (I suppose the wifi and bluetooth are integrated into one chip).
User avatar
pylkko
 
Posts: 1596
Joined: 2014-11-06 19:02

Re: Getting weird behaviour from my bluetooth device on Debi

Postby aagontuk » 2019-08-08 16:31

I was waiting to test on buster hence late reply. Facing same issue on buster too. I am not sure if wifi and bluetooth is integrated into one chip or not? Here is the output of the `$ lspci` for the network adapter:

Code: Select all
02:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)
   Subsystem: Dell AR9485 Wireless Network Adapter
   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
   Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
   Latency: 0, Cache Line Size: 64 bytes
   Interrupt: pin A routed to IRQ 17
   Region 0: Memory at c0500000 (64-bit, non-prefetchable) [size=512K]
   Expansion ROM at c0580000 [disabled] [size=64K]
   Capabilities: <access denied>
   Kernel driver in use: ath9k
   Kernel modules: ath9k


I have read the datasheet of AR9485 chip from [here](https://www.ath-drivers.eu/qualcomm-ath ... R9485.html) no bluetooth capability is mentioned in the manual.

Output of `dmesg | grep Bluetooth`:

Code: Select all
[    2.892084] usb 1-1.1: Product: Bluetooth USB Host Controller
[   11.471727] Bluetooth: Core ver 2.22
[   11.471747] Bluetooth: HCI device and connection manager initialized
[   11.471751] Bluetooth: HCI socket layer initialized
[   11.471754] Bluetooth: L2CAP socket layer initialized
[   11.471763] Bluetooth: SCO socket layer initialized
[   11.803327] Bluetooth: Loading patch file failed
[   31.330827] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   31.330831] Bluetooth: BNEP filters: protocol multicast
[   31.330842] Bluetooth: BNEP socket layer initialized


Output of `journalctl -u bluetooth`:

Code: Select all
-- Logs begin at Thu 2019-08-08 22:03:33 +06, end at Thu 2019-08-08 23:13:55 +06. --
Aug 08 22:03:55 multivac systemd[1]: Starting Bluetooth service...
Aug 08 22:03:55 multivac bluetoothd[723]: Bluetooth daemon 5.50
Aug 08 22:03:55 multivac systemd[1]: Started Bluetooth service.
Aug 08 22:03:55 multivac bluetoothd[723]: Starting SDP server
Aug 08 22:03:56 multivac bluetoothd[723]: Bluetooth management interface 1.14 initialized


How can I debug this issue further? Any kind of help will be appreciated. Thanks!
Last edited by aagontuk on 2019-08-08 20:36, edited 1 time in total.
aagontuk
 
Posts: 6
Joined: 2019-07-05 16:15

Re: Getting weird behaviour from my bluetooth device on Debi

Postby pylkko » 2019-08-08 17:29

Not sure what you mean with no wireless capacity mentioned in the data sheet. Or are there two distinct documents, one data sheet and other manual? Because the link that you attaced clearly says that it has 802.11 capacities. It also does not mention Bluetooth at all, which I suspect is because the AR9485 is a WiFi only device. Maybe you could figure out what bluetooth device you have? Can you show the output of lsusb? When you say it works on ubuntu, how exactly do you verify this?

Do you have the firmware packages installed or not? can you grep dmesg for firmware?
User avatar
pylkko
 
Posts: 1596
Joined: 2014-11-06 19:02

Re: Getting weird behaviour from my bluetooth device on Debi

Postby aagontuk » 2019-08-08 20:27

My bad! I wanted to write "bluetooth capability" instead.

I tested via a live Ubuntu 19.04 USB stick. In fact I tested again right after your current post. And as expected bluetooth is working in Ubuntu. Then I rebooted to Debian. And in this time bluetooth was working. Then I rebooted again to Debian. Bluetooth was working this time too. But when I powered off my system and then powered on again, bluetooth no longer worked.

It seems that Ubuntu is configuring some bluetooth device states and it persist upon reboot. But flushed if the device is powered off.

$ lsusb

Code: Select all
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 005: ID 0bda:58c2 Realtek Semiconductor Corp.
Bus 003 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 003 Device 003: ID 0cf3:e004 Qualcomm Atheros Communications
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


$ lsusb -v -d 0cf3:e004

Code: Select all

Bus 003 Device 003: ID 0cf3:e004 Qualcomm Atheros Communications
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x0cf3 Qualcomm Atheros Communications
  idProduct          0xe004
  bcdDevice            0.01
  iManufacturer           1 Atheros Communications
  iProduct                2 Bluetooth USB Host Controller
  iSerial                 3 Alaska Day 2006
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x00b1
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4 BT HCI
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
Device Status:     0x0003
  Self Powered
  Remote Wakeup Enabled


Do you have the firmware packages installed or not?

bluez bluetooth stack is installed in my system.

$ dpkg -l | grep bluez
Code: Select all
ii  bluez                                 5.50-1                               amd64        Bluetooth tools and daemons
ii  bluez-firmware                        1.2-4                                all          Firmware for Bluetooth devices
ii  bluez-obexd                           5.50-1                               amd64        bluez obex daemon


can you grep dmesg for firmware?

Did you mean `dmesg | grep firmware` ?

$ dmesg | grep firmware
Code: Select all
[   11.413009] usb 3-1.1: firmware: failed to load ar3k/AthrBT_0x01020200.dfu (-2)
[   11.413059] firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware
[   11.413107] usb 3-1.1: Direct firmware load for ar3k/AthrBT_0x01020200.dfu failed with error -2
[   17.969748] r8169 0000:01:00.0: firmware: failed to load rtl_nic/rtl8105e-1.fw (-2)
[   17.970674] r8169 0000:01:00.0: Direct firmware load for rtl_nic/rtl8105e-1.fw failed with error -2
[   17.970678] r8169 0000:01:00.0 enp1s0: unable to load firmware patch rtl_nic/rtl8105e-1.fw (-2)
aagontuk
 
Posts: 6
Joined: 2019-07-05 16:15

Re: Getting weird behaviour from my bluetooth device on Debi

Postby pylkko » 2019-08-09 07:37

No, I don't mean bluez, that is a general purpose bluetooth stack that is used by all computers. With firmware, I mean that your devices needs specific piece of software for that device. Often these firmwares are propietary (not open source) small binary files, made by the company that manufactures the device. Debian has a more stricter policy against such "non-open source" packages than Ubuntu, and I was suspecting that this might be the reason. Often when there is a network card and it either does not work or it has only partial functionality (missing bluetooth entirely or something similar) it is because the firmware to enable it is missing. As you can see from your kernel log, the kernel is reporting that it failed to load a firmware called AthrBT_0x01020200.dfu. Sounds very much like Atheros Bluetooth.... So I suspect that either 1) you do not have that file, which them means that you have not installed a package which provides it or 2) the file is damage or does not load for some other reason. if you search for "AthrBT_0x01020200.dfu Debian" the first hit is this

https://packages.debian.org/search?sear ... 020200.dfu

which says you should have this file on your computer

/lib/firmware/ar3k/AthrBT_0x01020200.dfu

you maybe do not,

if so, then the same link says that this file is provide by the package firmware-atheros which is described here:

https://packages.debian.org/buster/firmware-atheros

it says that this is included in

https://packages.debian.org/source/bust ... re-nonfree

that page also links to this explanation of why it is not in Debian:

https://www.debian.org/doc/debian-polic ... chive-area

In order to use non-free things, you need to enable the repo and install the above package from there. Hint: do a search

notice, there are also other similar firmware load errors. Use the method I used above to find them.
User avatar
pylkko
 
Posts: 1596
Joined: 2014-11-06 19:02

Re: [Solved] Getting weird behaviour from bluetooth on Debia

Postby aagontuk » 2019-08-16 14:08

Installing firmware-atheros solved the issue. Thanks for all the help and explanations.
aagontuk
 
Posts: 6
Joined: 2019-07-05 16:15


Return to General Questions

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable