pactl list cards
查看声卡信息:查看蓝牙耳机声卡Profiles:
Profiles:
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
a2dp-sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 0, available: yes)
headset-head-unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 0, available: no)
可以看出此时默认只支持A2DP协议,不支持HSP/HFP,解释如下:
a2dp-sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 0, available: yes)
headset-head-unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 0, available: no)
结论:当前系统环境下无法支持蓝牙耳机录制,就算从PulseAudio Volume Control工具下切换Configuration也是毫无意义的。
查阅资料发现,可以通过安装pipewire(参考
PipeWire: The Linux audio/video bus)让PulseAudio工作在pipewire上。
详细操作可以参考How to Enable PipeWire Audio Service to Replace PulseAudio in Ubuntu 21.10 & 21.04
步骤如下:
sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream
sudo apt install pipewire
sudo apt install libspa-0.2-bluetooth
pactl info
sam@sam-ThinkPad-Edge-E440:~$ pactl info
Server String: /run/user/1000/pulse/native
Library Protocol Version: 32
Server Protocol Version: 35
Is Local: yes
Client Index: 74
Tile Size: 65472
User Name: sam
Host Name: sam-ThinkPad-Edge-E440
Server Name: PulseAudio (on PipeWire 0.3.39)
Server Version: 15.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_00_1b.0.analog-stereo
Default Source: alsa_input.pci-0000_00_1b.0.analog-stereo
Cookie: 2c95:ace7
查看Server Name出现PipeWire说明安装完成
Server Name: PulseAudio (on PipeWire 0.3.39)
pactl list cards
Profiles:
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
a2dp-sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 0, available: yes)
headset-head-unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 0, available: yes)
a2dp-sink-sbc: High Fidelity Playback (A2DP Sink, codec SBC) (sinks: 1, sources: 0, priority: 0, available: yes)
headset-head-unit-cvsd: Headset Head Unit (HSP/HFP, codec CVSD) (sinks: 1, sources: 1, priority: 0, available: yes)
现在看到A2DP和HSP/HFP都支持了,现在移步到系统Settings或使用PulseAudio Volume Control工具去配置蓝牙耳机的profile为HSP/HFP,即可使用蓝牙耳机的mic功能。