Ubuntu 18.04 中蓝牙无法打开

Ubuntu 18.04 中蓝牙无法打开

从 17.10 升级到 18.04 后,蓝牙无法打开。所以我在线搜索并找到了这个内核补丁:

sudo apt install git build-essential dkms
git clone https://github.com/jeremyb31/newbtfix-4.15.git
sudo dkms add ./newbtfix-4.15
sudo dkms install btusb/4.0

即使在此之后,蓝牙仍然无法正常工作,在干净关机后,有时蓝牙可以工作,但大多数时候都不工作。以下是我在终端中执行的重要命令:

1. 使用 lspci -nnk 命令grep -iA3 净

02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. 
RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [10ec:8136] 
(rev 05)
Subsystem: Lenovo RTL810xE PCI Express Fast Ethernet controller 
[17aa:3977]
Kernel driver in use: r8169
Kernel modules: r8169
03:00.0 Network controller [0280]: Qualcomm Atheros AR9485 Wireless 
Network Adapter [168c:0032] (rev 01)
Subsystem: Lenovo AR9485 Wireless Network Adapter [17aa:3218]
Kernel driver in use: ath9k
Kernel modules: ath9k

2. lsusb

    Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 
    Card Reader Controller
Bus 001 Device 003: ID 046d:c084 Logitech, Inc. 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching 
Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 13d3:5170 IMC Networks 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

3. rfkill 列表

0: ideapad_wlan: Wireless LAN
Soft blocked: no
Hard blocked: no
1: ideapad_bluetooth: Bluetooth
Soft blocked: yes
Hard blocked: no
2: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no

4. uname -r

4.15.0-23-generic

5. dmesg | egrep -i ‘blue|firm’

[    0.029075] Spectre V2 : Enabling Restricted Speculation for 

firmware calls
[    0.052904] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[    5.632476] [Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS

[    6.434524] usb 1-1.3: Product: Bluetooth USB Host Controller
[   43.358752] Bluetooth: Core ver 2.22
[   43.358769] Bluetooth: HCI device and connection manager initialized
[   43.358772] Bluetooth: HCI socket layer initialized
[   43.358774] Bluetooth: L2CAP socket layer initialized
[   43.358779] Bluetooth: SCO socket layer initialized
[   60.474347] usb 1-1.3: Product: Bluetooth USB Host Controller
[   68.645867] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   68.645869] Bluetooth: BNEP filters: protocol multicast
[   68.645873] Bluetooth: BNEP socket layer initialized
[   71.196092] Bluetooth: hci0: command 0x201c tx timeout
[   73.212009] Bluetooth: hci0: command 0x1002 tx timeout
[   75.228002] Bluetooth: hci0: command 0x0c56 tx timeout
[   77.244110] Bluetooth: hci0: command 0x0c45 tx timeout
[   79.260042] Bluetooth: hci0: command 0x0c58 tx timeout
[   81.276072] Bluetooth: hci0: command tx timeout
[  109.177590] Bluetooth: RFCOMM TTY layer initialized
[  109.177598] Bluetooth: RFCOMM socket layer initialized
[  109.177604] Bluetooth: RFCOMM ver 1.11
[ 1643.282536] usb 1-1.3: Product: Bluetooth USB Host Controller
[ 1645.392304] Bluetooth: hci0: command 0x0c52 tx timeout
[ 1647.404256] Bluetooth: hci0: command 0x0c45 tx timeout
[ 1649.420176] Bluetooth: hci0: command 0x0c58 tx timeout
[ 1651.436080] Bluetooth: hci0: command 0x1004 tx timeout
[ 1668.673193] usb 1-1.3: device firmware changed
[ 1668.878929] usb 1-1.3: Product: Bluetooth USB Host Controller
[ 1690.825914] usb 1-1.3: Product: Bluetooth USB Host Controller
[ 1693.163783] Bluetooth: hci0: command 0x0c52 tx timeout
[ 2152.790808] Bluetooth: hci0: command 0x0405 tx timeout
[ 2177.961681] bluetoothd[1118]: segfault at 0 ip 000055ebbc27e576 sp 00007ffc9fd07280 error 4 in bluetoothd[55ebbc215000+f3000]
[ 2188.907517] usb 1-1.3: Product: Bluetooth USB Host Controller
[ 2190.997040] Bluetooth: hci0: command 0x2002 tx timeout
[ 2193.012956] Bluetooth: hci0: command 0x2003 tx timeout
[ 2195.028901] Bluetooth: hci0: command 0x201c tx timeout
[ 2197.044724] Bluetooth: hci0: command 0x1002 tx timeout
[ 2199.060655] Bluetooth: hci0: command 0x0c52 tx timeout
[ 2201.076583] Bluetooth: hci0: command tx timeout
[ 2483.045911] usb 1-1.3: Product: Bluetooth USB Host Controller
[ 2485.131481] Bluetooth: hci0: command 0x2003 tx timeout
[ 2487.143463] Bluetooth: hci0: command 0x201c tx timeout
[ 2489.159403] Bluetooth: hci0: command 0x1002 tx timeout
[ 2491.175235] Bluetooth: hci0: command 0x0c52 tx timeout
[ 2493.191159] Bluetooth: hci0: command 0x0c45 tx timeout
[ 2495.207062] Bluetooth: hci0: command tx timeout
  1. usb 设备 | awk '/5170/' RS=

    T:  Bus=03 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=13d3 ProdID=5170 Rev=07.30
    S:  Manufacturer=Azurewave
    S:  Product=Lenovo EasyCamera
    S:  SerialNumber=NULL
    C:  #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo
    I:  If#= 1 Alt= 0 #EPs= 0 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    

EDIT1:干净关机后的输出(我此时没有打开蓝牙):

1.lsusb

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 003: ID 046d:c084 Logitech, Inc. 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 13d3:5170 IMC Networks 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

2.dmesg | egrep -i 'blue|firm'

[    0.029073] Spectre V2 : Enabling Restricted Speculation for firmware calls
[    0.052909] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[    5.615469] [Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS
[    6.418326] usb 1-1.3: Product: Bluetooth USB Host Controller

编辑 2:关机后,蓝牙按预期工作,但在我将电脑置于睡眠状态并再次唤醒后,蓝牙无法打开。以下是从睡眠状态唤醒后的输出:

1.dmesg | egrep -i 'blue|firm'

[    0.029073] Spectre V2 : Enabling Restricted Speculation for firmware calls
[    0.052909] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[    5.615469] [Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS
[    6.418326] usb 1-1.3: Product: Bluetooth USB Host Controller
vikrant@vikrant-Lenovo-IdeaPad-Z500:~$ dmesg | egrep -i 'blue|firm'
[    0.029073] Spectre V2 : Enabling Restricted Speculation for firmware calls
[    0.052909] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[    5.615469] [Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS
[    6.418326] usb 1-1.3: Product: Bluetooth USB Host Controller
[  675.094346] usb 1-1.3: Product: Bluetooth USB Host Controller
[  675.196812] Bluetooth: Core ver 2.22
[  675.196843] Bluetooth: HCI device and connection manager initialized
[  675.196847] Bluetooth: HCI socket layer initialized
[  675.196849] Bluetooth: L2CAP socket layer initialized
[  675.196855] Bluetooth: SCO socket layer initialized
[  686.376573] usb 1-1.3: Product: Bluetooth USB Host Controller
[  686.693538] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[  686.693545] Bluetooth: BNEP filters: protocol multicast
[  686.693558] Bluetooth: BNEP socket layer initialized
[  686.878669] Bluetooth: RFCOMM TTY layer initialized
[  686.878683] Bluetooth: RFCOMM socket layer initialized
[  686.878693] Bluetooth: RFCOMM ver 1.11
[  692.414170] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  708.120444] usb 1-1.3: Product: Bluetooth USB Host Controller
[  714.171055] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  730.296939] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  746.170820] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  762.292713] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  783.282617] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  799.152516] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  815.278422] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  831.148317] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  847.275223] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  863.145118] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  879.284993] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  895.168915] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  909.170673] usb 1-1.3: device firmware changed
[  909.610615] usb 1-1.3: Product: Bluetooth USB Host Controller
[  926.256774] usb 1-1.3: Product: Bluetooth USB Host Controller
[  928.335191] Bluetooth: hci0: command 0x201c tx timeout
[  930.351945] Bluetooth: hci0: command 0x1002 tx timeout
[  932.368698] Bluetooth: hci0: command 0x0c52 tx timeout
[  934.385494] Bluetooth: hci0: command 0x0c45 tx timeout
[  936.402236] Bluetooth: hci0: command 0x0c58 tx timeout

2.lsusb

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 012: ID 0cf3:3004 Atheros Communications, Inc. AR3012 Bluetooth 4.0
Bus 001 Device 003: ID 046d:c084 Logitech, Inc. 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 13d3:5170 IMC Networks 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

编辑3:干净关机后再次尝试,蓝牙已打开并连接到设备。这里也是输出,这次启动后蓝牙已经打开。

1.lsusb

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 006: ID 0cf3:3004 Atheros Communications, Inc. AR3012 Bluetooth 4.0
Bus 001 Device 003: ID 046d:c084 Logitech, Inc. 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 13d3:5170 IMC Networks 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

2.dmesg | egrep -i 'blue|firm'

[    0.029055] Spectre V2 : Enabling Restricted Speculation for firmware calls
[    0.052905] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[    5.632858] [Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS
[    6.418827] usb 1-1.3: Product: Bluetooth USB Host Controller
[   37.782926] Bluetooth: Core ver 2.22
[   37.782940] Bluetooth: HCI device and connection manager initialized
[   37.782943] Bluetooth: HCI socket layer initialized
[   37.782944] Bluetooth: L2CAP socket layer initialized
[   37.782948] Bluetooth: SCO socket layer initialized
[   51.274273] usb 1-1.3: Product: Bluetooth USB Host Controller
[   53.084071] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   53.084073] Bluetooth: BNEP filters: protocol multicast
[   53.084076] Bluetooth: BNEP socket layer initialized
[   78.375072] Bluetooth: RFCOMM TTY layer initialized
[   78.375086] Bluetooth: RFCOMM socket layer initialized
[   78.375093] Bluetooth: RFCOMM ver 1.11
[  113.341121] Bluetooth: hci0: last event is not cmd complete (0x0f)
[  129.154992] Bluetooth: hci0: last event is not cmd complete (0x0f)

问题似乎是,在操作系统从睡眠状态唤醒后,蓝牙无法打开。只是重复我上面所说的,在干净关机后,有时蓝牙可以工作,但大多数时候不工作。

相关内容