Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
btusb must be loaded after bluetooth service has started
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
hasues
n00b
n00b


Joined: 04 Mar 2004
Posts: 54

PostPosted: Wed Jul 06, 2016 5:47 pm    Post subject: btusb must be loaded after bluetooth service has started Reply with quote

I'm seeing some odd behavior:

Code:
wonder linux # service bluetooth start
 * WARNING: bluetooth has already been started
wonder linux # hciconfig hci0 up
Can't init device hci0: Input/output error (5)
wonder linux # bluetoothctl
[NEW] Controller D8:5D:E2:30:BA:E4 wonder [default]
[bluetooth]# power on
Failed to set power on: org.bluez.Error.Failed
[bluetooth]# exit
[DEL] Controller D8:5D:E2:30:BA:E4 wonder [default]
wonder linux # rmmod btusb
wonder linux # modprobe btusb
wonder linux # hciconfig hci0 up
wonder linux # bluetoothctl
[NEW] Controller D8:5D:E2:30:BA:E4 wonder [default]
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# exit
[DEL] Controller D8:5D:E2:30:BA:E4 wonder [default]


This is with bluez5. Why does the bluetooth service need to be started before loading the btusb module? Is there some way of managing this?
_________________
Lettuce, Pickles, hold the mayo!
Back to top
View user's profile Send private message
hasues
n00b
n00b


Joined: 04 Mar 2004
Posts: 54

PostPosted: Wed Jul 06, 2016 6:23 pm    Post subject: Kernel messages Reply with quote

I'm seeing this as well:
Code:

[  310.221624] Bluetooth: hci0: Failed to access otp area (-113)


The device in lsusb:

Code:
Bus 002 Device 005: ID 0cf3:e300 Atheros Communications, Inc.


I noticed this on Ubuntu's bugs:

https://lists.launchpad.net/kernel-packages/msg130282.html

Perhaps this is a kernel bug.
_________________
Lettuce, Pickles, hold the mayo!
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Wed Jul 06, 2016 6:34 pm    Post subject: Reply with quote

The btusb module depend on the btintel module who need the firmware files /lib/firmware/intel/intel/ibt-11-5.ddc and /lib/firmware/intel/ibt-11-5.sfi. Is those firmware files are available when Linux probe your Bluetooth Usb dongle? Is the linux-firmware package install?

The Bluetooth service fail the first time because the btusb module is not loaded or it fail to probe your device because of missing firmwares. A rule of thumb for me is to put the firmware files where the Linux support is, in the kernel or, in an initramfs or, in the hard disk. It is important that when Linux start to detect the Bluetooh devices it have at it's disposition the firmware files, otherwise, the probe can fail and no device is detected until the Linux Bluetooth support is reset and the firmware files available.

For Linux Bluetooth support, I put all I can in modules. I don't mix in module with in the kernel.
_________________
Paul
Back to top
View user's profile Send private message
hasues
n00b
n00b


Joined: 04 Mar 2004
Posts: 54

PostPosted: Wed Jul 06, 2016 7:51 pm    Post subject: Reply with quote

Logicien wrote:
The btusb module depend on the btintel module who need the firmware files /lib/firmware/intel/intel/ibt-11-5.ddc and /lib/firmware/intel/ibt-11-5.sfi. Is those firmware files are available when Linux probe your Bluetooth Usb dongle? Is the linux-firmware package install?


Code:
# qlist -Iv |grep linux-firmware
sys-kernel/linux-firmware-20150812


Code:
# ls -la /lib/firmware/intel/ibt-11-5.ddc
-rw-r--r-- 1 root root 9 Jan 25 20:55 /lib/firmware/intel/ibt-11-5.ddc
# ls -la /lib/firmware/intel/ibt-11-5.sfi
-rw-r--r-- 1 root root 570160 Jan 25 20:55 /lib/firmware/intel/ibt-11-5.sfi


I saw this in dmesg:
Code:
[    4.261015] Bluetooth: hci0: using NVM file: qca/nvm_usb_00000200.bin


Logicien wrote:

The Bluetooth service fail the first time because the btusb module is not loaded or it fail to probe your device because of missing firmwares.


The service does not fail. It starts. The hci0 adapter stays in a "DOWN" state and does not allow for changing said state. That should not be the case upon the bluetooth service starting:
Code:
# tail /etc/bluetooth/main.conf

# AutoEnable defines option to enable all controllers when they are found.
# This includes adapters present on start as well as adapters that are plugged
# in later on. Defaults to 'false'.
AutoEnable=true


Logicien wrote:

A rule of thumb for me is to put the firmware files where the Linux support is, in the kernel or, in an initramfs or, in the hard disk. It is important that when Linux start to detect the Bluetooh devices it have at it's disposition the firmware files, otherwise, the probe can fail and no device is detected until the Linux Bluetooth support is reset and the firmware files available.


That is interesting. So if I were to use genkernel to generate an initrd image with the firmware, would I simply issue genkernel with say the --firmware-dir argument as such?:

Code:
# genkernel --firmware-dir=/lib-firmware --lvm initramfs


Logicien wrote:

For Linux Bluetooth support, I put all I can in modules. I don't mix in module with in the kernel.


Agreed, I do the same thing:

Code:

# lsmod |grep bluetooth
bluetooth             322696  7 bnep,btusb,rfcomm,btintel
rfkill                 14979  4 cfg80211,dell_rbtn,bluetooth


I am a bit confused, however as the l2cap module that used to exist no longer does. Does this now exist within the bluetooth module itself?
_________________
Lettuce, Pickles, hold the mayo!
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Wed Jul 06, 2016 10:03 pm    Post subject: Reply with quote

The Bluetooth service will not fail to start even if there is no bluetooth device on the system. It fail to manage your hci0 card because it is not available. What is the output of
Code:
rfkill list

It may be just because the device is block and need to be unblock with
Code:
rfkill unblock all

_________________
Paul
Back to top
View user's profile Send private message
hasues
n00b
n00b


Joined: 04 Mar 2004
Posts: 54

PostPosted: Wed Jul 06, 2016 10:14 pm    Post subject: Not rfkill Reply with quote

True. However, if it had been rfkill, the earlier hciconfig would have presented a different message. It isn't rfkill.

Code:

# rfkill list
0: dell-rbtn: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
4: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no


Thanks for your help, regardless.
_________________
Lettuce, Pickles, hold the mayo!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum