# Bluetooth woes on Realtek RTL8821AE

## Lophophora

Hi all,

A couple of weeks back I did a fresh gentoo installation on my new box and while on general it runs well, I've still not managed to set bluetooth to run. I've got a Realtek RTL8821AE PCI mini card:

 *Quote:*   

> 01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821AE 802.11ac PCIe Wireless Network Adapter
> 
> 	Subsystem: Realtek Semiconductor Co., Ltd. RTL8821AE 802.11ac PCIe Wireless Network Adapter
> 
> 	Flags: bus master, fast devsel, latency 0, IRQ 122
> ...

 

I've followed the gentoo bluetooth guide:

https://wiki.gentoo.org/wiki/Bluetooth

But when I run hciconfig -a, my adaptor is shown as down:

 *Quote:*   

> hci0:	Type: BR/EDR  Bus: USB
> 
> 	BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0
> 
> 	DOWN 
> ...

 

and I get the following error message when I try to wake it:

 *Quote:*   

> hciconfig hci0 up
> 
> Can't init device hci0: No such file or directory (2)
> 
> 

 

Here's my kernel .config file:

http://pastebin.com/zvCKr7FH

and the contents of my make.conf file, in case it helps:

 *Quote:*   

> # These settings were set by the catalyst build script that automatically
> 
> # built this stage.
> 
> # Please consult /usr/share/portage/config/make.conf.example for a more
> ...

 

Thanks in advance for your help!

----------

## fedeliallalinea

Log of dmesg:

```
$ dmesg | grep -i bluetooth
```

----------

## Lophophora

Thanks, I need to learn to look at dmesg more often! It seems like the firmware isn't loading:

 *Quote:*   

> dmesg | grep -i bluetooth
> 
> [    0.160970] Bluetooth: Core ver 2.21
> 
> [    0.161143] Bluetooth: HCI device and connection manager initialized
> ...

 

does anyone have experience with Realtek? Can I use non-kernel firmware?

Thanks!

----------

## fedeliallalinea

 *Lophophora wrote:*   

> Thanks, I need to learn to look at dmesg more often! It seems like the firmware isn't loading:

 

You have installed linux-firmware package?

 *Lophophora wrote:*   

> Can I use non-kernel firmware?

 

Difference between driver and firmware.

----------

## Lophophora

Hi,

I just installed linux-firmware & restarted but I still get the same error. Is there some configuration I need to do?

----------

## Logicien

From your .config, any Bluetooth option you enable is in the kernel image [Y]. If your kernel probe the Bluetooth devices before the real root partition is mounted, the firmware files needed will not be available. This can lead to a probe fail unless you put the firmware files in the kernel image too or in an initramfs.

What I do for the kernel configuration is to put everything not mandatory to be in the kernel image as modules. Bluetooth support is not mandatory to be in the kernel image unless an option have only this choice in which case, I accept it. So, because modules are in the root filesystem like firmware files, when the kernel load a module, the firmware file are available too if they are emerged. You can see the problem I am talking about in the output

 *Quote:*   

> [ 1.669759] Bluetooth: hci0: rtl: loading rtl_bt/rtl8821a_fw.bin
> 
> [ 1.669767] bluetooth hci0: Direct firmware load for rtl_bt/rtl8821a_fw.bin failed with error -2
> 
> [ 1.669768] Bluetooth: hci0: Failed to load rtl_bt/rtl8821a_fw.bin

 

Support in the kernel image need to have the firmware files in the image too and modules in intiramfs need to have the firmware files in the initramfs too. This is a rule of thumb for me. In plus, for Bluetooth, I enable every option of the section.

Your wifi module do not have any parameter for Bluetooth coexistence. I never had any trouble with Wifi/Bluetooth mini-Pci devices.

----------

## Lophophora

Thanks for your help! I'm afraid it wasn't a module vs built in the kernel issue. I recompiled my kernel and loaded the following modules at boot-time:

 *Quote:*   

> 
> 
> hidp
> 
> rfcomm
> ...

 

I still get the same error messages, i.e.:

 *Quote:*   

> 
> 
> dmesg | grep -i bluetooth
> 
> [    1.650312] usb 1-11: Product: Bluetooth Radio 
> ...

 

Could you please elaborate what you mean by this:

 *Quote:*   

> Your wifi module do not have any parameter for Bluetooth coexistence

 

Any other ideas?

Thanks in advance!

----------

