Arch 使用AirPods的一些解决方法

容小狸 Lv3

我是中度苹果生态受害者享受者。我正在用的是苹果的手机,以及AirPods Pro 2。但是电脑端我使用的是Arch Linux,那么问题来了:如何使用Arch Linux连接AirPods Pro 2,并且使用AirPods的苹果生态的功能?

请注意,这篇文章由于我没有安卓系统,因此我无法验证安卓部分的内容。

无意间的推送

在我像往常一样在bing上乱逛的时候,跳出来了一个搜索词:Linux AirPods,我就搜了一下,
结果发现除了Linux 蓝牙连接AirPods的普通教程以外,还真有Linux使用AirPods的苹果专有功能的教程,里面就提到了这个LibrePods的仓库

正式使用

Pre-requisites

作者说:

Root Requirement
If you are using ColorOS/OxygenOS 16, you don’t need root except for customizing transparency mode, setting up hearing aid, and use Bluetooth Multipoint. Changing ANC, conversational awareness, ear detection, and other customizations will work without root.

由于一个上古Bug,安卓手机需要xposed root权限。作者曾经做出了一个解决方案,但是由于每个厂商处理方式不一致,因此会有各种不适配,但是root后,就可以正常使用了,而且根据作者所说,root后还支持使用控制中心调节。如果你是ColorOS或OxygenOS 16,那么对于基础功能来说你就不需要root了。

如果不是Arch,那么你可能需要源码安装。如果是Arch,跳转到下一步,直接安装,让你的包管理器处理依赖即可。
参见原仓库的Linux安装

  • 你的手机MAC地址

  • Qt6

1
2
3
4
5
6
7
8
9
10
11
# For Arch Linux / EndeavourOS
sudo pacman -S qt6-base qt6-connectivity qt6-multimedia-ffmpeg qt6-multimedia

# For Debian
sudo apt-get install qt6-base-dev qt6-declarative-dev qt6-connectivity-dev qt6-multimedia-dev \
qml6-module-qtquick-controls qml6-module-qtqml-workerscript qml6-module-qtquick-templates \
qml6-module-qtquick-window qml6-module-qtquick-layouts

# For Fedora
sudo dnf install qt6-qtbase-devel qt6-qtconnectivity-devel \
qt6-qtmultimedia-devel qt6-qtdeclarative-devel
  • OpenSSL 开发头文件
1
2
3
4
5
6
7
8
# On Arch Linux / EndevaourOS, these are included in the OpenSSL package, so you might already have them installed.
sudo pacman -S openssl

# For Debian / Ubuntu
sudo apt-get install libssl-dev

# For Fedora
sudo dnf install openssl-devel
  • Libpulse 开发头文件
1
2
3
4
5
6
7
8
# On Arch Linux / EndevaourOS, these are included in the libpulse package, so you might already have them installed.
sudo pacman -S libpulse

# For Debian / Ubuntu
sudo apt-get install libpulse-dev

# For Fedora
sudo dnf install pulseaudio-libs-devel
  • CMake
1
2
3
4
5
6
7
8
# For Arch Linux / EndeavourOS
sudo pacman -S cmake

# For Debian / Ubuntu
sudo apt-get install cmake

# For Fedora
sudo dnf install cmake

安装LibrePods

因为目前我用的是Arch Linux,纳米AUR,小子! 直接AUR安装就可以了:

1
paru -S librepods

其他Linux发行版可能需要源码编译,参见原仓库的Linux安装

安卓直接下这个安装包。别忘了root。

在设置中填写手机的MAC地址,然后按一下Change Phone MAC,就可以了。

到这里其实已经可以用基础功能了,比如电量显示,调节降噪模式等。如果需要自动连接,去设置中自己设置信任设备,或者使用bluetoothctl来搞定这件事。

如果你需要设备切换之类的功能,那么你需要以下步骤:

模仿Apple设备

Turns out, if you change the VendorID in DID Profile to that of Apple, you get access to several special features!

/etc/bluetooth/main.conf,里面有一行DeviceID = 1234:5678:abcd类似的。如果没有被注释,或者你没有用这个来做一些奇奇怪怪的东西的话,
你可以直接取消那行注释(删掉行前的#),把那一行变成DeviceID = bluetooth:004C:0000:0000,就可以了。

如果是安卓的话,那就更简单了:在App设置里直接找到act as Apple device,打开就行。

你就能获得:

  • 多设备连接 Multi-device Connectivity
  • 无障碍和助听器(貌似安卓正在开发?)Accessibility Settings and Hearing Aid

测试下来的一点小问题

如果你是Linux加苹果设备多设备连接,你在设置的地方就不需要选择Cross-Device Connectivity with Android,这大概率会使蓝牙崩溃
(你需要重启蓝牙,如果是KDE的话蓝牙这个地方关了再开就可以了)

更正:这条有点问题,可能是转移音频的时候就会出问题?也有可能是苹果设备和Linux同时连接的时候就会出问题,不过关掉这个之后貌似没啥大问题了。有空总结一下。

Linux媒体控制可能会有点问题。根据原文还是不太行:

PipeWire/WirePlumber (Recommended)
Create ~/.config/wireplumber/wireplumber.conf.d/51-bluez-avrcp.conf:

1
2
3
4
5
monitor.bluez.properties = {
# Enable dummy AVRCP player for proper media control support
# This is required for AirPods and other devices to send play/pause/skip commands
bluez5.dummy-avrcp-player = true
}

写在最后

开源,爽!有了这个妈妈再也不用担心AirPods太难用的问题了,以后我就可以在地铁上无缝切换两边音频啦!

  • 标题: Arch 使用AirPods的一些解决方法
  • 作者: 容小狸
  • 创建于 : 2025-12-01 12:23:31
  • 更新于 : 2025-12-03 16:15:13
  • 链接: https://blog.rongxiaoli.top/2025/12/01/Arch AirPods/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论