简介
目的:解决Linux Deepin 5.10 在联想小新13上无法使用蓝牙的问题。
问题来源:5.7内核ok,内核升级带来的问题。
尝试过的方法:开启蓝牙服务、使用hciconfig、blueman。以上办法有人成功过。。但是我试了之后都不行。
可能的原因:新版的内核不支持该蓝牙设备?但是旧版的内核支持。。这个逻辑不太正常啊
hciconfig || service (Fail)
5.10.5
$ uname -a
Linux xx 5.10.5-amd64-desktop+ #1 SMP Mon Jan 11 14:55:28 CST 2021 x86_64 GNU/Linux
$ hciconfig -a
hci0: Type: Primary Bus: USB
BD Address: 28:CD:C4:BA:BB:2C ACL MTU: 1021:6 SCO MTU: 255:12
DOWN
RX bytes:3938 acl:0 sco:0 events:298 errors:0
TX bytes:37914 acl:0 sco:0 commands:298 errors:0
Features: 0xff 0xff 0xff 0xfe 0xdb 0xfd 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
$ hciconfig dev
hci0: Type: Primary Bus: USB
BD Address: 28:CD:C4:BA:BB:2C ACL MTU: 1021:6 SCO MTU: 255:12
DOWN
RX bytes:2180 acl:0 sco:0 events:205 errors:0
TX bytes:36816 acl:0 sco:0 commands:205 errors:0
$ hcitool dev
Devices:
$ sudo hciconfig hci0 up
Can't init device hci0: Protocol not supported (93)
$ sudo service bluetooth status
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-02-11 11:41:20 CST; 1min 24s ago
Docs: man:bluetoothd(8)
Main PID: 1984 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 4915)
Memory: 2.0M
CGroup: /system.slice/bluetooth.service
└─1984 /usr/lib/bluetooth/bluetoothd
2月 11 11:41:20 xx systemd[1]: Starting Bluetooth service...
2月 11 11:41:20 xx bluetoothd[1984]: Bluetooth daemon 5.50
2月 11 11:41:20 xx systemd[1]: Started Bluetooth service.
2月 11 11:41:20 xx bluetoothd[1984]: Starting SDP server
2月 11 11:41:20 xx bluetoothd[1984]: Bluetooth management interface 1.18 initialized
5.7
$ uname -a
Linux xx 5.7.7-amd64-desktop #75 SMP Mon Aug 24 20:38:46 CST 2020 x86_64 GNU/Linux
$ hciconfig -a
hci0: Type: Primary Bus: USB
BD Address: 28:CD:C4:BA:BB:2C ACL MTU: 1021:6 SCO MTU: 255:12
UP RUNNING PSCAN ISCAN
RX bytes:264503 acl:18378 sco:0 events:363 errors:0
TX bytes:40194 acl:54 sco:0 commands:288 errors:0
Features: 0xff 0xff 0xff 0xfe 0xdb 0xfd 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'xx'
Class: 0x1c010c
Service Classes: Rendering, Capturing, Object Transfer
Device Class: Computer, Laptop
HCI Version: (0xa) Revision: 0x99a
LMP Version: (0xa) Subversion: 0x7253
Manufacturer: Realtek Semiconductor Corporation (93)
$ hciconfig dev
hci0: Type: Primary Bus: USB
BD Address: 28:CD:C4:BA:BB:2C ACL MTU: 1021:6 SCO MTU: 255:12
UP RUNNING PSCAN ISCAN
RX bytes:271156 acl:18828 sco:0 events:366 errors:0
TX bytes:40203 acl:54 sco:0 commands:291 errors:0
$ hcitool dev
Devices:
hci0 28:CD:C4:BA:BB:2C
$ sudo hciconfig hci0 up
kearney@xx:~$ sudo service bluetooth status
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: e
Active: active (running) since Thu 2021-02-11 18:59:26 CST; 12min ago
Docs: man:bluetoothd(8)
Main PID: 2418 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 4915)
Memory: 4.7M
CGroup: /system.slice/bluetooth.service
└─2418 /usr/lib/bluetooth/bluetoothd
2月 11 18:59:26 xx bluetoothd[2418]: Starting SDP server
2月 11 18:59:26 xx bluetoothd[2418]: Bluetooth management interface 1.16 initialize
2月 11 18:59:26 xx bluetoothd[2418]: Sap driver initialization failed.
2月 11 18:59:26 xx bluetoothd[2418]: sap-server: Operation not permitted (1)
2月 11 19:00:06 xx bluetoothd[2418]: Endpoint registered: sender=:1.73 path=/MediaE
2月 11 19:00:06 xx bluetoothd[2418]: Endpoint registered: sender=:1.73 path=/MediaE
2月 11 19:00:12 xx bluetoothd[2418]: Unable to get Headset Voice gateway SDP record
2月 11 19:00:27 xx bluetoothd[2418]: bt_uhid_send: Invalid argument (22)
2月 11 19:00:27 xx bluetoothd[2418]: bt_uhid_send: Invalid argument (22)
相关命令
- lsusb:显示本机的USB设备列表,以及USB设备的详细信息
- hciconfig: 配置蓝牙设备
- hcitool:Linux下蓝牙工具:hcitool使用教程
blueman
# 安装蓝牙包,非必要
sudo apt install bluetooth
# 安装blueman工具
sudo apt install blueman
但是很奇怪啥也没有,wow的一声哭出来了
裂开,终于显示出来了一个蓝牙标志。。。右键小蓝牙图片选择添加新设备显示没找到适配器。。。wow又哭了
No adapter or not able to turn on bluetooth
To test if your device is recognized by BlueZ you can use tools that list all Bluetooth devices on your machine. The following command are supposed to be run from a terminal.
Troubleshooting
# 识别设备
bluetoothctl list
我的空空如也。。。
A hardware killswitch enabled, usually called “airplane mode”. - (飞行模式)
The adapter is not supported by the Linux bluetooth stack. - (Linux还不支持该设备)
To check the later, you can find the hardware ID with lsusb or lspci depending on the interface to google for it.(查看硬件ID然后搜索吧。。。)
Troubleshooting
参考
sudo service bluetooth start
sudo service bluetooth status # 查看蓝牙状态
sudo systemctl enable bluetooth.service #开启开机自启
-
系统及压缩软件问题求助 - 棒棒糖 :学校的台式机升级了没有蓝牙,我是用的lspci看的硬件信息,然后去github找的硬件驱动安装的,能解决蓝牙的问题,
-
Linux使用蓝牙 - htttw:USB蓝牙棒
-
LaptrinhX—Fail to bring up bluetooth device: Protocol not supported (93):同样的问题,但是没看到解决方案
-
[SOLVED] Fail to bring up bluetooth device: Protocol not supported (93) :和上面一毛一样。。这次是post到linuxquestions
-
Thread: Bluetooth : No device found (rtl8822cu firmware):内核问题,新补丁还没有被接受
-
WL1835 Can’t set device: Protocol not supported and Error:修改内核的蓝牙相关变量-CONFIG_BT_HCIUART_LL
Just want to report back, that enabling CONFIG_BT_HCIUART_LL in kernel can fix the (Can’t set device: Protocol not supported) problem.
Same problem:
$hciattach -s 115200 /dev/ttyS1 texas
Found a Texas Instruments’ chip!
Firmware file : /lib/firmware/TIInit_11.8.32.bts
Loaded BTS script version 1
Can’t set device: Protocol not supported
Can’t initialize device: Protocol not supported
The solution of guodong xu works: just set the HCILL protocol flag in the kernel and now the output is:
$hciattach -s 115200 /dev/ttyS1 texas
Found a Texas Instruments’ chip!
Firmware file : /lib/firmware/TIInit_11.8.32.bts
Loaded BTS script version 1
Device setup complete
看来几个修改内核配置的帖子,找了半天都没有找到在哪里配置,最后想起了编译内核的时候在boot下有.config文件,但是本来就是y
-
https://unix.stackexchange.com/questions/345348/how-to-configure-bluez-kernel-for-bluetooth-keyboard-peripheral
-
https://elinux.org/Minnowboard:Adding_Bluetooth_Support_To_Your_Kernel
-
https://www.poftut.com/list-and-change-kernel-config-variables-with-sysctl-command/
-
blueman-project /blueman :果然,最新的是v2.14,我apt下的是2.0.8
-
【解决】深度操作系统Linux Deepin 20 内核5.10手动降级-附上大佬解决5.10中失去蓝牙的办法。:emm我还差内核编译这一项没有尝试。。