我的桌面扬声器比手机好得多,所以我想用桌面扬声器代替手机扬声器。我使用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: yes
Request 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: yes
Pairing 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:00
Failed to connect: org.bluez.Error.Failed
我已将我的 mac 地址替换为00:00:00:00:00:00
,但实际的 mac 地址与我的手机报告的地址相符。我对配对引脚、Modalias 和 做了同样的事情UUIDs
,尽管我不知道最后两个是什么。
答案1
感谢来自的两个模块pulseaudio
*现在,与此建立联系bluez
实际上很容易做到。
安装必需的软件包:
sudo pacman -S bluez bluez-utils pulseaudio-bluetooth
将您的用户添加到pulseaudio
组中:
sudo usermod -a -G pulseaudio $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 on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# discoverable on
Changing 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: yes
Changing trust suceeded
就是这样,您应该能够通过桌面扬声器播放音频。