arch-linux– 使用桌面作为蓝牙耳机

arch-linux– 使用桌面作为蓝牙耳机,第1张

概述我的桌面扬声器比我的手机要好得多,所以我想用我的桌面扬声器代替我的手机.使用USB或音频插孔对我来说不方便,所以我留下了蓝牙.我已经使用bluetoothctl配对了我的手机,但在尝试连接时我得到了这个:[bluetooth]#pair00:00:00:00:00:00Attemptingtopairwith00:00:00:00:00:

我的桌面扬声器比我的手机要好得多,所以我想用我的桌面扬声器代替我的手机.使用USB或音频插孔对我来说不方便,所以我留下了蓝牙.我已经使用bluetoothctl配对了我的手机,但在尝试连接时我得到了这个:

[bluetooth]# pair 00:00:00:00:00:00 Attempting to pair with 00:00:00:00:00:00[CHG] Device 00:00:00:00:00:00 Connected: yesRequest confirmation[agent] Confirm passkey 000000 (yes/no): yes[CHG] Device 00:00:00:00:00:00 Modalias: bluetooth:a000Aa000000000[CHG] Device 00:00:00:00:00:00 UUIDs: 00000000-0000-1000-8000-00000a0a00aa[CHG] Device 00:00:00:00:00:00 UUIDs: 00000000-0000-1000-8000-00000a0a00aa...[CHG] Device 00:00:00:00:00:00 UUIDs: 00000000-0000-1000-8000-00000a0a00aa[CHG] Device 00:00:00:00:00:00 UUIDs: 000000000-0000-1000-8000-00000a0a00aa[CHG] Device 00:00:00:00:00:00 Paired: yesPairing successful[CHG] Device 00:00:00:00:00:00 Connected: no[CHG] Device 00:00:00:00:00:00 RSSI: -75[bluetooth]# connect 00:00:00:00:00:00 Attempting to connect to 00:00:00:00:00:00Failed to connect: org.bluez.Error.Failed

我已经在00:00:00:00:00:00更换了我的mac地址,但实际的mac地址与我手机报告的地址相匹配.我对配对引脚,Modalias和UUID做了同样的事情,虽然我不知道最后两个是什么.

解决方法:

感谢pulseaudio*的两个模块与bluez的结合,现在实际上很容易实现.

安装必备软件包:

sudo pacman -S bluez bluez-utils pulseaudio-bluetooth

将您的用户添加到pulseaudio组:

sudo usermod -a -G lp $USER

打开或重新启动蓝牙守护程序:

sudo systemctl restart bluetooth

启用蓝牙设备:

sudo hciconfig hci0 up

如果你有多个蓝牙设备,你应该用正确的标识符替换hci0,这可以通过运行没有参数的hciconfig找到.

现在我们可以使用交互式bluetoothctl实用程序连接我们的设备.

首先,我们将通过其主机名使我们的Arch机器可被发现:

$bluetoothctl[NEW] Controller AA:BB:CC:DD:EE:FF arch [default][bluetooth]# agent onAgent registered[bluetooth]# default-agentDefault agent request successful[bluetooth]# discoverable onChanging discoverable on succeeded[CHG] Controller AA:BB:CC:DD:EE:FF discoverable: yes

您的手机现在应该可以找到您的Arch盒子.选择设备并返回到您的提示以确认:

Request confirmation[agent] Confirm passkey 748794 (yes/no): yes[CHG] Device FF:EE:DD:CC:BB:AA ...... snipped ...[agent] Authorize service 0001... (yes/no): yes... snipped ...[agent] Authorize service 0001... (yes/no): yes[CHG] Controller AA:BB:CC:DD:EE:FF discoverable: no

我有一些断开连接问题,只需在连接后运行trust命令即可解决.

[phone]# trust[CHG] Device FF:EE:DD:CC:BB:AA Trusted: yesChanging  trust suceeded

就是这样,你应该能够通过桌面扬声器播放音频.

总结

以上是内存溢出为你收集整理的arch-linux – 使用桌面作为蓝牙耳机全部内容,希望文章能够帮你解决arch-linux – 使用桌面作为蓝牙耳机所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1112128.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存