PulseAudio与蓝牙音频

背景

Linux下面是怎么使用蓝牙音频的呢? 今天我们一起来看看,通过命令行使用 PulseAudio 来联动蓝牙音频。

PulseAudio与Bluetooth音频

PulseAudio的所有蓝牙功能都依赖于BlueZ,此外,HFP支持还需要oFono
PulseAudio 支持3个主要的和音频相关的蓝牙profiles:

  • A2DP (Advanced Audio Distribution Profile)
  • HSP (Headset Profile)
  • HFP (Hands-Free Profile)

PulseAudio蓝牙后端

Bluetooth backend listens to BlueZ and oFono events on D-Bus and automatically creates PulseAudio cards, sources, and sinks for all discovered Bluetooth devices.
PulseAudio的蓝牙后端会监听D-Bus上的BlueZ和oFono事件,然后对于多有发现的蓝牙设备自动地创建PulseAudio声卡,sources和sinks。

现在比较新的版本,蓝牙连接后,使用aplay -l 或ls /proc/asound/看不到PulseAudio蓝牙虚拟的出来的声卡,需要使用PulseAudio的命令pactl list cards查看

蓝牙音频也可以不用PulseAudio,使用 BlueALSA (bluez-alsa),这个我们后面再学习研究。

前提条件

蓝牙

  • 蓝牙模块已通
  • 确保bluez的守护进程已启动

。。。。。。