leifliddy / macbook12-bluetooth-driver

140 stars 25 forks source link

Bluetooth not work on Macbook 13,1 Manjaro 5.4.8/5.9 #9

Closed Artawower closed 3 years ago

Artawower commented 3 years ago

Hi, i installed this patch on my macbook13.1 (2016, 2 thunderbolt, no touch bar). But bluetooth not work for me, and i can't find reason.

My sudo dmesg | egrep -i 'blue|firm' output

[    0.197931] Spectre V2 : Enabling Restricted Speculation for firmware calls
[    0.226962] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[    6.909001] Bluetooth: Core ver 2.22
[    6.909018] Bluetooth: HCI device and connection manager initialized
[    6.909021] Bluetooth: HCI socket layer initialized
[    6.909024] Bluetooth: L2CAP socket layer initialized
[    6.909027] Bluetooth: SCO socket layer initialized
[    7.037966] Bluetooth: HCI UART driver ver 2.3
[    7.037968] Bluetooth: HCI UART protocol H4 registered
[    7.037969] Bluetooth: HCI UART protocol BCSP registered
[    7.037979] Bluetooth: HCI UART protocol LL registered
[    7.037980] Bluetooth: HCI UART protocol ATH3K registered
[    7.037988] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    7.038029] Bluetooth: HCI UART protocol Intel registered
[    7.038062] Bluetooth: HCI UART protocol Broadcom registered
[    7.038069] Bluetooth: HCI UART protocol QCA registered
[    7.038070] Bluetooth: HCI UART protocol AG6XX registered
[    7.038077] Bluetooth: HCI UART protocol Marvell registered
[    7.715125] brcmfmac 0000:02:00.0: Direct firmware load for brcm/brcmfmac4350c2-pcie.Apple Inc.-MacBookPro13,1.txt failed with error -2
[    7.715147] brcmfmac 0000:02:00.0: Direct firmware load for brcm/brcmfmac4350c2-pcie.txt failed with error -2
[    7.763973] [drm] Finished loading DMC firmware i915/skl_dmc_ver1_27.bin (v1.27)
[    7.769990] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    7.769992] Bluetooth: BNEP filters: protocol multicast
[    7.769995] Bluetooth: BNEP socket layer initialized
[    8.076174] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4350/5 wl0: Nov 26 2015 03:48:57 version 7.35.180.133 (r602372) FWID 01-c45b39d6
[    8.104393] Bluetooth: hci0: BCM: failed to write update baudrate (-16)
[    8.104395] Bluetooth: hci0: Failed to set baudrate
[    8.211618] Bluetooth: hci0: BCM: chip id 92
[    8.211880] Bluetooth: hci0: BCM: features 0x2f
[    8.212991] Bluetooth: hci0: BCM4350C0 UART 37.4 MHz Gamay Murata UHE
[    8.212993] Bluetooth: hci0: BCM (003.001.133) build 1523
[    8.274910] Bluetooth: hci0: BCM: Patch command fc4c failed (-16)
[    8.274912] Bluetooth: hci0: BCM: Patch failed (-16)
[   10.464337] Bluetooth: hci0: command 0x1001 tx timeout
[   18.571045] Bluetooth: hci0: BCM: Reading local version info failed (-110)
[   26.380081] audit: type=1130 audit(1608755332.326:60): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=blueman-mechanism comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

bluetooth system

● bluetooth.service - Bluetooth service
     Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: disabled)
     Active: active (running) since Wed 2020-12-23 23:28:33 MSK; 5min ago
       Docs: man:bluetoothd(8)
   Main PID: 453 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 9367)
     Memory: 2.5M
     CGroup: /system.slice/bluetooth.service
             └─453 /usr/lib/bluetooth/bluetoothd

дек 23 23:28:33 darkawower-macbookpro131 bluetoothd[453]: src/main.c:parse_controller_config() Key file does not have key “LEScanIntervalConn>
дек 23 23:28:33 darkawower-macbookpro131 bluetoothd[453]: src/main.c:parse_controller_config() Key file does not have key “LEScanWindowConnec>
дек 23 23:28:33 darkawower-macbookpro131 bluetoothd[453]: src/main.c:parse_controller_config() Key file does not have key “LEMinConnectionInt>
дек 23 23:28:33 darkawower-macbookpro131 bluetoothd[453]: src/main.c:parse_controller_config() Key file does not have key “LEMaxConnectionInt>
дек 23 23:28:33 darkawower-macbookpro131 bluetoothd[453]: src/main.c:parse_controller_config() Key file does not have key “LEConnectionLatenc>
дек 23 23:28:33 darkawower-macbookpro131 bluetoothd[453]: src/main.c:parse_controller_config() Key file does not have key “LEConnectionSuperv>
дек 23 23:28:33 darkawower-macbookpro131 bluetoothd[453]: src/main.c:parse_controller_config() Key file does not have key “LEAutoconnecttimeo>
дек 23 23:28:33 darkawower-macbookpro131 systemd[1]: Started Bluetooth service.
дек 23 23:28:33 darkawower-macbookpro131 bluetoothd[453]: Starting SDP server
дек 23 23:28:33 darkawower-macbookpro131 bluetoothd[453]: Bluetooth management interface 1.14 initialized

When i try use bluetoothctl i see No default controller available. What i missed?

leifliddy commented 3 years ago

@Artawower Can you post the output of these two commands?

ls -lA /lib/modules/$(uname -r)/updates
uname -a
Artawower commented 3 years ago
total 600
-rw-r--r-- 1 root root 317120 дек 24 00:14 hci_uart.ko
-rw-r--r-- 1 root root 293568 дек 23 13:03 snd-hda-codec-cirrus.ko

Linux darkawower-macbookpro131 5.4.80-2-MANJARO #1 SMP PREEMPT Sat Nov 28 09:58:18 UTC 2020 x86_64 GNU/Linux

leifliddy commented 3 years ago

hmmm....something's off, the hci_uart.ko module should be around 6MB uncompressed. ie

[root@mac ~]# ls -lA /lib/modules/$(uname -r)/updates
total 6924
-rw-r--r--. 1 root root 6219576 Dec 18 05:59 hci_uart.ko

I'll try setting up a manjaro VM later today and see if I can replicate your results.

leifliddy commented 3 years ago

I figured out why the size of my hci_uart.ko was so big. I just modified the Makefile with this option to strip out debug symbols

strip --strip-debug hci_uart.ko

and that significannly reduces the size of the module

[root@mac ~]$ ls -lA /lib/modules/$(uname -r)/updates
total 464
-rw-r--r--. 1 root root 315424 Dec 25 06:04 hci_uart.ko

Manjaro must be using a similar option by default to strip modules of unneeded symbols. But....I'm still not sure why this module isn't working on your system.

You shouldn't be getting these errors:

[    8.274910] Bluetooth: hci0: BCM: Patch command fc4c failed (-16)
[    8.274912] Bluetooth: hci0: BCM: Patch failed (-16)
[   10.464337] Bluetooth: hci0: command 0x1001 tx timeout

These people have the exact same BCM4350/5 controller, and they managed to get it working.

https://github.com/Dunedan/mbp-2016-linux/issues/99 https://github.com/Dunedan/mbp-2016-linux/issues/29#issuecomment-476666397 (this was actually working, he just didn't realize until later)

Do you have the linux54-headers package installed?

pacman -S linux54-headers

This should install the necessary header files for your 5.4 kernel under: /lib/modules/$(uname -r)/build

Can you post the output of: dmesg | egrep -i 'bluetooth|hci_uart| dw-apb-uart|brcmfmac|8250|ttys'

Also, just to ensure that your system is attempting to load the updates/hci_uart.ko Could you try renaming the stock module to ensure that your system will not attempt to load it?

mv /lib/modules/$(uname -r)/kernel/drivers/bluetooth/hci_uart.ko.xz /lib/modules/$(uname -r)/kernel/drivers/bluetooth/hci_uart.ko.xz.orig

Also ensure that the hci_uart module is not contained within your initramfs image

lsinitcpio /boot/initramfs-$(uname -r | cut -d '.' -f1-2)-x86_64.img | grep hci_uart

Also, try powering down the macbook rather then just rebooting it, and see if that makes a difference.

One more thing....you should be seeing something like this in your logs

[    7.482510] bluetooth hci0: Direct firmware load for brcm/BCM.hcd failed with error -2
[    7.482545] Bluetooth: hci0: BCM: Patch brcm/BCM.hcd not found

But, your logs show this

[    8.274910] Bluetooth: hci0: BCM: Patch command fc4c failed (-16)
[    8.274912] Bluetooth: hci0: BCM: Patch failed (-16)

It looks like it might be trying to load firmware onto the bluetooth device. This bluetooth controller requires NO firmware at all, so firmware load failures are completely normal. Could you post the output of

find /lib/firmware/ | grep -i bcm
Artawower commented 3 years ago

Ye, i installed headers (i used them for sound patch)

sudo pacman -Q | grep headers
linux-api-headers 5.8-1
linux54-headers 5.4.80-2
linux59-headers 5.9.11-3
dmesg | egrep -i 'bluetooth|hci_uart| dw-apb-uart|brcmfmac|8250|ttys' ``` [ 0.144472] ACPI Error: AE_ALREADY_EXISTS, SSDT 0xFFFF888825038000 Table is already loaded (20200717/tbdata-520) [ 0.422478] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 6.886401] Bluetooth: Core ver 2.22 [ 6.886419] Bluetooth: HCI device and connection manager initialized [ 6.886422] Bluetooth: HCI socket layer initialized [ 6.886424] Bluetooth: L2CAP socket layer initialized [ 6.886428] Bluetooth: SCO socket layer initialized [ 6.968167] dw-apb-uart.2: ttyS0 at MMIO 0x9282b000 (irq = 20, base_baud = 3000000) is a 16550A [ 6.968641] serial serial0: tty port ttyS0 registered [ 7.061626] hci_uart: loading out-of-tree module taints kernel. [ 7.061773] hci_uart: module verification failed: signature and/or required key missing - tainting kernel [ 7.139642] Bluetooth: HCI UART driver ver 2.3 [ 7.139644] Bluetooth: HCI UART protocol H4 registered [ 7.139645] Bluetooth: HCI UART protocol BCSP registered [ 7.139659] Bluetooth: HCI UART protocol LL registered [ 7.139660] Bluetooth: HCI UART protocol ATH3K registered [ 7.139668] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 7.140690] Bluetooth: HCI UART protocol Intel registered [ 7.144645] Bluetooth: HCI UART protocol Broadcom registered [ 7.144660] Bluetooth: HCI UART protocol QCA registered [ 7.144661] Bluetooth: HCI UART protocol AG6XX registered [ 7.144670] Bluetooth: HCI UART protocol Marvell registered [ 7.154775] hci_uart_bcm serial0-0: Unexpected ACPI gpio_int_idx: -1 [ 7.154777] hci_uart_bcm serial0-0: Unexpected number of ACPI GPIOs: 0 [ 7.154782] hci_uart_bcm serial0-0: No reset resource, using default baud rate [ 7.393670] usbcore: registered new interface driver brcmfmac [ 7.491049] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 7.491050] Bluetooth: BNEP filters: protocol multicast [ 7.491054] Bluetooth: BNEP socket layer initialized [ 7.515220] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4350c2-pcie for chip BCM4350/5 [ 7.519410] brcmfmac 0000:02:00.0: Direct firmware load for brcm/brcmfmac4350c2-pcie.Apple Inc.-MacBookPro13,1.txt failed with error -2 [ 7.519433] brcmfmac 0000:02:00.0: Direct firmware load for brcm/brcmfmac4350c2-pcie.txt failed with error -2 [ 7.825207] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4350c2-pcie for chip BCM4350/5 [ 7.825274] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available [ 7.825490] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4350/5 wl0: Nov 26 2015 03:48:57 version 7.35.180.133 (r602372) FWID 01-c45b39d6 [ 7.872521] brcmfmac 0000:02:00.0 wlp2s0: renamed from wlan0 [ 7.899795] Bluetooth: hci0: BCM: failed to write update baudrate (-16) [ 7.899800] Bluetooth: hci0: Failed to set baudrate [ 8.010246] Bluetooth: hci0: BCM: chip id 92 [ 8.011352] Bluetooth: hci0: BCM: features 0x2f [ 8.012898] Bluetooth: hci0: BCM4350C0 UART 37.4 MHz Gamay Murata UHE [ 8.012907] Bluetooth: hci0: BCM (003.001.133) build 1523 [ 8.015497] Bluetooth: hci0: BCM 'brcm/BCM.hcd' Patch [ 8.072649] Bluetooth: hci0: BCM: Patch command fc4c failed (-16) [ 8.072654] Bluetooth: hci0: BCM: Patch failed (-16) [ 10.165194] Bluetooth: hci0: command 0xfc18 tx timeout [ 18.271552] Bluetooth: hci0: BCM: failed to write update baudrate (-110) [ 20.404876] Bluetooth: hci0: command 0x1001 tx timeout [ 28.511257] Bluetooth: hci0: BCM: Reading local version info failed (-110) ```

lsinitcpio /boot/initramfs-$(uname -r | cut -d '.' -f1-2)-x86_64.img | grep hci_uart - empty output

find /lib/firmware/ | grep -i bcm

/lib/firmware/cxgb4/bcm8483.bin
/lib/firmware/brcm/bcm43xx_hdr-0.fw
/lib/firmware/brcm/bcm4329-fullmac-4.bin
/lib/firmware/brcm/BCM-0a5c-6412.hcd
/lib/firmware/brcm/BCM-0a5c-6410.hcd
/lib/firmware/brcm/BCM.hcd
/lib/firmware/brcm/BCM-0bb4-0306.hcd
/lib/firmware/brcm/bcm43xx-0.fw

These people have the exact same BCM4350/5 controller, and they managed to get it working.

Dunedan/mbp-2016-linux#99 Dunedan/mbp-2016-linux#29 (comment) (this was actually working, he just didn't realize it until later)

Its inspired me to continue research this problem, and i found this repo. I seen this issues, but i couldn't solve my problem

I also tried shutdown my computer after script and moved

mv /lib/modules/$(uname -r)/kernel/drivers/bluetooth/hci_uart.ko.xz /lib/modules/$(uname -r)/kernel/drivers/bluetooth/hci_uart.ko.xz.orig

(also without any result ;().

leifliddy commented 3 years ago

Ok, your system is definitely trying to load the custom hci_uart.ko module....that's good!

[    7.061626] hci_uart: loading out-of-tree module taints kernel.
[    7.061773] hci_uart: module verification failed: signature and/or required key missing - tainting kernel

What package is this file apart of? /lib/firmware/brcm/BCM.hcd

I've never used Arch or Manjaro before, but I believe the command is

 pacman -Qo /lib/firmware/brcm/BCM.hcd

Try removing or renaming that file, reboot, and then post the output of dmesg | egrep -i 'bluetooth|hci_uart|dw-apb-uart|brcmfmac|8250|ttys'

This file cannot exist: (you should see the following output in your dmesg log)

[    7.482510] bluetooth hci0: Direct firmware load for brcm/BCM.hcd failed with error -2
[    7.482545] Bluetooth: hci0: BCM: Patch brcm/BCM.hcd not found

the system will look for brcm/BCM.hcd but it should NOT be able to find it. If that file exists, then the system will attempt to load the brcm/BCM.hcd firmware to the bluetooth controller. As I said before, this bluetooth controller requires NO firmware at all in which to operate.

Artawower commented 3 years ago

pacman -Qo /lib/firmware/brcm/BCM.hcd

error: No package owns /lib/firmware/brcm/BCM.hcd

I moved this file to tmp dir, and after restart bluetooth worked! Thanks a lot for your help!

jrmoulton commented 3 years ago

I'm having a similar issue on a Macbook 14,1. I installed this patch but Bluetooth still isn't working.

ls -lA /lib/modules/$(uname -r)/updates total 0 Any ideas?

(I am very new to Linux kernel patches)

UPDATE: I reran the script as root and now the result of the above command

total 2156
-rw-r--r--. 1 root root  122456 Jan 22 14:21 hci_uart.ko
-rw-r--r--. 1 root root 2082136 Jan 22 14:20 snd-hda-codec-cirrus.ko

but there are still no Bluetooth adapters found.

leifliddy commented 3 years ago

@jrmoulton I need a bit more information then that. What distro + release version are you running? ie Fedora 33 or Ubuntu 20.04...etc

Which kernel are you running: (just post the output of uname -r)

Is the module compiling correctly? Could you post the output of ./install.bluetooth.sh (if you're root) or sudo ./install.bluetooth.sh (if you're not root)

leifliddy commented 3 years ago

@jrmoulton Ok, you just need to reboot your system then. If it's still not working then post the output of journalctl -b | grep -i bluetooth or dmesg | grep -i bluetooth

leifliddy commented 3 years ago

@jrmoulton I'd like to close this issue. Can you please confirm whether bluetooth is working or not?

jrmoulton commented 3 years ago

Bluetooth after reboot is still not working This is centOS 8 with an updated kernel

5.10.9-1.el8.elrepo.x86_64

and --2021-01-22 15:26:39-- https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.9.tar.xz Resolving cdn.kernel.org (cdn.kernel.org)... 151.101.1.176, 151.101.65.176, 151.101.129.176, ... Connecting to cdn.kernel.org (cdn.kernel.org)|151.101.1.176|:443... connected. HTTP request sent, awaiting response... 416 Range Not Satisfiable

The file is already fully retrieved; nothing to do.

tar --strip-components=2 -xvf build/linux-5.10.9.tar.xz linux-5.10.9/drivers/bluetooth --directory=build/ linux-5.10.9/drivers/bluetooth/ linux-5.10.9/drivers/bluetooth/Kconfig linux-5.10.9/drivers/bluetooth/Makefile linux-5.10.9/drivers/bluetooth/ath3k.c linux-5.10.9/drivers/bluetooth/bcm203x.c linux-5.10.9/drivers/bluetooth/bfusb.c linux-5.10.9/drivers/bluetooth/bluecard_cs.c linux-5.10.9/drivers/bluetooth/bpa10x.c linux-5.10.9/drivers/bluetooth/bt3c_cs.c linux-5.10.9/drivers/bluetooth/btbcm.c linux-5.10.9/drivers/bluetooth/btbcm.h linux-5.10.9/drivers/bluetooth/btintel.c linux-5.10.9/drivers/bluetooth/btintel.h linux-5.10.9/drivers/bluetooth/btmrvl_debugfs.c linux-5.10.9/drivers/bluetooth/btmrvl_drv.h linux-5.10.9/drivers/bluetooth/btmrvl_main.c linux-5.10.9/drivers/bluetooth/btmrvl_sdio.c linux-5.10.9/drivers/bluetooth/btmrvl_sdio.h linux-5.10.9/drivers/bluetooth/btmtksdio.c linux-5.10.9/drivers/bluetooth/btmtkuart.c linux-5.10.9/drivers/bluetooth/btqca.c linux-5.10.9/drivers/bluetooth/btqca.h linux-5.10.9/drivers/bluetooth/btqcomsmd.c linux-5.10.9/drivers/bluetooth/btrsi.c linux-5.10.9/drivers/bluetooth/btrtl.c linux-5.10.9/drivers/bluetooth/btrtl.h linux-5.10.9/drivers/bluetooth/btsdio.c linux-5.10.9/drivers/bluetooth/btusb.c linux-5.10.9/drivers/bluetooth/dtl1_cs.c linux-5.10.9/drivers/bluetooth/h4_recv.h linux-5.10.9/drivers/bluetooth/hci_ag6xx.c linux-5.10.9/drivers/bluetooth/hci_ath.c linux-5.10.9/drivers/bluetooth/hci_bcm.c linux-5.10.9/drivers/bluetooth/hci_bcsp.c linux-5.10.9/drivers/bluetooth/hci_h4.c linux-5.10.9/drivers/bluetooth/hci_h5.c linux-5.10.9/drivers/bluetooth/hci_intel.c linux-5.10.9/drivers/bluetooth/hci_ldisc.c linux-5.10.9/drivers/bluetooth/hci_ll.c linux-5.10.9/drivers/bluetooth/hci_mrvl.c linux-5.10.9/drivers/bluetooth/hci_nokia.c linux-5.10.9/drivers/bluetooth/hci_qca.c linux-5.10.9/drivers/bluetooth/hci_serdev.c linux-5.10.9/drivers/bluetooth/hci_uart.h linux-5.10.9/drivers/bluetooth/hci_vhci.c make -C /lib/modules/5.10.9-1.el8.elrepo.x86_64/build M=/home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9 modules make[1]: Entering directory '/usr/src/kernels/5.10.9-1.el8.elrepo.x86_64' CC [M] /home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9/hci_ldisc.o CC [M] /home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9/hci_h4.o CC [M] /home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9/hci_bcsp.o CC [M] /home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9/hci_ath.o CC [M] /home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9/hci_intel.o CC [M] /home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9/hci_ag6xx.o LD [M] /home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9/hci_uart.o MODPOST /home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9/Module.symvers CC [M] /home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9/hci_uart.mod.o LD [M] /home/ecestudent/macbook12-bluetooth-driver/build/bluetooth-5.10.9/hci_uart.ko make[1]: Leaving directory '/usr/src/kernels/5.10.9-1.el8.elrepo.x86_64' strip --strip-debug hci_uart.ko cp hci_uart.ko /lib/modules/5.10.9-1.el8.elrepo.x86_64/updates depmod -a

contents of /lib/modules/5.10.9-1.el8.elrepo.x86_64/updates total 2156 -rw-r--r--. 1 root root 122456 Jan 22 15:26 hci_uart.ko -rw-r--r--. 1 root root 2082136 Jan 22 14:20 snd-hda-codec-cirrus.ko

and

journalctl -b | grep -i bluetooth Jan 22 14:22:19 localhost.localdomain NetworkManager[976]: [1611350539.7710] Loaded device plugin: NMBluezManager (/usr/lib64/NetworkManager/1.26.0-12.el8_3/libnm-device-plugin-bluetooth.so) Jan 22 14:22:35 localhost.localdomain systemd[1792]: Starting Bluetooth OBEX service... Jan 22 14:22:35 localhost.localdomain systemd[1792]: Started Bluetooth OBEX service. Jan 22 14:25:55 computer.localdomain systemsettings5[3207]: kf5.kconfigwidgets: A widget named ' "kcfg_enableGlobalBluetooth" ' was found but there is no setting named ' "enableGlobalBluetooth" ' Jan 22 15:26:27 computer.localdomain dbus-daemon[740]: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service' requested by ':1.888' (uid=0 pid=4956 comm="sudo ./install.bluetooth.sh " label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023") Jan 22 15:26:39 computer.localdomain sudo[4967]: ecestudent : TTY=pts/1 ; PWD=/home/ecestudent/macbook12-bluetooth-driver ; USER=root ; COMMAND=./install.bluetooth.sh

leifliddy commented 3 years ago

Can you post the output of dmesg | grep -i bluetooth then? You should see something like this:

[root@mac ~]# dmesg -T | grep -i bluetooth
[Fri Jan 22 23:44:44 2021] Bluetooth: Core ver 2.22
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI device and connection manager initialized
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI socket layer initialized
[Fri Jan 22 23:44:44 2021] Bluetooth: L2CAP socket layer initialized
[Fri Jan 22 23:44:44 2021] Bluetooth: SCO socket layer initialized
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART driver ver 2.3
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART protocol H4 registered
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART protocol BCSP registered
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART protocol LL registered
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART protocol ATH3K registered
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART protocol Three-wire (H5) registered
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART protocol Intel registered
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART protocol Broadcom registered
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART protocol QCA registered
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART protocol AG6XX registered
[Fri Jan 22 23:44:44 2021] Bluetooth: HCI UART protocol Marvell registered
[Fri Jan 22 23:44:45 2021] Bluetooth: hci0: BCM: failed to write update baudrate (-16)
[Fri Jan 22 23:44:45 2021] Bluetooth: hci0: Failed to set baudrate
[Fri Jan 22 23:44:45 2021] Bluetooth: hci0: BCM: chip id 92
[Fri Jan 22 23:44:45 2021] Bluetooth: hci0: BCM: features 0x2f
[Fri Jan 22 23:44:45 2021] Bluetooth: hci0: BCM4350C0 UART 37.4 MHz Gamay Murata UHE
[Fri Jan 22 23:44:45 2021] Bluetooth: hci0: BCM (003.001.126) build 1492
[Fri Jan 22 23:44:45 2021] Bluetooth: hci0: BCM: firmware Patch file not found, tried:
[Fri Jan 22 23:44:45 2021] Bluetooth: hci0: BCM: 'brcm/BCM.hcd'
[Fri Jan 22 23:44:45 2021] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[Fri Jan 22 23:44:45 2021] Bluetooth: BNEP filters: protocol multicast
[Fri Jan 22 23:44:45 2021] Bluetooth: BNEP socket layer initialized
[Fri Jan 22 23:44:48 2021] Bluetooth: hci0: unknown advertising packet type: 0x10
[Fri Jan 22 23:44:50 2021] Bluetooth: hci0: unknown advertising packet type: 0x20
[Fri Jan 22 23:45:06 2021] Bluetooth: hci0: unknown advertising packet type: 0x10
[Fri Jan 22 23:45:09 2021] Bluetooth: hci0: unknown advertising packet type: 0x10
[Fri Jan 22 23:45:20 2021] Bluetooth: RFCOMM TTY layer initialized
[Fri Jan 22 23:45:20 2021] Bluetooth: RFCOMM socket layer initialized
[Fri Jan 22 23:45:20 2021] Bluetooth: RFCOMM ver 1.11
...

Also, did you reboot your system after compiling + installing the module? Judging from the timestamps, it looks you didn't...

jrmoulton commented 3 years ago

When I run it it doesn't return anything

jrmoulton commented 3 years ago

I didn't reboot the second time I ran the commands (only the first time) so they would have very close time stamps. I just rebooted again but bluetooth still isn't working

leifliddy commented 3 years ago

Ok, is anything showing up in the dmesg log now?

jrmoulton commented 3 years ago

[ecestudent@computer ~]$ dmesg | grep -i bluetooth [ecestudent@computer ~]$

still nothing

leifliddy commented 3 years ago

hmmm, I wonder if centos8 is too old in terms of user-space bluetooth support...or whether you're missing something else. Is the bluetooth service running? Can you post the output of systemctl status bluetooth.service?

What's the output of this?

[root@mac ~]# bluetoothctl 
Agent registered
[CHG] Controller 78:4F:43:53:8E:2C Pairable: yes
[bluetooth]# list
Controller 78:4F:43:53:8E:2C mac.example.com [default]
jrmoulton commented 3 years ago

systemctl status bluetooth.service ● bluetooth.service - Bluetooth service Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendo> Active: inactive (dead) Docs: man:bluetoothd(8)

[ecestudent@computer ~]$ bluetoothctl Waiting to connect to bluetoothd...

leifliddy commented 3 years ago

you need to start and enable the service with (as root or with sudo) systemctl enable --now bluetooth alternatively, you could run

systemctl enable bluetooth
systemctl start bluetooth
jrmoulton commented 3 years ago

It doesn't look like it changed anything

[ecestudent@computer ~]$ systemctl enable --now bluetooth [ecestudent@computer ~]$ systemctl status bluetooth.service ● bluetooth.service - Bluetooth service Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendo> Active: inactive (dead) Docs: man:bluetoothd(8) [ecestudent@computer ~]$ bluetoothctl Waiting to connect to bluetoothd... [ecestudent@computer ~]$ systemctl enable bluetooth [ecestudent@computer ~]$ systemctl start bluetooth [ecestudent@computer ~]$ systemctl status bluetooth.service ● bluetooth.service - Bluetooth service Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendo> Active: inactive (dead) Docs: man:bluetoothd(8) [ecestudent@computer ~]$ bluetoothctl Waiting to connect to bluetoothd...

leifliddy commented 3 years ago

You have to run that as root or with sudo

jrmoulton commented 3 years ago

Same thing

[ecestudent@computer ~]$ sudo systemctl enable bluetooth [sudo] password for ecestudent: [ecestudent@computer ~]$ sudo systemctl start bluetooth [ecestudent@computer ~]$ sudo systemctl status bluetooth.service ● bluetooth.service - Bluetooth service Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendo> Active: inactive (dead) Docs: man:bluetoothd(8) [ecestudent@computer ~]$ sudo bluetoothctl Waiting to connect to bluetoothd...

leifliddy commented 3 years ago

That's bizarre, why didn't it start!? Can you try restating the service with systemctl restart bluetooth

If that still doesn't work, you might want to look at the output of journalctl -xe or journalctl -b -p err or journalctl -b | grep -i bluetooth

and see if you see anything relevant in there...

jrmoulton commented 3 years ago

This is after the systemctl restart bluetooth I'm not super sure what I'm looking for but this was the output. The bluetooth status doesn't seem to have changed

[root@computer ~]# systemctl status bluetooth.service ● bluetooth.service - Bluetooth service Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendo> Active: inactive (dead) Docs: man:bluetoothd(8) [root@computer ~]# journalctl -xe Jan 22 16:04:32 computer.localdomain avahi-daemon[745]: Joining mDNS multica> Jan 22 16:04:32 computer.localdomain avahi-daemon[745]: Registering new addr> Jan 22 16:04:32 computer.localdomain avahi-daemon[745]: Withdrawing address > Jan 22 16:04:32 computer.localdomain acvpnagent[837]: A new network interfac> Jan 22 16:04:32 computer.localdomain acvpnagent[837]: IP addresses from acti> Jan 22 16:04:37 computer.localdomain acvpnagent[837]: Function: determinePub> Jan 22 16:04:37 computer.localdomain acvpnagent[837]: Function: updatePotent> Jan 22 16:04:45 computer.localdomain acvpnagent[837]: Function: OnOpenReques> Jan 22 16:04:45 computer.localdomain acvpnagent[837]: Function: OnTimerExpir> Jan 22 16:04:45 computer.localdomain acvpnagent[837]: Function: logProbeFail> Jan 22 16:04:45 computer.localdomain acvpnagent[837]: Function: TestAccessTo> Jan 22 16:04:45 computer.localdomain acvpnagent[837]: Function: testNetwork > Jan 22 16:06:54 computer.localdomain sudo[3655]: pam_unix(sudo:session): ses> Jan 22 16:07:31 computer.localdomain kwin_x11[2084]: qt.qpa.xcb: QXcbConnect> Jan 22 16:07:33 computer.localdomain sudo[3706]: ecestudent : TTY=pts/1 ; PW> Jan 22 16:07:33 computer.localdomain sudo[3706]: pam_systemd(sudo:session): > Jan 22 16:07:33 computer.localdomain sudo[3706]: pam_unix(sudo:session): ses> Jan 22 16:07:33 computer.localdomain su[3708]: (to root) ecestudent on pts/1 Jan 22 16:07:33 computer.localdomain su[3708]: pam_systemd(su:session): Cann> Jan 22 16:07:33 computer.localdomain su[3708]: pam_unix(su:session): session> Jan 22 16:08:24 computer.localdomain /usr/libexec/gdm-x-session[1841]: [2497> Jan 22 16:09:04 computer.localdomain /usr/libexec/gdm-x-session[1841]: [2533> Jan 22 16:09:27 computer.localdomain kwin_x11[2084]: qt.qpa.xcb: QXcbConnect> Jan 22 16:09:46 computer.localdomain kwin_x11[2084]: qt.qpa.xcb: QXcbConnect> Jan 22 16:09:59 computer.localdomain kwin_x11[2084]: qt.qpa.xcb: QXcbConnect

[root@computer ~]# journalctl -b -p err -- Logs begin at Fri 2021-01-22 15:45:09 MST, end at Fri 2021-01-22 16:10:58> Jan 22 15:45:09 localhost.localdomain kernel: efi: Failed to lookup EFI memo> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: AE_ALREADYEXISTS,> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI BIOS Error (bug): Could n> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI BIOS Error (bug): Could n> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI BIOS Error (bug): Could n> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI BIOS Error (bug): Could n> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI BIOS Error (bug): Could n> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI BIOS Error (bug): Could n> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method _> Jan 22 15:45:09 localhost.localdomain kernel: ACPI BIOS Error (bug): Could n> Jan 22 15:45:09 localhost.localdomain kernel: ACPI Error: Aborting method \

[root@computer ~]# journalctl -b | grep -i bluetooth Jan 22 15:45:18 localhost.localdomain NetworkManager[988]: [1611355518.5588] Loaded device plugin: NMBluezManager (/usr/lib64/NetworkManager/1.26.0-12.el8_3/libnm-device-plugin-bluetooth.so) Jan 22 15:45:34 localhost.localdomain systemd[1803]: Starting Bluetooth OBEX service... Jan 22 15:45:34 localhost.localdomain systemd[1803]: Started Bluetooth OBEX service. Jan 22 15:45:47 computer.localdomain systemsettings5[2456]: kf5.kconfigwidgets: A widget named ' "kcfg_enableGlobalBluetooth" ' was found but there is no setting named ' "enableGlobalBluetooth" ' Jan 22 15:47:14 computer.localdomain systemsettings5[2456]: kf5.kconfigwidgets: A widget named ' "kcfg_enableGlobalBluetooth" ' was found but there is no setting named ' "enableGlobalBluetooth" ' Jan 22 15:57:42 computer.localdomain polkitd[755]: Operator of unix-session:2 successfully authenticated as unix-user:ecestudent to gain TEMPORARY authorization for action org.freedesktop.systemd1.manage-unit-files for system-bus-name::1.649 [systemctl enable --now bluetooth] (owned by unix-user:ecestudent) Jan 22 15:58:55 computer.localdomain polkitd[755]: Operator of unix-session:2 successfully authenticated as unix-user:ecestudent to gain TEMPORARY authorization for action org.freedesktop.systemd1.manage-unit-files for system-bus-name::1.719 [systemctl enable bluetooth] (owned by unix-user:ecestudent) Jan 22 15:59:07 computer.localdomain polkitd[755]: Operator of unix-session:2 successfully authenticated as unix-user:ecestudent to gain TEMPORARY authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.782 [systemctl start bluetooth] (owned by unix-user:ecestudent) Jan 22 16:01:48 computer.localdomain dbus-daemon[761]: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service' requested by ':1.844' (uid=0 pid=3581 comm="sudo systemctl enable bluetooth " label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023") Jan 22 16:01:51 computer.localdomain sudo[3581]: ecestudent : TTY=pts/1 ; PWD=/home/ecestudent ; USER=root ; COMMAND=/bin/systemctl enable bluetooth Jan 22 16:01:59 computer.localdomain sudo[3612]: ecestudent : TTY=pts/1 ; PWD=/home/ecestudent ; USER=root ; COMMAND=/bin/systemctl start bluetooth Jan 22 16:02:27 computer.localdomain sudo[3629]: ecestudent : TTY=pts/1 ; PWD=/home/ecestudent ; USER=root ; COMMAND=/bin/systemctl status bluetooth.service Jan 22 16:04:17 computer.localdomain sudo[3655]: ecestudent : TTY=pts/1 ; PWD=/home/ecestudent ; USER=root ; COMMAND=/bin/bluetoothctl

leifliddy commented 3 years ago

Can you post the output of lsmod | egrep 'bt|blue'

[root@mac ~]# lsmod | egrep 'bt|blue'
btqca                  20480  1 hci_uart
btrtl                  24576  1 hci_uart
btbcm                  20480  1 hci_uart
btintel                32768  1 hci_uart
bluetooth             692224  44 btrtl,btqca,btintel,hci_uart,btbcm,bnep,rfcomm
ecdh_generic           16384  2 bluetooth
rfkill                 28672  6 bluetooth,cfg80211
jrmoulton commented 3 years ago

It doesn't return anything root@computer ~]# lsmod | egrep 'bt|blue' [root@computer ~]#

leifliddy commented 3 years ago

ok, what happens when you try and load the modules? ie modprobe bluetooth modprobe hci_uart

jrmoulton commented 3 years ago

Neither printed anything and

[root@computer ~]# systemctl status bluetooth.service ● bluetooth.service - Bluetooth service Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendo> Active: inactive (dead) Docs: man:bluetoothd(8)

leifliddy commented 3 years ago

so, after running modprobe bluetooth lsmod | egrep 'bt|blue doesn't show anything?

jrmoulton commented 3 years ago

Oh it shows this now

[root@computer ~]# modprobe bluetooth [root@computer ~]# lsmod | grep bluetooth bluetooth 671744 2 btintel,hci_uart ecdh_generic 16384 1 bluetooth rfkill 28672 7 bluetooth,cfg80211 [root@computer ~]#

leifliddy commented 3 years ago

ok, well that's a start ; ) try restarting the service now systemctl restart bluetooth

jrmoulton commented 3 years ago

It's running now! But I'm still not seeing any bluetooth devices in the system settings app. Do I need to reboot?

[root@computer ~]# systemctl restart bluetooth [root@computer ~]# lsmod | grep bluetooth bluetooth 671744 9 btintel,hci_uart,bnep ecdh_generic 16384 1 bluetooth rfkill 28672 9 bluetooth,cfg80211 [root@computer ~]# systemctl status bluetooth.service ● bluetooth.service - Bluetooth service Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendo> Active: active (running) since Fri 2021-01-22 16:29:58 MST; 25s ago Docs: man:bluetoothd(8) Main PID: 4656 (bluetoothd) Tasks: 1 (limit: 101220) Memory: 2.2M CGroup: /system.slice/bluetooth.service └─4656 /usr/libexec/bluetooth/bluetoothd

Jan 22 16:29:58 computer.localdomain systemd[1]: Starting Bluetooth service.> Jan 22 16:29:58 computer.localdomain bluetoothd[4656]: Bluetooth daemon 5.52 Jan 22 16:29:58 computer.localdomain systemd[1]: Started Bluetooth service. Jan 22 16:29:58 computer.localdomain bluetoothd[4656]: Starting SDP server Jan 22 16:29:58 computer.localdomain bluetoothd[4656]: Bluetooth management >

leifliddy commented 3 years ago

run that bluetoothctl command, and then run list what do you see?

jrmoulton commented 3 years ago

[root@computer ~]# bluetoothctl Agent registered [bluetooth]# list [bluetooth]#

leifliddy commented 3 years ago

Not sure why the bluetooth module isn't being loaded at boot time. You can run the following command to force the system to load the bluetooth module at boot time:

echo 'bluetooth' > /etc/modules-load.d/bluetooth.conf

Not sure why bluetoothctl + list isn't working -- it should return the bluetooth controller id. As I said before, centos8 might have outdated bluez libraries or something like that.

jrmoulton commented 3 years ago

Ok. Is there anything else I can do at this point?

leifliddy commented 3 years ago

Centos 8 is an enterprise version of Linux. Which means it's super stable, but it's also behind the times in terms of library and software versions. I would recommend trying out Fedora 33: If you're familiar with Centos 8, you'll have absolutely no trouble adjusting to Fedora....just my 2 cents on the matter.

I used to run Centos as my "daily driver" years ago, but decided to transition to Fedora for exactly the same reasons that you're experiencing now ; )

https://spins.fedoraproject.org/en/cinnamon/