Fedora

藍牙關閉,即使“打開”

  • September 16, 2019

我有一台 Thinkpad X1 Carbon 7th Gen,執行 Fedora 30。我的問題是我無法使藍牙工作。我嘗試了多種方法來解決這個問題,但都沒有效果。

  • 通過設置 GUI

當我轉到“設置/藍牙”時,我可以打開藍牙(右上角的撥動開關)。但是,文本沒有改變,並告訴我藍牙已關閉。

在此處輸入圖像描述

  • iwlwifi.conf

當然,我已經在 BIOS 中檢查了藍牙是否已啟動。此外,我創建/etc/modprobe.d/iwlwifi.conf如下:

options iwlwifi bt_coex_active=0
  • TLP

最後,我設置/etc/default/tlp為(僅相關摘錄):

[…]

# Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown      
# on system startup: 0=disable, 1=enable.                                        
# Note: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below       
#   are ignored when this is enabled.                                            
# Default: 0                                                                     
RESTORE_DEVICE_STATE_ON_STARTUP=0                                                

# Radio devices to disable on startup: bluetooth, wifi, wwan.                    
# Separate multiple devices with spaces.                                         
# Default: <none>                                                                
#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth"                                       

# Radio devices to enable on startup: bluetooth, wifi, wwan.                     
# Separate multiple devices with spaces.                                         
# Default: <none>                                                                
DEVICES_TO_ENABLE_ON_STARTUP="wifi bluetooth"                                    

# Radio devices to disable on shutdown: bluetooth, wifi, wwan.                   
# (workaround for devices that are blocking shutdown).                           
# Default: <none>                                                                
DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"                             

# Radio devices to enable on shutdown: bluetooth, wifi, wwan.                    
# (to prevent other operating systems from missing radios).                      
# Default: <none>                                                                
#DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"                                            

# Radio devices to enable on AC: bluetooth, wifi, wwan.                          
# Default: <none>                                                                
#DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"                                   

# Radio devices to disable on battery: bluetooth, wifi, wwan.                    
# Default: <none>                                                                
#DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"                                 

# Radio devices to disable on battery when not in use (not connected):           
#   bluetooth, wifi, wwan.                                                       
# Default: <none>                                                                
#DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"

[…]

# ------------------------------------------------------------------------------ 
# tlp-rdw - Parameters for the radio device wizard                               
# Possible devices: bluetooth, wifi, wwan.                                       

# Notes:                                                                         
# - Parameters are disabled by default, remove the leading # to enable them      
# - Separate multiple radio devices with spaces                                  

# Default: <none> (for all parameters below)                                     

# Radio devices to disable on connect.                                           
DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"                                    
#DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"                                       
#DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"                                       

# Radio devices to enable on disconnect.                                         
DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi "                                      
#DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""                                         
#DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""                                         

# Radio devices to enable/disable when docked.                                   
#DEVICES_TO_ENABLE_ON_DOCK=""                                                    
#DEVICES_TO_DISABLE_ON_DOCK=""                                                   

# Radio devices to enable/disable when undocked.                                 
#DEVICES_TO_ENABLE_ON_UNDOCK="wifi"                                              
#DEVICES_TO_DISABLE_ON_UNDOCK=""
  • 人機互動配置

我還嘗試禁用藍牙的電源優化,但在我想要切換時powertop嘗試執行>> /usr/sbin/hciconfig hci0 up &> /dev/null &

>> Good          Bluetooth device interface status

當我執行 Fedora(?)時,我有bin而不是sbin,所以我sudo /usr/bin/hciconfig hci0 up &> /dev/null手動執行。

  • 通過 CLI 打開藍牙
$ sudo hciconfig up                                                                                                                                        
hci0:   Type: Primary  Bus: USB
   BD Address: DC:71:96:99:3F:A8  ACL MTU: 1021:4  SCO MTU: 96:6
   DOWN 
   RX bytes:16660 acl:0 sco:0 events:2700 errors:0
   TX bytes:666973 acl:0 sco:0 commands:2698 errors:0
  • 檢查rfkill狀態

這似乎不是這裡的問題。

$ rfkill                                                                                                                                                    
ID TYPE      DEVICE                   SOFT      HARD
0 bluetooth tpacpi_bluetooth_sw unblocked unblocked
1 bluetooth hci0                unblocked unblocked
2 wlan      phy0                unblocked unblocked
  • 通過調查dmesg 我已經使用添加了我的手動事件# comments。請注意,當我打開電腦並進入左上角菜單時,我可以“關閉”藍牙……哪個狀態是“關閉”!

在此處輸入圖像描述

$ sudo dmesg | grep -E 'Bluetooth|hci0|intel/ibt|iwl|usb 1-10'                                                                                             
[    3.038389] usb 1-10: new full-speed USB device number 5 using xhci_hcd
[    3.166272] usb 1-10: New USB device found, idVendor=8087, idProduct=0aaa, bcdDevice= 0.02
[    3.166273] usb 1-10: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   12.560006] Bluetooth: Core ver 2.22
[   12.560023] Bluetooth: HCI device and connection manager initialized
[   12.560025] Bluetooth: HCI socket layer initialized
[   12.560027] Bluetooth: L2CAP socket layer initialized
[   12.560031] Bluetooth: SCO socket layer initialized
[   12.591904] iwlwifi 0000:00:14.3: enabling device (0000 -> 0002)
[   12.614868] Bluetooth: hci0: Bootloader revision 0.1 build 42 week 52 2015
[   12.615864] Bluetooth: hci0: Device revision is 2
[   12.615865] Bluetooth: hci0: Secure boot is enabled
[   12.615865] Bluetooth: hci0: OTP lock is enabled
[   12.615865] Bluetooth: hci0: API lock is enabled
[   12.615866] Bluetooth: hci0: Debug lock is disabled
[   12.615866] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[   12.617782] Bluetooth: hci0: Found device firmware: intel/ibt-17-16-1.sfi
[   12.624703] iwlwifi 0000:00:14.3: Found debug destination: EXTERNAL_DRAM
[   12.624704] iwlwifi 0000:00:14.3: Found debug configuration: 0
[   12.624901] iwlwifi 0000:00:14.3: loaded firmware version 46.93e59cf4.0 op_mode iwlmvm
[   12.750348] iwlwifi 0000:00:14.3: Detected Intel(R) Wireless-AC 9560 160MHz, REV=0x318
[   12.756808] iwlwifi 0000:00:14.3: Applying debug destination EXTERNAL_DRAM
[   12.756956] iwlwifi 0000:00:14.3: Allocated 0x00400000 bytes for firmware monitor.
[   12.803914] iwlwifi 0000:00:14.3: base HW address: dc:71:96:99:3f:a4
[   12.888770] ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
[   12.892885] iwlwifi 0000:00:14.3 wlp0s20f3: renamed from wlan0
[   14.288430] Bluetooth: hci0: Waiting for firmware download to complete
[   14.288852] Bluetooth: hci0: Firmware loaded in 1635914 usecs
[   14.288894] Bluetooth: hci0: Waiting for device to boot
[   14.301955] Bluetooth: hci0: Device booted in 12769 usecs
[   14.302307] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-17-16-1.ddc
[   14.305022] Bluetooth: hci0: Applying Intel DDC parameters completed
[   30.630541] iwlwifi 0000:00:14.3: Applying debug destination EXTERNAL_DRAM
[   30.745533] iwlwifi 0000:00:14.3: Applying debug destination EXTERNAL_DRAM
[   30.810557] iwlwifi 0000:00:14.3: FW already configured (0) - re-configuring
[   30.843148] iwlwifi 0000:00:14.3: Applying debug destination EXTERNAL_DRAM
[   30.957796] iwlwifi 0000:00:14.3: Applying debug destination EXTERNAL_DRAM
[   31.022390] iwlwifi 0000:00:14.3: FW already configured (0) - re-configuring
[   34.449002] iwlwifi 0000:00:14.3: Applying debug destination EXTERNAL_DRAM
[   34.566179] iwlwifi 0000:00:14.3: Applying debug destination EXTERNAL_DRAM
[   34.633419] iwlwifi 0000:00:14.3: FW already configured (0) - re-configuring
# In the top-left menu, I "Turn off" the Bluetooth… that is already off (see picture)
[  136.308722] usb 1-10: USB disconnect, device number 5
# In "Settings/Bluetooth", I click on the toggle button to switch it on.
[  157.642145] usb 1-10: new full-speed USB device number 6 using xhci_hcd
[  157.771145] usb 1-10: New USB device found, idVendor=8087, idProduct=0aaa, bcdDevice= 0.02
[  157.771151] usb 1-10: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  157.775067] Bluetooth: hci0: Bootloader revision 0.1 build 42 week 52 2015
[  157.776096] Bluetooth: hci0: Device revision is 2
[  157.776098] Bluetooth: hci0: Secure boot is enabled
[  157.776100] Bluetooth: hci0: OTP lock is enabled
[  157.776103] Bluetooth: hci0: API lock is enabled
[  157.776104] Bluetooth: hci0: Debug lock is disabled
[  157.776107] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[  157.776872] Bluetooth: hci0: Found device firmware: intel/ibt-17-16-1.sfi
[  159.727328] Bluetooth: hci0: Waiting for firmware download to complete
[  159.727931] Bluetooth: hci0: Firmware loaded in 1907957 usecs
[  159.728175] Bluetooth: hci0: Waiting for device to boot
[  159.740907] Bluetooth: hci0: Device booted in 12575 usecs
[  159.741009] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-17-16-1.ddc
[  159.743971] Bluetooth: hci0: Applying Intel DDC parameters completed

這一切都毫無效果。

如何讓藍牙真正起作用?

嗯,我覺得有點傻,但是……藍牙守護程序根本就沒有執行

所以我通過以下方式解決了它:

systemctl enable bluetooth

那裡!

iwlwifi驅動程序表明您的筆記型電腦中可能有英特爾 WiFi+藍牙模組。要正常工作,它需要韌體:模組的 WiFi 和藍牙部分都有自己的韌體。

sudo dmesg嘗試啟動藍牙功能後執行。如果出現類似 的消息Direct firmware load for intel/ibt-<something> failed with error ...,則您缺少英特爾藍牙的韌體文件。錯誤消息將辨識/lib/firmware核心下期望韌體文件所在的確切路徑名。

例如,如果錯誤消息中的路徑名是intel/ibt-20-1-4.sfi,那麼韌體文件必須放在/lib/firmware/intel/ibt-20-1-4.sfi.

您可以在 Linux 韌體 git 儲存庫中找到大多數英特爾 WiFi+藍牙模組(以及一些其他英特爾系統組件)的韌體。在該頁面上找到您的系統請求的韌體文件,然後點擊plain最右側列上標記的連結以下載韌體文件。然後將其複製到系統上的相應目錄:

sudo cp <wherever you downloaded the file to> /lib/firmware/intel/

請注意,您可能需要多個文件。如果有一個*.ddc文件和一個*.sfi同名的文件,請同時下載它們:一旦驅動程序載入了第一個文件,它也會嘗試載入另一個文件。您可能需要多次嘗試以確保滿足所有韌體文件請求。

引用自:https://unix.stackexchange.com/questions/541704