请帮忙看一下怎么处理,UOS 20个人版无法使用华为蓝牙鼠标
Tofloor
poster avatar
hedajun
deepin
2020-09-02 20:11
Author
UOS 20个人版无法使用华为蓝牙鼠标,Deepin 20能正常使用。

Reply Favorite View the author
All Replies
2 / 3
To page
Aris
deepin
2020-09-08 22:56
#21
https://bbs.deepin.org/post/201170
似乎报错并没有产生日志呢。
------------
sudo journalctl -f /usr/lib/bluetooth/bluetoothd

你这个日志不全
从日志可以看出 pulse audio往bluez注册了source sink两个服务
用于音频传输和控制

ExecStart=/usr/lib/bluetooth/bluetoothd
后面有没有加  -d

加完之后
systemctl daemon-reload
systemctl restart bluetooth.service

然后连接你的鼠标
连接失败以后
sudo journalctl /usr/lib/bluetooth/bluetoothd -b 0

完整版日志如下
➜  ~ sudo journalctl /usr/lib/bluetooth/bluetoothd -b 0
-- Logs begin at Fri 2020-08-28 09:46:18 CST, end at Tue 2020-09-08 14:40:08 CST. --
9月 08 14:40:00 aris bluetoothd[2133]: Bluetooth daemon 5.50
9月 08 14:40:00 aris bluetoothd[2133]: src/main.c:parse_config() parsing /etc/bluetooth/main.conf
9月 08 14:40:00 aris bluetoothd[2133]: src/main.c:parse_config() Key file does not have key “DiscoverableTimeout” in group “Gen
9月 08 14:40:00 aris bluetoothd[2133]: src/main.c:parse_config() Key file does not have key “PairableTimeout” in group “General
9月 08 14:40:00 aris bluetoothd[2133]: src/main.c:parse_config() Key file does not have key “Privacy” in group “General”
9月 08 14:40:00 aris bluetoothd[2133]: src/main.c:parse_config() Key file does not have key “Name” in group “General”
9月 08 14:40:00 aris bluetoothd[2133]: src/main.c:parse_config() Key file does not have key “Class” in group “General”
9月 08 14:40:00 aris bluetoothd[2133]: src/main.c:parse_config() Key file does not have key “DeviceID” in group “General”
9月 08 14:40:00 aris bluetoothd[2133]: src/main.c:parse_config() Key file does not have key “ReverseServiceDiscovery” in group
9月 08 14:40:00 aris bluetoothd[2133]: src/main.c:parse_config() Key file does not have key “MinEncKeySize” in group “GATT”
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:adapter_init() sending read version command
9月 08 14:40:00 aris bluetoothd[2133]: Starting SDP server
9月 08 14:40:00 aris bluetoothd[2133]: src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0246:0532
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:plugin_init() Loading builtin plugins
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading hostname plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading wiimote plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading autopair plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading policy plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading neard plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading sap plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading a2dp plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading avrcp plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading network plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading input plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading hog plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading health plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading gap plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading scanparam plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading deviceinfo plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading midi plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading battery plugin
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:plugin_init() Loading plugins /usr/lib/x86_64-linux-gnu/bluetooth/plugins
9月 08 14:40:00 aris bluetoothd[2133]: src/plugin.c:add_plugin() Loading sixaxis plugin
9月 08 14:40:00 aris bluetoothd[2133]: profiles/health/hdp.c:hdp_manager_start() Starting Health manager
9月 08 14:40:00 aris bluetoothd[2133]: profiles/input/suspend-none.c:suspend_init()
9月 08 14:40:00 aris bluetoothd[2133]: profiles/network/manager.c:read_config() /etc/bluetooth/network.conf: Key file does not
9月 08 14:40:00 aris bluetoothd[2133]: profiles/network/manager.c:read_config() Config options: Security=true
9月 08 14:40:00 aris bluetoothd[2133]: plugins/neard.c:neard_init() Setup neard plugin
9月 08 14:40:00 aris bluetoothd[2133]: plugins/hostname.c:read_dmi_fallback() chassis: desktop
9月 08 14:40:00 aris bluetoothd[2133]: plugins/hostname.c:read_dmi_fallback() major: 0x01 minor: 0x01
9月 08 14:40:00 aris bluetoothd[2133]: plugins/sixaxis.c:sixaxis_init()
9月 08 14:40:00 aris bluetoothd[2133]: src/main.c:main() Entering main loop
9月 08 14:40:00 aris bluetoothd[2133]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type 2 op 0 soft 0 hard 0
9月 08 14:40:00 aris bluetoothd[2133]: Bluetooth management interface 1.14 initialized
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:read_version_complete() sending read supported commands command
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:read_version_complete() sending read index list command
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:read_commands_complete() Number of commands: 65
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:read_commands_complete() Number of events: 35
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:read_commands_complete() enabling kernel-side connection control
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:read_index_list_complete() Number of controllers: 1
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:read_index_list_complete() Found index 0
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:index_added() index 0
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:btd_adapter_new() System name: BlueZ 5.50
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:btd_adapter_new() Major class: 0
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:btd_adapter_new() Minor class: 0
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:btd_adapter_new() Modalias: usb:v1D6Bp0246d0532
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:btd_adapter_new() Discoverable timeout: 180 seconds
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:btd_adapter_new() Pairable timeout: 0 seconds
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:index_added() sending read info command for index 0
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:read_info_complete() index 0 status 0x00
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:clear_uuids() sending clear uuids command for index 0
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:clear_devices() sending clear devices command for index 0
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:set_mode() sending set mode command for index 0
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:set_mode() sending set mode command for index 0
9月 08 14:40:00 aris bluetoothd[2133]: src/adapter.c:set_mode() sending set mode command for index 0
... ...
Reply View the author
hedajun
deepin
2020-09-09 03:43
#22
https://bbs.deepin.org/post/201170
你这个日志不全
从日志可以看出 pulse audio往bluez注册了source sink两个服务
用于音频传输和控制

上次没有重启服务,重启Bluetooth服务后有log了。见附件,请帮忙分析一下。非常感谢!

Reply View the author
Aris
deepin
2020-09-09 18:50
#23
本帖最后由 aris_aachen 于 2020-9-10 09:56 编辑
https://bbs.deepin.org/post/201170
上次没有重启服务,重启Bluetooth服务后有log了。见附件,请帮忙分析一下。非常感谢!

...

已收到  晚点给出结论
分析日志可以看出  是发起配对请求时,蓝牙鼠标返回了失败状态。
事实上,蓝牙鼠标接收到了系统发起的主动请求。
这种情况,比较可能的情况是  bluez协议不匹配导致的。

稍后会向上游bluez社区提bug。
Reply View the author
Aris
deepin
2020-09-10 22:25
#24
本帖最后由 aris_aachen 于 2020-9-10 14:39 编辑

日志:
9月 08 19:39:19 qw010 bluetoothd[8888]: src/adapter.c:connected_callback() hci0 device E5:4F:38:27:34D connected eir_len 26
9月 08 19:39:19 qw010 bluetoothd[8888]: src/adapter.c:dev_disconnected() Device E5:4F:38:27:34D disconnected, reason 0这个日志可以看出,适配器发起连接,但是却返回了失败,错误的原因为reason 0
从bluez的源码可以看出
static void disconnected_callback(uint16_t index, uint16_t length,
                                        const void *param, void *user_data)
{
        const struct mgmt_ev_device_disconnected *ev = param;
        struct btd_adapter *adapter = user_data;
        uint8_t reason;

        if (length < sizeof(struct mgmt_addr_info)) {
                btd_error(adapter->dev_id,
                                "Too small device disconnected event");
                return;
        }

        if (length < sizeof(*ev))
                reason = MGMT_DEV_DISCONN_UNKNOWN;
        else
                reason = ev->reason;

        dev_disconnected(adapter, &ev->addr, reason);
}

当前返回的MGMT_DEV_DISCONN_UNKNOWN,造成了错误的原因,很可能是在请求sdp服务的时候,发生了错误。
导致了services的database被删除了,所以断开的字符长度不匹配。

日志:
9月 08 19:39:19 qw010 bluetoothd[8888]: src/adapter.c:pair_device_complete() Failed (0x03)
9月 08 19:39:19 qw010 bluetoothd[8888]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr E5:4F:38:27:34D type 2 status 0x3
9月 08 19:39:19 qw010 bluetoothd[8888]: src/device.c:device_bonding_complete() bonding (nil) status 0x03
9月 08 19:39:19 qw010 bluetoothd[8888]: src/device.c:device_bonding_failed() status 3

尝试请求发起配置返回了状态错误MGMT_STATUS_FAILED  
正是这里,促使返回了org.bluez.Error.AuthenticationCanceled
造成这种错误的原因  可能是请求在本机直接失败了,也可能是remote设备内部返回的失败。
如果想要知道具体的原因可以用btmon或者wireshark抓包看看



综合分析来看应该是蓝牙适配器的bluez协议和mouse的bluez适配有问题
正在向bluez开源上游反馈此问题。
Reply View the author
hedajun
deepin
2020-09-10 22:38
#25
https://bbs.deepin.org/post/201170
9月 08 19:39:19 qw010 bluetoothd[8888]: src/adapter.c:connected_callback() hci0 device E5:4F:38:27:3 ...

非常感谢!现在只有等上游的修复了。如果你关注这个bug,修复好了请告诉我一声。再次感谢!
Reply View the author
Aris
deepin
2020-09-10 22:49
#26
https://bbs.deepin.org/post/201170
我的蓝牙鼠标也连接不上

是什么型号的呢
Reply View the author
sailh
deepin
2020-09-22 01:40
#27

我原来用15.5版本,不知从什么时候起,发现日期时间再也不能自动更新同步。于是用UOS 2.0重装了系统。悲剧了,原来可以连接上的华为蓝牙鼠标,怎么折腾也连接不上了。


附件是我的日志,请管理员帮忙看看。


Reply View the author
sailh
deepin
2020-09-28 23:51
#28
网上有人怀疑是华为蓝牙鼠标协议有部分非标造成。故从京东上买了一个联想的蓝牙鼠标,结果还是连接不上,说明不是华为鼠标的问题。
最后,无奈卸载了UOS 2.0,重新安装15.11. 蓝牙鼠标就能连上了。所以应该还是UOS的驱动程序有问题。
Reply View the author
Shinglee
deepin
2020-09-29 18:05
#29
https://bbs.deepin.org/post/203017#

我发的帖子,你自己看下,如果你的无线网卡是 RTL8822CE,直接用我的方法解决,如果不是,参考我的思路解决
Reply View the author
hedajun
deepin
2020-09-29 18:20
#30
https://bbs.deepin.org/post/201170
https://bbs.deepin.org/post/203017#

我发的帖子,你自己看下,如果你的 ...

我的就是这个型号,我抽空试试看能否解决。
----------
01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter
        Subsystem: Electronics & Telecommunications RSH Device 1e25
        Kernel driver in use: rtw_pci
        Kernel modules: rtwpci
Reply View the author
sailh
deepin
2020-09-30 01:29
#31
我的无线网卡版本是Intel内置的,无解
        Network controller: Intel Corporation Cannon Point-LP CNVi [Wireless-AC] (rev 30)
        Subsystem: Intel Corporation Cannon Point-LP CNVi [Wireless-AC]
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi, wl
Reply View the author
Shinglee
deepin
2020-09-30 18:08
#32
https://bbs.deepin.org/post/201170
我的无线网卡版本是Intel内置的,无解
        Network controller: Intel Corporation Cannon Point- ...

你是什么笔记本,报下品牌、型号,我帮你找下原厂驱动
Reply View the author
Luors
deepin
2020-10-06 01:28
#33
https://bbs.deepin.org/post/201170
https://bbs.deepin.org/post/203017#

我发的帖子,你自己看下,如果你的 ...

真的可以用了,感想
Reply View the author
hedajun
deepin
2020-10-09 16:53
#34
https://bbs.deepin.org/post/201170
https://bbs.deepin.org/post/203017#

我发的帖子,你自己看下,如果你的 ...

测试了,确实可以用了。非常感谢!
@jingle  能否下次升级包含这个功能?
Reply View the author
hedajun
deepin
2020-10-09 16:55
#35
mkdir -p /lib/modules/5.4.50-amd64-desktop/kernel/drivers/bluetooth
Start Realtek Bluetooth USB driver installation
mkdir -p /lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_fw to /lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_fw /lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_config /lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_config /lib/firmware
make -C usb install
make[1]: 进入目录“/home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb”
rmmod btusb
mv /lib/modules/5.4.50-amd64-desktop/kernel/drivers/bluetooth/btusb.ko /lib/modules/5.4.50-amd64-desktop/kernel/drivers/bluetooth/btusb_bak
rmmod rtk_btusb
rmmod: ERROR: Module rtk_btusb is not currently loaded
make[1]: [Makefile:9:install] 错误 1 (已忽略)
make -C ./bluetooth_usb_driver
make[2]: 进入目录“/home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver”
make -C /lib/modules/5.4.50-amd64-desktop/build M=/home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver modules
make[3]: 进入目录“/usr/src/linux-headers-5.4.50-amd64-desktop”
  CC [M]  /home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver/rtk_coex.o
  CC [M]  /home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver/rtk_misc.o
  CC [M]  /home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver/rtk_bt.o
  LD [M]  /home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver/rtk_btusb.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver/rtk_btusb.mod.o
  LD [M]  /home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver/rtk_btusb.ko
make[3]: 离开目录“/usr/src/linux-headers-5.4.50-amd64-desktop”
make[2]: 离开目录“/home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver”
cp -f ./bluetooth_usb_driver/rtk_btusb.ko /lib/modules/5.4.50-amd64-desktop/kernel/drivers/bluetooth/rtk_btusb.ko
depmod -a 5.4.50-amd64-desktop
make -C ./bluetooth_usb_driver clean
make[2]: 进入目录“/home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver”
rm -rf *.o *.mod.c *.mod.o *.ko *.symvers *.order *.a
make[2]: 离开目录“/home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb/bluetooth_usb_driver”
echo "install rtk_btusb success!"
install rtk_btusb success!
make[1]: 离开目录“/home/hdj/Downloads/MagicBook/rtk_btusb_rtl8822c-master/usb”
Reply View the author
Shinglee
deepin
2020-10-09 22:27
#36
https://bbs.deepin.org/post/201170
mkdir -p /lib/modules/5.4.50-amd64-desktop/kernel/drivers/bluetooth
Start Realtek Bluetooth USB driv ...

  大兄弟,把命令执行完,别把打印的这些回复我啊
Reply View the author
hedajun
deepin
2020-10-09 22:29
#37
https://bbs.deepin.org/post/201170
大兄弟,把命令执行完,别把打印的这些回复我啊

执行完了的,并且成功了。已经在正常使用蓝牙鼠标了。非常感谢!
Reply View the author
淳朴憨厚老实人
deepin
2020-10-14 23:35
#38
https://bbs.deepin.org/post/201170
https://bbs.deepin.org/post/203017#

我发的帖子,你自己看下,如果你的 ...

感谢大佬,鼠标连接成功了.但是鼠标滚轮的方向是反的,能帮忙看看吗?谢谢
Reply View the author
淳朴憨厚老实人
deepin
2020-10-14 23:39
#39
https://bbs.deepin.org/post/201170
感谢大佬,鼠标连接成功了.但是鼠标滚轮的方向是反的,能帮忙看看吗?谢谢 ...

找到解决方法了,关闭鼠标自然滚动就行啦,非常感谢.华为蓝牙鼠标这问题已经困扰了好久,终于解决了......
Reply View the author
Shinglee
deepin
2020-10-14 23:52
#40
https://bbs.deepin.org/post/201170
感谢大佬,鼠标连接成功了.但是鼠标滚轮的方向是反的,能帮忙看看吗?谢谢 ...

设置,鼠标,自然滚动 还是啥的设置,更改一下
Reply View the author
2 / 3
To page