页次: 1
最初,我尝试使用桌面蓝牙小部件连接耳机,但连接失败。我检查了必要的软件包是否已安装,包括 bluez、bluez-utils、pipewire、pipewire-pulse、wireplumber 和 pipewire-alsa,它们都已安装。
然后检查了 systemd 服务的状态,发现它正常运行。
```
● pipewire.service - PipeWire Multimedia Service
Loaded: loaded (/usr/lib/systemd/user/pipewire.service; enabled; preset: enabled)
Active: active (running) since Sun 2025-02-09 18:23:50 CST; 1h 43min ago
Invocation: 3ef51a86ec9c4cfa9d25f075e1146414
TriggeredBy: ● pipewire.socket
Main PID: 5159 (pipewire)
Tasks: 3 (limit: 18282)
Memory: 7.2M (peak: 8.3M)
CPU: 366ms
CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
└─5159 /usr/bin/pipewire
Feb 09 18:23:50 arch systemd[799]: Started PipeWire Multimedia Service
```
接着,我尝试使用 `bluetoothctl` 进行连接,但仍然失败,并返回了错误信息。
```
Failed to connect: org.bluez.Error.Failed br-connection-page-timeout
```
清除缓存并重新配对后,问题依旧存在。
检查 `rfkill` 发现没有设备被阻止。
重启系统后再次尝试连接,这次成功了。
然而,音频仍然从扬声器输出,而不是耳机。
在系统设置 -> 声音 -> 端口选择中,耳机显示为“未插入”,选择这一项后仍然没有声音。
使用 `pactl list sinks` 检查当前的音频输出设备,发现音频接收器列表中没有耳机选项。
这表明虽然蓝牙连接在协议层面已经建立,但 PipeWire 并未识别耳机为有效的音频设备。
检查相关的配置目录,发现它们仍然是默认的空配置。
`journalctl` 仅报告了一个错误
```
Feb 09 18:24:37 arch pipewire-pulse[5161]: mod.protocol-pulse: client 0x56b99990ddd0 [Firefox]: ERROR command:-1 (invalid) tag:57 error:25 (Input/
output error)
```
但这个问题不仅仅出现在 Firefox,VLC 也无法通过耳机输出音频。
我的耳机是 Sony WH-CH720N,在网上查找后没有发现已知的兼容性问题。
目前不清楚该如何解决,希望能得到一些帮助。
Edit:
新线索:我发现蓝牙模块并未被pipewire加载
```
pactl load-module module-bluetooth-discover
```
```
Failure: No such entity
```
我在网上搜索到似乎在 Arch Linux 上,PipeWire 及其各项功能(包括蓝牙支持)都已经包含在主软件包中,我只需要确保安装和配置好相关的组件即可。`pipewire-audio-client-librarie` target not found
```
find /usr/lib/pipewire-0.3 -name "*blue*"
```
有关pipewire的蓝牙模块文件,什么也没找到
Edit:
蓝牙模块没问题。我在 spa2.0 目录中找到了它。原来蓝牙支持是由 SPA 插件处理的。
并且我发现我的另一个蓝牙耳机连接得很好。
[重要发现]Edit:
根据 `bluetoothctl info` 输出,该设备目前在蓝牙低功耗(LE)模式下运行,仅支持 GATT(Generic Attribute Profile),该配置文件设计用于数据传输而非音频流。而且连接设备后,连接只能持续几秒钟。
耳麦固件或 bluez 可能会错误地协商profile。耳机卡在 “低能耗 ”模式。
我不知道是否可以强制耳麦切换到经典蓝牙模式。
耳麦固件是最新的。
[Solved]Edit
索尼 WH-720N 有两种模式:正常模式(只需打开)和配对模式。正常模式 "便于快速连接,无需手动干预。但是,如果您想将耳机与新设备配对,则需要启动 “配对模式”。为此,请按住电源按钮约 5 秒钟,直到指示灯闪烁蓝光。索尼 WH-CH720N 耳机在我刚买来时,如果没有检测到附近有任何先前连接过的设备,开机后就会自动进入配对模式。于是,我的 Windows 系统顺利地连接上了它。要连接我的 Arch Linux,进入 “配对模式 ”是必要步骤之一。
事实证明,只要在 `/etc/bluetooth/main.conf`"中禁用设备的 BLE,就能将耳机强制设置为经典模式。在此之前,我先在 `bluetoothctl` 中删除了耳机的配对信息
```
[General]
ControllerMode = bredr # 强制使用经典蓝牙
DisableLE=yes # 明确禁用 BLE
```
重启蓝牙服务
再次尝试连接耳机。这次,我注意到连接很顺利,设备名称变成了 [WH-720H],这意味着它的模式不再是 LE。
``
pactl list cards | grep -i bluez
```
注意到profile="off"
```
pactl list sinks short
```
设备已被识别为音频汇。我通过 `pavucontrol` 选择了它。音频流正确路由。
最近编辑记录 lama1kid (2025-02-17 20:52:52)
离线
页次: 1