有时会发生我的蓝牙鼠标与笔记本电脑断开连接的情况。关闭/打开鼠标无济于事。关闭/打开我的笔记本电脑蓝牙也无济于事。甚至没有systemctl restart bluetooth.service帮助。
但是,如果我关闭我的笔记本电脑盖子进入睡眠状态并在几秒钟后重新打开它,与 bt 鼠标的连接将重新建立,然后一切正常。
重启也无济于事。我必须关闭/打开笔记本电脑
编辑: 根据要求,这里是一些调试信息:
$ systemctl status bluetooth.service
? bluetooth.service - Bluetooth service
Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2018-09-05 09:44:14 CEST; 4h 5min ago
Docs: man:bluetoothd(8)
Main PID: 388 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 4915)
Memory: 3.4M
CGroup: /system.slice/bluetooth.service
??388 /usr/lib/bluetooth/bluetoothd
set 05 09:44:17 xps-13-luca bluetoothd[388]: Endpoint registered: sender=:1.77 path=/MediaEndpoint/A2DPSource
set 05 09:44:17 xps-13-luca bluetoothd[388]: Endpoint registered: sender=:1.77 path=/MediaEndpoint/A2DPSink
set 05 09:49:50 xps-13-luca bluetoothd[388]: Endpoint …Run Code Online (Sandbox Code Playgroud) 我正在使用 Debian Jessie(测试)。我有一个蓝牙鼠标(Microsoft Sculpt Comfort),我可以配对并使用它,但是在一段时间不活动(大约 10 分钟)后它停止工作,我必须手动触摸鼠标上设置的可发现按钮并重新-在命令行上配对。
我在 OS X 上试过的同一个鼠标,它可以工作,所以这不是硬件问题
内核 3.14.12-1 (2014-07-11)
我将鼠标与此命令配对:
sudo hidd --connect 30:59:B7:72:A5:A7
Run Code Online (Sandbox Code Playgroud)
正确配对后,这是/var/log/syslog输出
Jan 7 15:22:42 desktop hidd: New HID device 30:59:B7:72:A5:A7 (Microsoft Bluetooth Mouse )
Jan 7 15:22:42 desktop kernel: [103877.102083] hid-generic 0005:045E:07A2.0009: unknown main item tag 0x0
Jan 7 15:22:42 desktop kernel: [103877.102481] input: Microsoft Bluetooth Mouse as /devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0/bluetooth/hci0/hci0:42/0005:045E:07A2.0009/input/input51
Jan 7 15:22:42 desktop kernel: [103877.102884] hid-generic 0005:045E:07A2.0009: input,hidraw3: BLUETOOTH HID v1.29 Mouse [Microsoft Bluetooth Mouse ] on …Run Code Online (Sandbox Code Playgroud) 我可以将蓝牙耳机与笔记本电脑配对一次。但是当我断开耳机时,我无法再次重新连接。它工作的唯一方法是重新启动蓝牙守护进程:
service bluetooth restart
Run Code Online (Sandbox Code Playgroud)
当我这样做时,我在日志中看到以下内容:
bluetoothd: Terminating
bluetoothd: Stopping hci0 event socket
bluetoothd: Stopping SDP server
bluetoothd: Exit
bluetoothd: Bluetooth daemon 4.99
bluetoothd: Starting SDP server
bluetoothd: Excluding (conf) network
bluetoothd: Excluding (conf) gatt_example
bluetoothd: Excluding (conf) time
bluetoothd: Excluding (conf) alert
bluetoothd: Failed to open RFKILL control device
bluetoothd: Listening for HCI events on hci0
bluetoothd: HCI dev 0 up
bluetoothd: Proximity GATT Reporter Driver: Operation not permitted (1)
bluetoothd: Could not get the contents of DMI chassis type …Run Code Online (Sandbox Code Playgroud) 我试图在启动时禁用蓝牙,而不将内核模块列入黑名单。
我在 中评论了以下两行/etc/init/bluetooth.conf:
start on started dbus
stop on stopping dbus
Run Code Online (Sandbox Code Playgroud)
然后我补充说:
stop on runlevel [0123456]
Run Code Online (Sandbox Code Playgroud)
在文件中/etc/init.d/bluetooth,在 之前exit 0,我添加了以下行:
rfkill block bluetooth
Run Code Online (Sandbox Code Playgroud)
这些尝试都没有成功。
我在网上看到在/etc/rc.local文件中添加最后一个命令。但不是这个文件,我得rc0.d给rc6.d和rcS.d文件夹,完整的符号链接脚本。
我在 Ubuntu-Mate 17.04 下运行,使用 4.10.0 内核。
我是 Linux 新手,也是蓝牙脚本的新手。到目前为止我发现的是以下内容:
这是有道理的。因此,假设我有一组蓝牙耳机,我期望的是(在配对和信任之后),能够发出可以直接连接到 BT 耳机上的某个配置文件的命令。
我想到的技术路径是这样的:
这一切看似合乎逻辑,但实际的实现并不是这样的,我正在寻找原因,这样我才能更好地理解问题并尝试修复它。
这是实际发生的事情:
让我稍微扩展一下。蓝牙耳机提供 2 种质量模式(电话和高保真)。只有1真的适合听音乐。
我希望 BT 耳机将每种质量模式作为服务公开,对吗?这个假设可能是错误的,但我希望像
bt-audio -c highFidelityProfile
或者
bt-audio -changeProfile highFidelityProfile
相反,Bluez 似乎只是处理与设备的 RAW 连接,您需要从那里发出:pacmd set-card-profile $INDEX a2dp
这似乎从根本上是错误的。为什么在音频子系统中进行质量控制,因此需要对脉冲或 alsa 或任何其他声音子系统进行不同的实现?
我错过了什么?为什么不能使用 Bluez / BluezTools 等直接连接到某个配置文件?
一直在配对和维护连接我的蓝牙扬声器时遇到问题,终于在阅读和阅读后找到了一些步骤来实现它。请提前阅读。
我的计算机是否可以假装它是蓝牙鼠标,以便其他设备可以连接到它?
一个安卓设备允许它的鼠标被蓝牙控制而无需root,我的电脑有蓝牙,所以如果我能让他们说相同的语言/协议,我可以从电脑向安卓发送鼠标命令。
有可能吗,还是我只是在做梦?:-)
我正在尝试使用 Broadcom 和 CSR 芯片组设置蓝牙加密狗的(查询)传输功率hciconfig,例如:
hciconfig hci0 inqtpl 3
Run Code Online (Sandbox Code Playgroud)
但是无论我传递什么有效参数,之后读取该值总是会产生 0,如下所示:
hci0: Type: BR/EDR Bus: USB
BD Address: 00:02:72:D6:6B:25 ACL MTU: 1021:8 SCO MTU: 64:1
Inquiry transmit power level: 0
Run Code Online (Sandbox Code Playgroud)
当我传递无效值时,我收到一条错误消息:
Can't set inquiry transmit power level on hci0: Input/output error (5)
Run Code Online (Sandbox Code Playgroud)
所以很明显,参数被检查了有效性。我很确定它是由芯片组检查的,因为在手动发送适当的 HCI 命令时我得到了相同的结果。
两种芯片组还声明它们支持此功能:
# hciconfig hci0 features
hci0: Type: BR/EDR Bus: USB
BD Address: 00:02:72:D6:6B:25 ACL MTU: 1021:8 SCO MTU: 64:1
Features page 0: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
[...]
<err. data …Run Code Online (Sandbox Code Playgroud) 尝试将一些无线耳机连接到我的笔记本电脑。他们几天前工作然后停止了,我不明白为什么。在此之前,它会工作几天,然后停止,直到我重新启动或几个小时后再次尝试。现在已经快2周没有效果了。
$ neofetch
OS: Arch Linux x86_64
Host: 20BU000AUS ThinkPad T450
Kernel: 5.17.7-zen1-2-zen
# Installed
bluez 5.64-2
bluez-firmware 1.2-9
bluez-hid2hci 5.64-2
bluez-libs 5.64-2
bluez-utils 5.64-2
hidapi 0.11.2-1
libldac 2.0.2.3-1
pulseaudio-bluetooth 15.0-4
sbc 1.5-2
$ bluetoothctl show
Powered: yes
Discoverable: no
Pairable: yes
$ bluetoothctl info 8D:40:4C:C6:73:A4
Device 8D:40:4C:C6:73:A4 (public)
Paired: yes
Trusted: yes
Blocked: no
Connected: no
LegacyPairing: no
$ bluetoothctl connect 8D:40:4C:C6:73:A4
Attempting to connect to 8D:40:4C:C6:73:A4
Failed to connect: org.bluez.Error.Failed br-connection-profile-unavailable
$ journalctl -u bluetooth
bluetoothd[13782]: src/service.c:btd_service_connect() a2dp-sink …Run Code Online (Sandbox Code Playgroud) 我使用蓝牙管理器连接到我的新 K380,没有配对过程。之后,使用一段时间后,我注意到键盘不再响应,我总是重新连接它以使其正常工作。
我想知道是否有命令行方式来配对,因为蓝牙管理器说“设备存在配对问题”。
我将 Ubuntu 20.04 与 Dell Latitude e5450 和 Intel Wireless 7265(版本 59)一起使用
bluetooth ×10
arch-linux ×2
bluez ×2
debian ×2
pulseaudio ×2
boot ×1
hid ×1
keyboard ×1
linux-mint ×1
mouse ×1
services ×1
ubuntu ×1
usb ×1