蓝牙游戏手柄不工作

蓝牙游戏手柄不工作

Device description

I just got myself a new gamepad, which is a wirless xbox one controller. I don't know how to name the exact variant, but it's an original product, not the pro one, has a filled-in dpad and has a USB-C port. I suspect it's a pretty recent model.

The old controller worked great. I have no idea what particular controller it is, but it also a wireless xbox controller. Dpad is not filled-in and it has a micro usb port.

The problem

With the new controller, if I attempt to pair and connect, I get error messages from bluetoothd and the connection either never happens or gets broken immediately after it is made.

bluetoothctl commands I am using:

[bluetooth]# power on
Changing power on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:1A:7D:DA:71:13 Discovering: yes
[NEW] Device 44:16:22:7A:58:B3 Xbox Wireless Controller
[CHG] Device 44:16:22:7A:58:B3 ManufacturerData Key: 0x0006
[CHG] Device 44:16:22:7A:58:B3 ManufacturerData Value:
  03 00 80                                         ...             
[CHG] Device 44:16:22:7A:58:B3 ManufacturerData Key: 0x0006
[CHG] Device 44:16:22:7A:58:B3 ManufacturerData Value:
  00                                               .               
[bluetooth]# scan off
Discovery stopped
[CHG] Device 44:16:22:7A:58:B3 TxPower is nil
[CHG] Device 44:16:22:7A:58:B3 RSSI is nil
[CHG] Controller 00:1A:7D:DA:71:13 Discovering: no
[Xbox Wireless Controller]# pair 44:16:22:7A:58:B3
Attempting to pair with 44:16:22:7A:58:B3
[CHG] Device 44:16:22:7A:58:B3 Paired: yes
Pairing successful
[CHG] Device 44:16:22:7A:58:B3 Connected: no
[bluetooth]# trust 44:16:22:7A:58:B3
[CHG] Device 44:16:22:7A:58:B3 Trusted: yes
Changing 44:16:22:7A:58:B3 trust succeeded
[bluetooth]# connect 44:16:22:7A:58:B3
Attempting to connect to 44:16:22:7A:58:B3
Failed to connect: org.bluez.Error.Failed

Errors that bluetoothd outputs (started with /usr/lib/bluetooth/bluetoothd -n:

bluetoothd[354718]: profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
bluetoothd[354718]: profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
bluetoothd[354718]: profiles/input/hog-lib.c:report_map_read_cb() Report Map read failed: Request attribute has encountered an unlikely error
bluetoothd[354718]: profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
bluetoothd[354718]: profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
bluetoothd[354718]: src/service.c:service_accept() input-hog profile accept failed for 44:16:22:7A:58:B3
bluetoothd[354718]: profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Encryption required before read/write
bluetoothd[354718]: profiles/input/hog-lib.c:report_map_read_cb() Report Map read failed: Encryption required before read/write
bluetoothd[354718]: profiles/input/hog-lib.c:report_map_read_cb() Report Map read failed: Request attribute has encountered an unlikely error
bluetoothd[354718]: profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
bluetoothd[354718]: profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
bluetoothd[354718]: profiles/battery/battery.c:batt_io_ccc_written_cb() Battery Level: notifications not enabled Request attribute has encountered an unlikely error

The log is basically spammed with these and similar error messages.

Full bluetoothctl session log: http://tcp.st/eaesd
Full bluetoothd output (I added a couple newlines before trying to pair): http://tcp.st/vx933
(links valid till 2021-11-20)

I have tried this on two different Arch Linux machines and the results were similar. Pairing it with an Android device, however, works flawlessly, so I assume the controller itself is working fine.

The actual question

这些错误实际上意味着什么? “不太可能的错误”并不是最具描述性的错误消息 - 我如何才能找到更多信息?还有一些错误提示“读/写之前需要加密”。如果这是必要的,为什么蓝牙不进行加密?您可以关闭此要求吗?或者它是协议的一部分吗?

理想情况下,我的问题是“我该如何解决这个问题?”,但我不确定是否有人能找到答案,所以一些关于如何调试这个问题的提示将不胜感激。

答案1

所以我最终确实让它发挥了作用。解决方案是将这一行添加到/etc/bluetooth/main.conf[General]部分中:
Privacy = device

它仍然无法完美工作 - 按下按钮和注册操作之间存在明显的延迟,但已建立连接。

相关内容